Free Support Forum - aspose.com

Cells.ImportCustomObjects including ID column regardless of propertyNames list

I have the following code…


Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets.Add(“Documents”);
sheet.Cells.ImportCustomObjects(
list,
new[] {
“GenCode”,
“Description”,
“EffectiveDate”,
“LocationName”,
“LifeCycleStatusID_Text”
},
true,
0,
0,
list.Count,
true,
settings.ClientDateFormat,
false);

When I open the resulting excel file I’m finding I have the following columns have been exported…

ID Description EffectiveDate LocationName LifeCycleStatusID_Text

There is an ID property on the objects in the list, however I do not wish to include this column in the Excel spreadsheet. As you can see above ID is not a member of the propertyNames array. How can I exclude the ID column from the resulting Excel file?

Hi,


Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells for .NET (Latest Version) and see if it makes any difference in resolving this issue.

If your issue still occurs, then please provide us your sample runnable console application project replicating this issue with the latest version. We will look into it and help you asap. Thanks for your cooperation in this regard and have a good day.

It is indeed fixed in 16.11.


Thanks

Hi,


Good to know that your issue is sorted out by the new fix/version. Feel free to write us back if you have further queries or issue, we will be happy to assist you soon.

Thank you.