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.
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.
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.
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.
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.
Sorry, I could not get any chance to extract the code as a sample application for you today, but I put some code in a zip file, please see if it can give you some clue to work out.Again, I used ESRI print sample and SilverPDF.dll.
I posted my issues couple of week ago to looking for helps from ArcGIS API for Silverlight expertise, but still waiting for detailed solutions. I am newbie to work on ArcGIS API for Silverlight, so I am still learning on ArcGIS. What I need help to export the data in QueryNoMap example(http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#QueryWithoutMap) to PDF and Excel. I could not find any similar codes to get them done. If possible please send the codes to my personal email at avt2K8@gmail.com. I really appreciate it. Thanks for experience sharing.
Actually I used SilverPDF.dll and ESRI print sample together for my work, I can export the map ( cross domain resources, graphics layers) and query result together as PDF, if you like, I can extract some code as a complied sample for you , but probably the size will be too big to post here.
What I did is as the following, it mighe not a good way, but it really solved my problems.#1. Create a grid or panel to hold the data: <ScrollViewer x:Name="ImageScrollviewer" Visibility="Collapsed" Width="2" Height="2" HorizontalScrollBarVisibility="Auto" HorizontalAlignment="Left" VerticalAlignment="Bottom" VerticalScrollBarVisibility="Auto"> <Image x:Name="TestPdf" /> or <Stackpanel /> or <Grid /> you have to customize here according to the print page you like </ScrollViewer> Since this scrollviewer's size is small, they are under some other controls, just set visibility to visble when you decide to convert to pdf or image. It will not affect your interfacce.#2. convert "TestPdf" : WriteableBitmap bitmap = new WriteableBitmap(TestPdf, new TranslateTransform()) ...... #3. Use SilverPDF : PdfDocument pdfDoc = new PdfDocument(); ExportToPdf.AddPdfMapPage(bitmap, pdfDoc); you can add as many pages on the same pdf doc.Hope it helps.
What I did is : downloaded silverPDF.dll, it worked for me.
Hello all,I would like to hear any suggestions how to export the silverlight ArcGIS datagrid to Adobe PDF file. Thanks for your inputs.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.