Posted 16 April 2018, 3:53 am EST
I have a large application that was written using ActiveReports 6 and recently upgraded it to use version 11. After doing that I noticed that when exporting reports to Excel, all the exported data in Excel is now plain text, whereas when using v6 the data was formatted (Number, Date, etc.). The application creates a SectionReport and then places data on the report page using:
sectionReport.CurrentPage.DrawText(“04/16/2018”, locationRectangle); // Example of writing a Date to the report
After that, the report is finally exported to Excel using:
using (var export = new XlsExport())
{
export.AutoRowHeight = true;
export.UseCellMerging = true;
// When using AR v6, the Excel file had 04/16/2018 as a Date format
// When using AR v11, the Excel file has 04/16/2018 as a Text format
export.Export(sectionReport.Document, excelFile);
}
Looking at this, I’m actually surprised that the v6 Excel export formatted the data. Did that version look at the data for each page element to try and determine the cell format? A confirmation of this would be helpful for clarity.
Lastly, and more importantly, can you provide a recommended course of action on how to convert code using Page.DrawText() into something that will have cell formatting when exported to Excel?
Thanks,