Thanks for your attached sample code. My problem is different from yours because I export the data without map. I will look and figure out how to apply. Any other contributors from ArcGIS expertise are welcome.
Hello ESRI expertise!
I looked the sample ExportPDF code from Denim Hu, but I am still trouble to make it work for exporting datagrid data with dataPager in Silverlight 4. Is it possible to make it work in ESRI print sample and silverPDF.dll for my problem??? Any other way to work around on this issue. Please help me out. Thanks in advance.
This blog post : http://www.davidpoll.com/2010/04/16/making-printing-easier-in-silverlight-4/ should be helpful to understand how to print a datagrid using multi pages. Once you are able to print your data, you can use a PDF printer driver to get PDF documents.
Hi Dominique,
Thank for your refer to http://www.davidpoll.com. I could not find the seperated codes for only Making Printing Easier in Silverlight 4 project, so I have to download all entire sample codes on Silverlight and Beyond on that website. This is excellent demo. In this example, the datasource is from collection list and is not from database. I also found another Silverlight Print from codePlex which seems simple, but the data source is binding from xml format. Did you have a chance to look in details or did something familiar before? Please give me more hints to modify the data source to apply in my issues. I need to printing the dataGrid data with dataPager via Query No Map example at http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#QueryWithoutMap. Thanks for your time.
Hi Anh,
The easiest thing to do in your case is to convince your users that they don't need a PDF. Just kidding! 😉
About 2 years ago, when printing was a real problem with Silverlight, I did export to PDF to allow users to print the map and the data. My PDF is created on the server though, and the exported data comes directly from the database, and not from the FeatureDataGrid (but it is exactly the same data).
To do this, I used iTextSharp library (on the sever, not the silverPDF).
When the user queries the data and displays it in the DataGrid, the user has the option to export the data to PDF. At this point, I send all the query parameters back to server, and query the data directly from the database using a stored procedure (I am using an XY table, and can directly use T-SQL, and the data is updated nightly, so it doesn't change), which is then bound to an ASP.Net GridView, which then is rendered to a PDF.
It is probably not the best solution, but the only one could find at the time.
If you can't find an easier way to this, and would like to try it, I will send you some code.
Try convincing your users first. 😄
Good Luck!
P.S. If you can use T-SQL to query your data directly, you could probably use some kind of reporting tool like Crystal Reports or SSRS to produce the PDF. Send the query parameters, produce the report and spit it out as a PDF. I have done this long ago with SSRS and ArcIMS. Just another idea.