ok. after doing further research, I found that it is not related to any particular column name. Rather, ANY data in column “AF” (which translates to column index 31, 0 based) will change to datatype int32 even if the data is marked as string.
Please close the issue. This is fixed.
How can force ExportDataTable to read data based on configuration rather than data in the columns. Example, I have an excel column which is alphanumeric, it works fine when there is an alphanumeric data in the first row ( reads as string) if the data in the first row is numeric, it reads as double and it fails because processing logic expects it to be a string… Is there any way I can say column 1 is int and column 2 is string etc.
Is this possible for other methods like “CreateExcelFromSqlDataReader” to set datatype for a column is determined by the very first value in that column?
There is no such method, i.e., “CreateExcelFromSqlDataReader” available in Aspose.Cells APIs. Aspose.Cells has Cells.ImportDataReader() method which is used to import data reader object into Excel sheet, see the document what other data importing options are available for your reference:
My question is about the same method Cells.ImportDataReader().
Is this possible for Cells.ImportDataReader() method to set datatype for a column is determined by the very first value in that column?
I am afraid, the Cells.ImportDataReader() method is for importing data from data reader object to worksheet and not exporting from worksheet to data reader object. So, there is no question for the data type of a column to be determined, it will import data from data reader as it is there.