Hello,
Problem:
When I click on my "Export Data" button, no dialog window appears allowing me to save or open an excel file.
Description:
I am trying to implement the WebExcelExporter control in an ASP.NET application to download the data contained in my WebDataGrid as an excel spreadsheet. The data that I am binding to the WebDataGrid, is coming from queries I am completing against a proprietary data base (not SQL or any other compatible DataSource type). I retrieve the data from my queries as a DataTable and then bind it to the WebDataGrid. I have a WebExcelExporter on the page as well as a button that when being clicked triggers the method call to export the DataGrid in an excel sheet. I have set a break point to verify that this code is being triggered.
ASP code:
<ig:WebExcelExporter ID="StationExcelExporter" runat="server" DownloadName="Exported Stations"></ig:WebExcelExporter> <asp:Button ID="btnExport" runat="server" Text="Export Station Data" onclick="btnExport_Click" UseSubmitBehavior="False" />
C# Button Event Code:
protected void btnExport_Click(object sender, EventArgs e) { StationExcelExporter.Export(StationDataGrid); // OR this.StationExcelExporter.Export(this.StationDataGrid) (Neither work)
}
References:
I set a breakpoint on the line of code that executes the Export method call, and when I look into the DataSource of the StationDataGrid (WebDataGrid control), I can see all of the data binded to the DataGrid. Any help with this would be appreciated because I'm not sure what else I can debug.
I have code identical to this is another application and it works.
I followed this tutorial exactly and it didn't work for me, so I continued to make various changes to it to suit my needs.
Thanks,
M
Hello msaganski,
Thank you for posting in the community.
We recieved your support request concerning WebExcelExporter. I am currently looking into this issue and I will get back to you soon with more information or questions for you.
You can continue to send updates to this case at any time.
Please let me know if you have any additional questions regarding this matter.
I made a small sample project according to your scenario - exporting WebDataGrid to Excel and I am attaching it for your reference. I was unable to reproduce the behavior that you are experiencing. For my test I am using the latest service release for version 13.1, which currently is 13.1.20131.2069.
Please run this sample project on your PC; whether or not it works correctly might help me find the reason for this issue.
If this sample project is not an accurate demonstration of what you are trying to do please feel free to modify it and send it back to me, or send small working project of your own where this issue is reproducible.
Some further reference about exporting data with WebExcelExporter could be found at:
http://help.infragistics.com/NetAdvantage/ASPNET/2013.1/CLR4.0/?page=Web_WebExcelExporter.html
I hope you find this information helpful. Please feel free to contact me if you have any additional questions regarding this issue.
Please do not hesitate to contact me if you have any additional questions regarding this matter.
Hello Vasya,
Sorry for the late response as I was preoccupied by another project. I took a look at the sample code that you have provided for me and it worked correctly. With further inspection of my code, now verifying that it did match yours exactly, and still being nonfunctional. I determined that because my WebExcelExporter was in an UpdatePanel it caused the WebExcelExporter to work incorrectly.
I have since moved my WebExcelExporter outside the UpdatePanel and it functions properly.