Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    List Grid Printing

    Hi Team,

    I have a requirement to export a List Grid in which there are 5000 rows of data to a PDF file.

    Could you please tell me how to do that. Is there a direct way of doing or should I use any other approach for printing like custom pdf writer or something like that.

    The next requirement that is going to come up is printing a TreeGrid which has ListGrid inside it.

    We are working on below environment:

    Version: Isomorphic SmartClient/SmartGWT Framework (SmartClient_v90p_2014-03-07_PowerEdition)

    Browser: IE9

    Thanks in Advance.
    Last edited by Abdulaziz A. ; 24 Jun 2014, 02:15. Reason: added few more info.

    #2
    isc.RPCManager.exportContent

    Try this: (where myGridRef = your ListGrid)
    Code:
    var settings = {
          skinName: "Enterprise", 
          pdfName: "MyFileName" // without .pdf
    };
    isc.RPCManager.exportContent(myGridRef, settings);

    Comment


      #3
      SmartClient does support exporting client-side components to a PDF file - this is handled by RPCManager.exportContent() - but I don't think this is going to be sufficient for your needs as described here.

      RPCManager.exportContent() requires that the content to be exported by present on the client - so for 5000 rows, it would require you to load all the rows to the client (via a grid with showAllRecords set to true, say), and then use RPCManager.exportContent to send the generated HTML back to the server where it will be converted to pdf format for download.
      This is going to be pretty inefficient, but would preserve the client side layout and appearance and ultimately give you a PDF file.

      Usually for exporting large numbers of records we'd recommend the "exportData()" API. This is essentially a server-side DataSource feature where the data from a query served to the client as a file to download. This is more efficient of course. It does not support exporting to PDF format, but you could potentially export to CSV or XLS and then use third party tools to convert to PDF -- but it won't give you client-side component layout and formatting.

      There is also exportClientData() - this supports some level of formatting when exporting to Excel format, including column spanning, and some css highlighting and styling features, but again this doesn't generate PDF and won't handle a "print view" type export of complex nested components which it sounds like you may need.

      If we can pin down your exact requirements, we could take a look at whether there are some enhancements we could make to get you what you need, and whether these would qualify for feature sponsorship. Let us know if you'd like us to investigate this.

      Regards
      Isomorphic Software

      Comment

      Working...
      X