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
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
Hi Derek,
I also tried to load an excel file and then I tried to put some data into my template but it does not work.
Can you give me a hint what I'm doeing wrong?
Thank you,
Jos
Code:
Dim ExcelFile As Infragistics.Excel.Workbook ExcelFile = New Infragistics.Excel.Workbook() ExcelFile = Infragistics.Excel.Workbook.Load("c:\vorlage.xls")' add new does work but the load does nothing ExcelFile.Worksheets(0).Rows(0).Cells(0).Value = "TEST" ExcelFile.Save("c:\test.xls")
Hi:
I have som problems to export data of a ultrawebgrid to an exel file.
in my application i create ultrawebgrids on run time, my code reads a table from a database, and in base of the records number i have to create the same number of ultrawebgrids, then i create the same number of buttons, these, are the buttons to export each webgrid to excel.
i´m using a UltraWebGridExcelExporter. When i click some of the buttons, a export to exel window is oppened, and when i click on the open button this opens excel but there is no information.
in other case when i drag a UltraWebGrid from the toolbox, and try export it to excel, and it works so fine, excel is oppened and the information of my webgrid is showed.
some body knows why it is happening? or if it is posible export to excel the information of a webgrid that was created by code on run time?