Hi, I want to export data from a webgrid to a Pdf document, but when I export the itemtemplate columns don't appear in the pdf document.
I order to export all colums from my grid, I was trying to make a copy of my current webgrid by setting the datasource in another one without itemtemplate columns, but when I send to export data I receive a error message.
//My code to create and set the datasource in the webgrid is:
UltraWebGrid webGridDocument = new UltraWebGrid("webGridDocument");
webGridDocument.Columns.Add("Name", "Name");
webGridDocument.Columns.Add("StockValue", "Quantity");
webGridDocument.DataBind();
// trigger export. Here export the grid.
WebGridDocumentExporter.Export(webGridDocument);
I am sure that the datasource has data (It is a datatable)
but I receive the following message.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Line 399: Line 400: // trigger export Line 401: WebGridDocumentExporter.Export(webGridDocument); Line 402: Line 403: }
Could you help me In order that I could export Itemtemplate column to a PDF? if it is not possible, please help me to solve the export error message.
Hi, I have fixed the problem for creating the webgrid. It was missing to add to the form.
Now, the only question is if anybody know how to export an itemtemplate column to a document.
thanks,
PJ