hope be well.
I have multiple quantity take-off and each quantity has a specific worksheet. I faced error when I wanted to create the table for them The error was "Table name invalid" the code works for single worksheet.
// Filter schedules to be exported
foreach (ViewSchedule schedule in scheduleCollector.Cast<ViewSchedule>())
{
if (selectedSchedules.Contains(schedule.Name))
{
exportSchedules.Add(schedule);
}
}
// Export schedules to Excel
using (ExcelPackage package = new ExcelPackage())
{
foreach (var schedule in exportSchedules)
{.
.
.
.
.
.
.
}
table(dataRange,worksheet, schedule.Name);
private void table(ExcelRange dataRange, ExcelWorksheet worksheet,string schedulenametable)
{
// Create Excel Table
var table = worksheet.Tables.Add(dataRange, schedulenametable);
table.TableStyle = TableStyles.Light1; // Choose a table style
// Auto-filter on headers
table.ShowHeader = true;
table.ShowFilter = true;
table.ShowTotal = false;
}
`
I really appreciated if you help me .
I also check the schedule.name with taskdialog and the resulat was unig name for each quantity but idk for multi table how is possible to do that?