I have a dataset filling a datagrid and want to export that to Excel Spreadsheet when I push the Expoprt to Excel Button. When I do click the button I do not get the spreadsheet.
How do you create your dataset? If you want to export data to an Excel file from a datagrid, please try this:
Excel query = new Excel();
Excel.SetLicense("C:\\license.rtf"); //Have you bought a license? If not, please remove this line of code. You will get a license file after you buy the license. License.rtf in setup package only includes license announcement.
I too am doing some evaluation and so following this blog. I did exactly as above and it did work but somehow skips the first column. There are also other column missing and so didnot know what the problem is. There are template columns in the Datagrid but did not skip all template columns. Pl see attchmt. Thanx!
You are asking about the Aspose Excel version I believe - 3.1.0.0 Posting the project? Its too big to post. Dont get me wrong - Let me know which code you need. For now I am pasting the code for the export:
I don’t clearly understand the problem. What column are missing? Could you please post the screenshot on your web page with the datagrid? And please post your generated file. Thus I can see what happed in your place.
Its in the attachement inmy first mail. However sending again… The columns not missing but the data is. You could compare the datagrid and the Excel file to see the difference.
1. ImportDataGrid method only imports data in BoundColumn. 2. In your doc file, do you mean the top image is the screenshot of you datagrid and the bottom table is data in your excel file? 3. Are column “Carrier”, “20dv”-“40BAF” lost? 4. Aren’t data in “POL” column correct?