is there any way to export the data from infragistics ultraweb grid to a specific excel file which is havinng some formats?
say i have my template in \Templates folder in my server. (i.e \Templates\UserTemplate.xls) i want to write my data from the webgrid to this excel. our server may not have excel installed so i am using infragistics.excel.
thanks
arun.k.s
atmy@chevron.com
I need to do this to, but being fairly new to vb.net, I am not clear on how to use the load method. When calling the function, i am not clear on how to return the opened file. do you have any examples using the load method?
Me.UltraGridExcelExporterRepFiles.Export(Me.grdJobHdr, LoadTemplate(sFileName), 4, 1)
Public Overloads Shared Function LoadTemplate(ByVal fileName As String) As Infragistics.Excel.WorkbookEnd Function
end code
I am not sure what belongs in the function to get it to return the xls file i am using.probably due to my lack of knowledge/experience.
Any help would be appreciated.
Markpisc
You can try loading your own .XLS workbook into an Infragistics.Excel Workbook object using its Load method. If there is anything the Workbook object doesn't recognize, it will try to preserve it as-is for when you Save the workbook back to a file or for transmission to the end user.
You can also direct WebGridExcelExporter to begin exporting at a specific position on a Worksheet by setting its ExcelStartRow and ExcelStartColumn properties. Left to its own designs, at this point WebGridExcelExporter will start writing out your WebGrid in rectangular fashion with the specified cell as the top, left corner of a rectangular region. If there is any formatting underneath where the exporter is writing, it will probably be overwritten. If even further fine grained control is necessary, there are a number of events you can handle (for example, to put the first 100 rows on Sheet1, the second 100 rows on Sheet2, etc.)
So this should work relatively easily if your template has a nice rectangular region in it for where you want the WebGrid to be exported, and all the customizations are around the margins or before the start of the exported WebGrid at the top of the Worksheet. As your template worksheet grows more complex, the more likely you're going to need to direct the export so it retains your areas of custom formatting.
One thing WebGridExcelExporter will do is resize the Worksheet columns where it exports cell values because it tries to guarantee the column is at least as wide as the widest cell value. If you have a column formatted to a specific width in your template for some reason, then this behavior may actually lead that column width to become narrowed. You can stretch the columns back to your desired width (measured in twips) in the EndExport event.https://es.infragistics.com/help/aspnet/web-webexcelexporter