I am trying to export all of the data from an ultra web grid. i see that i need to change the grid to be bound to all of the data. But without completely removing the ability to page, i cannot see how to do this. Any help would be great.
I would just use a seperate grid, bind it to your entire dataset and export that grid. You do not have to add this temporary grid to your form. So it would be something like:
uwg.DisplayLayout.ViewType =
uwg.ID =
uwg.DataSource = ds1;
uwg.DataMember = dt11.TableName;
uwg.DataBind();
uwgee.Export(uwg, wb.Worksheets[0]);
When you call Export() in anything but ExportMode.Custom, it terminates the text/html MIME type response being prepared by the Page and instead begins the binary application/ms-excel MIME type download of .XLS data to the client (in a custom export, you are responsible for doing with the binary stream resulting from an export what you wish, so you could conceivably write it to a file that will be downloaded later and the HTML response can carry-on.) Unless you're doing a custom export or taking unusual steps to persist changes, the viewstate indicating you have turned off paging in the WebGrid isn't ordinarily going to survive, and the HTML of the WebGrid with all data will not be rendered to the client.
Export()
ExportMode.Custom
Hi
I am having similar problems with a grid that was set to use AJAX to improve performance due to large amounts of data being returned.
The grid is Hierarchical, populated with up to three tables. Without AJAX on the grid, it exports to Excel with buttons one the speadsheet to allow drilling into the related data.
However when AJAX is turned on for the grid, two problems are noticed:
1. Only the first page (51 rows) of data is shown in the spreadsheet. With the Document Exporter all the data is exported correctly however when using AJAX.
2. The related data is lost when exporting an AJAX enabled grid with only the top level data being exported.
Ken Paton
Have you tried the suggestion above of using a seperate grid?
I did try this but for some reason, when using the sepperate grid, it just returned without creating the Excel document, so I have removed AJAX from the grid for now until I have time to investigate further, although this has performance overheads as some of the reports can have a lot of rows.
I did try looking at the export cell event, and can confirm that the temp grid did have the data in it, so the problem seems to be at the final stage when it should be showing the save dialogue.
Anothe issue I am having is that when I export to a PDF File a grid that has data on a lower level that is sorted, the sort is lost and the rows are all in the wrong order, see below:
Customer Name (Top Band)
Help Desk Incident (Middle Band)
Incident Tasks(lower band) - on grid
On the PDF file the lower band is like this: