Data from collection or report

530 views
Skip to first unread message

vinod...@gmail.com

unread,
May 22, 2016, 8:04:16 AM5/22/16
to Fujitsu RunMyProcess Developer Community, vk, Vinod Varma
Hi

I would like to use data from a report or collection (filtered by query) while generating PDF instead of data from array widget. Request guidance

Regards

Vinod

Bidisha Das

unread,
May 22, 2016, 9:24:38 AM5/22/16
to suppor...@runmyprocess.com
Hi Vinod,

Yes, you can pass report widget data i.e collection data to PDF. Use below script to get all data of report & set it in a variable/text widget(report_data) on Web Interface.

var report_data = id_report.getAllValues();
alert(JSON.stringify(report_data));
RMPApplication.setVariable("report_data",JSON.stringify(report_data));

In process you will get array of JSON(collection data), you can transpose those data to convert to JSON of array and pass it to XSL in the same way you did for array widget and generate pdf.

Use below code in Process: 

<#assign transpose_columns = transpose(report_data)>
{"my_var_main":{"users_array":${transpose_columns}}}


Please try with this & let me know if it worked.


Thanks & Regards
Bidisha

vinod...@gmail.com

unread,
May 23, 2016, 8:05:42 AM5/23/16
to Fujitsu RunMyProcess Developer Community, vk, Vinod Varma
Hi Bidisha

Thanks for the quick response. I tried as advised but I am getting only one row.

Please find attached the screenshots and XSL file used. Request help

Regards


Vinod
alertMessage.png
PDFGenerated.png
scriptInInputVariables.png
scriptInWI.png
xslWithChildTemplate.xsl

Pankaj Kumar

unread,
May 24, 2016, 6:41:53 AM5/24/16
to Fujitsu RunMyProcess Developer Community
Hi Vinod,

Kindly remove the tranpose of the array as report_data array do not required transposition, it is required in the case of passing data from array widget.

Please try below freemarker for passing array:-

"users_array":${report_data} 

attached is screen-print of the generated pdf using report data.

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/b2ccba48-3149-4ff3-a3da-1c486e22451f%40runmyprocess.com.

pdf_screen_print.PNG

vinod...@gmail.com

unread,
May 24, 2016, 7:19:53 AM5/24/16
to Fujitsu RunMyProcess Developer Community
Thanks a lot, Pankaj. It worked
Reply all
Reply to author
Forward
0 new messages