Hello! I am using the Excel Export functionlity and I am wondering if it is possible to just export the a value in a grid cell straight into a cell in the excel file? Currently, the export functionality changes font, font size, colors etc. and makes some of our formulas in my excel file to stop working. Is there some specific setting that we can use to just focus on the value and not the formatting?
/Henrik
Hello Henrik,
Thank you for contacting Infragistics. With our WinGridExcelExporter, by default, the exporter will emulate what's seen in the grid over to excel. Note the exporter's ExportFormulas property is set to true by default. When true, the exporter will attempt to convert grid formulas into equivalent formulas in the exported worksheet. But it won't be 1:1 since DotNet and Excel differ. When false it will copy the value as seen in the grid.
The exporter has several events such as BeginExport and CellExporting that gives you access to the grid data before it is written into the Excel file, so you can perform pre-processing. You can also perform post-processing on the data after it has been written into the file by using the CellExported event. But to answer your question you can easily remove styles made to the file before the grid is exported by hooking BeginExport and calling some reset methods on the layout.
e.Layout.ResetOverride();e.Layout.ResetAppearance();
For more details please visit:www.infragistics.com/.../wingridexcelexporter-export-grid-data-to-excel
Thanks for coming back. Yes, i know more or less all those features that you mention, but i am still wondering if this component can be used to just export that value from the grid. The excel file that we write to are already formatted in the way that we want, so spending time on formatting how the data should look like coming from the grid feels a bit like a waste of time. Is it possible?
if you are saying resetoverride, resetappearance it feels like it is about formatting the grid which i dont want to focus om, neither formatting the excel file, if you understand what i mean.
I hope you understand what i am looking for…
ideas?