Currently we are using EpPlus for excel calculation.
We are migrating to Aspose now.
var templateColOrder = new List();
worksheet = package.Workbook.Worksheets.SingleOrDefault(x => x.Name == Constants.TemplateType.Data_Collector);
for (int col = worksheet.Dimension.Start.Column + 1; col <= worksheet.Dimension.End.Column; col++)
templateColOrder.Add(new { Id = col - 1, ColName = worksheet.Cells[23, col].Text.Replace("\n", string.Empty) });
What will be alternate for above code? Address property of Aspose.cells.range returns a sting. So we are not able to manipulate it.
The above code is in c#
Worksheet.Cells.MaxDataRow will return only if there is data. Here are just downloading a empty template. you can revisit the for loop again and tell some suggestions. image.png (52.1 KB)
I have debugged the high lighted the value in the screen shot. Please help how to achieve it?
If the worksheet is empty but having cells initialized with customized width/height or formattings (applied), then you may use Worksheet.Cells.MaxRow and Worksheet.Cells.MaxColumn attributes instead.
In case, the attributes are not giving what you want to achieve, kindly zip and attach your template Excel file and provide more details. We will check and help you soon.
In EpPlus, we have property as “ExcelTable”, not sure what should be used in Aspose.
Also, what can be used instead of LoadFromDataTable and LoadFromCollection in Aspose
worksheetBOM.Cells[“A2”].LoadFromCollection(bomDraft, false);
It will greatful if you provide a solution.
I have a code as below
List dealAttributeListPart1 = new List();
– added some values to the above string list
ImportTableOptions importOptions = new ImportTableOptions();
importOptions.IsFieldNameShown = false;
Please first see the example in the document and then devise your code accordingly. If you still find the issue, kindly create a standalone console application, zip the VS.NET project and post us here, we will check it soon.
PS. please do not include Aspose.Cells.Dll in the zipped archive project to minimize the size of the zipped file.