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.
If you are just trying to export to excel instead of a pdf or xps then just use the ExcelExporter instead of the DocumentExporter. You should see some code for the ExcelExporter in my first reply on this thread.
This is using the DocumentExporter. I did not see an option to export to excel using this method.
I tried to replicate the behavior using the following code in 2008 Volume 2 but was not able to reproduce:
<body>
<form id="form1" runat="server">
<div>
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" Height="200px" Width="325px">
<DisplayLayout ViewType="Hierarchical" AllowSortingDefault="OnClient" HeaderClickActionDefault="SortMulti">
</DisplayLayout>
</igtbl:UltraWebGrid>
<igtbldocexp:UltraWebGridDocumentExporter ID="UltraWebGridDocumentExporter1" runat="server">
</igtbldocexp:UltraWebGridDocumentExporter>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</div>
</body>
{
}
DataSet ds = new DataSet();
DataTable dt2 = new DataTable();
dt.Columns.Add("col1");
dt.Rows.Add(1, "b");
dt2.Columns.Add("col00");
dt2.Rows.Add("a", "abc");
ds.Tables.Add(dt);
ds.Tables.Add(dt2);
this.UltraWebGrid1.DataMember = ds.Tables[0].TableName;
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:
Have you tried the suggestion above of using a seperate grid?