Hi,
I've encountered a situation where the result of exporting a UltraWinGrid to an excel file does not contain the built in styles (Comma, Currency and Percent) which are bound to the standard Excel toolbars.
What's interesting is that if I load an excel file with these styles intact using the infragistics API I can see them in the styles collection although they are represented using private types. I've not been able to duplicate them in an export.
Is this a bug? Can anyone suggest any workarounds?
Thanks in advance!
The code below reproduces the problem:
using
System;
System.Collections.Generic;
System.Text;
Infragistics.Win.UltraWinGrid;
Infragistics.Excel;
Infragistics.Win.UltraWinGrid.ExcelExport;
namespace
InfragisticsExcelExport
{
class Program
static void Main(string[] args)
UltraGrid ExportGrid = new UltraGrid();
string ExportFileName = "C:\\InfragisticsExcelExport.xls";
UltraGridExcelExporter Exporter = new UltraGridExcelExporter();
Exporter.Export(ExportGrid, ExportFileName);
// Resulting excel file does not include "built-in" styles:
// Currency, Percent or Common.
}
Jamie,
It looks like your issue is resolved in the latest Hotfix for 7.2 build 1083. You can download it here.
Thanks very much for the replies and the support request!
I've tried the workaround but with only partial success, that is: the styles now exist in the resulting export but their format strings do seem to have survived and applying them has no effect on a cell. On the "up" side the "Style <style name> not found" errors are gone and Excel no longer crashes when one tries to edit the styles.
If there are anymore suggestions let'em fly! In the meantime I'll double check and make sure that it's nothing I'm doing (or not doing.)
Thanks again!
I am creating a support request to handle this issue for you. You can visit the My Support Requests page for the details of your issue. Thank you.
This sounds like it may be a bug. I have forwarded this post to the DS Manager and someone will contact you about this issue.
As a workaround, you can load an existing workbook which has these styles intact. You can export your UltraGrid to this loaded Workbook and manually save out the workbook after the export is complete. The styles should be round-tripped correctly.