I have a 3G proscessor with 512K of Ram running Studio 2k5. When I do a "UltraWebGridDocumentExporter1.Export(UltraWebGrid1);" it times out completely and slows my machine down to a crawl for several minutes after I try to run the code of it. I have a 39 column grid that eventuall will have several thousand rows, however currently Im only trying to print the first two using the following code in a button click event. What am I missing here that is making it sooo s-l-o-w?
Code:
UltraWebGrid1.Rows.Clear();
UltraWebGrid1.DisplayLayout.RowsRange = 2;
UltraWebGrid1.DataBind();
UltraWebGridDocumentExporter1.Export(UltraWebGrid1);
Rather than using the RowsRange property, I would recommend limiting the data that you bind to the grid through your datasource, and then call Export. The RowsRange property is really only meant for the AJAX implementation on the client-side to determine the batch size of rows that should be loaded when more data is requested. When working with the Exporter, it will try to get all of the grid data that is availalbe, which includes rows outside of the RowsRange.
What I've done in the past is construct a dataset or collection explicity for the grid when I want to export it to Excel. Give that a try and let me know how it works. I will warn that as you scale the data up, the export process will take longer simply because of the number of objects being created. There may be some room for improvement here, I'll be sure to send a note to the development team about that.
As a last resort, there is an entire ExcelEngine that can be used to construct a worksheet from scratch (without exporting a grid). Since you would basically be writing a tight loop from your datasource to the ExcelEngine, you should be able to dramatically improve performance.
You can look at the help for some guidance on using the ExcelEngine - http://help.infragistics.com/Help/NetAdvantage/NET/2007.3/CLR2.0/html/Infragistics2.Excel.v7.3~Infragistics.Excel.Workbook.html
Hope this helps,
-Tony
I'm new to NetAdvantage and Infragisitcs so pardon me if I missundstand things. Im trying to spool the webgrid into a PDF document. Is this not the right forum for the question? I am doing excel too in a seperate process and looking at this link you provided it may help without spending too much time in it yet i need the ability to export the grid and it's style, (i have cells that have different color backgrounds depending on their data) so I need to capture that style infromation so Im not sure that doing an export of a dataset alone would give me what I need there, thats why I did the grid, I likely will never get past 5300 records however the number of columns could expand, (not dramaticly however). I am currently using this .export to export to excell as well, but it doesnt time out, it is slow with 5300 records but it does eventually get done. Trying to spool this to a PDF it completely times out and even after I get the timeout error message in my browser my PC becomes extreamly slow. Heck it even seems slow just having the grid (i am using ajax), excel exporter control and document exporter control all on the same page as far as loading goes. It does seem to speed up when I take the docment exporter control off the page however. The understanding that the export takes longer depending on the amount of records is ok, but the timeout is not and would prefer not to have to extend my pagetimeout properties if I dont have to.
Still sounds like a memory consumption problem on the exporter end, and an area where we should probably focus our attention in the future.
I ended up moving my code over to my laptop to work at home with it one evening and on the Laptop it eventually does work, its my desktop at work that times out.
This is the correct forum. I would however recommend that you report this to our Developer Support Group (http://ko.infragistics.com/gethelp for options). This sounds like something our development team should look at improving, as I agree that it should not cause your page to timeout. All of the advice I gave you will still work with the DocumentExporter, as there's an entire document engine which can be used to create a PDF manually with out the grid. Idealy though, the document exporter should be able to handle large datasets.