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
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.
I built one using https://docs.appian.com/suite/help/23.1/Export_Process_Report_Excel_Smart_Service.html. I used a dummy (empty) process report and used the Custom Cell Positions and Custom Cell Values to manually push to some values to it.
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).
Hey Arturo_Torres,
I can think of one way to achieve this. You can write a stored procedure and create a sql statement using the variables that you select on the UI. You can later cast this data into the cdt that you wish and export it into excel.
Hi Mathieu,
Do you have an example on how to use these properties? the documentation only says:
Thanks
Positions: {"A1", "B2", (etc)},
Values: {"Value for cell A1", "Value for cell B2", (etc)},
They can be literally anything you want, as long as the positions array is a valid list of cell identifiers like above, and as long as the values array is a valid list of string that matches the length of the "positions" array.
Thank you for your quick response,
So, the values are fixed for all the rows? right?
I'm not sure what you mean by "fixed for all the rows" - are you referring to the Custom Cell Positions?
These are intended to be used such that the designer can insert arbitrary additional values, apart from the data set being used to generate the excel file - such as (for example) the name of the person who generated it, the date it was generated, or filter values. They are also totally optional and completely separate from the main data set that the generated file will reflect.