Export Read Only grid with variable source to Excel

Hi everyone, 

I need to export the data contained in a Read Only grid with variable Data Source, therefore I cannot use the default Export functionality available for Record and entity based grids.

My grid can have two sources of data, one being the default columns I have on the report on which it is based and/or one or more columns that users can select with a UI we made.

The grid then can have a mix of Report and Database data source.

I tried the exportProcessReportToExcel function, but it only works with the data and columns set on the report.

I'm looking for a way to export to Excel the whole content of the grid, whether it is an OTB function or a plugin.

Thank you very much in advance. 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You might have some luck using the Export CDT to Excel smart service available in the Excel Tools plug-in, which while marked as Deprecated, still works in all recent versions that I'm aware of.  You would call it from a process model (which you can call from your form), cast your data set (passed into the process however you like, like in a Map array) into a custom CDT you create (i suggest just creating a generic all-text CDT with columns named like "col1", "col2", etc), then passing that into the smart service.  If you do these setup steps correctly then it shouldn't be too much of a lift overall.

  • Thanks Mike, 

    A follow up question for this.

    The grid I have is a "a!gridField", as explained before uses a mix of the default Task Report columns, for example:

    TaskName |  |Object ID | TaskCreationDate | AssignedTo | Status

    But if a user selects a different value on a dropdown I will add as much as N columns to the grid, which come from Database a table, these columns and values are added to it and related by the ID on the report, then the grid will look something like this:

    TaskName | Object ID | TaskCreationDate | AssignedTo | Status | ObjectDetail A | ObjectDetail B | ... |ObjectDetail N

    Then given this, do you have any suggestions to export or extract the data from the gridField?

    As shown below, the gridField uses the Report Data plus anything that may be added and an extra column for a record action.

    I tried creating an expression to create it and then access the properties from there, but I did not have much luck.

    Thanks for the advice.

  • 0
    Certified Lead Developer
    in reply to Arturo_Torres

    The only suggestion I can offer is to try assembling the grid data before rendering the grid, instead of *while* rendering the grid - in other words, take whatever logic you're using to create the data row-by-row, and move it to a local variable (which you can then reference by your grid as well as passing into a process to handle document generation).

Reply Children
No Data