Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Export Adhoc reports as PDF in a workflow

Avatar

Avatar
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile
Amit_Kumar
MVP

17-07-2017

Hi all,

I am  trying to export adhoc reports as pdfin a workflow but i am unable to find a correct solution. This solution works for other reports but adhoc.

var reportName = "RPT10";

var path = "export/report.pdf";

var exportFormat = "PDF";

isAdHoc = true;

//originUrl = "http://XXXX.XXXXX.com/view/adHocReport";

originUrl = "http://XXXX.XXXXX.com/xtk/adHocReport.jssp";

//originUrl = "http://XXXX.XXXXX.com/xtk/jsp/exportReport.jsp";

if( document.__securitytoken ){

originUrl += "&__securitytoken=" + document.__securitytoken;

}

var reportLabel = "Tracking Logs by Category-Test";

var _ctx = <ctx _context="global" _reportContext={reportName} __universe="reports" reportId="339421"  _reportLabel ={reportLabel} _originUrl = {originUrl} />;

xtk.report.export(reportName,_ctx,exportFormat,path,isAdHoc);

I tried passing all possible originUrl(required for adhoc type) but it's not working. Anyone here who have exported adhoc reports?

Adhiyanflorentlb​?

Regards,

Amit

Replies

Avatar

Avatar
Boost 50
Employee
Adhiyan
Employee

Likes

239 likes

Total Posts

342 posts

Correct Reply

124 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile

Avatar
Boost 50
Employee
Adhiyan
Employee

Likes

239 likes

Total Posts

342 posts

Correct Reply

124 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile
Adhiyan
Employee

18-07-2017

Hi Amit,

I think we need to modify the command used to generate "export to pdf" reports which is defined in the serverconf.xml here.

You may try to add a specific command mentioning the url:{originUrl} .

<!-- Configuration of the service for converting web pages into PDF documents

         command :  Command line for running the conversion (in 'other' mode) example for phantomjs - -ignore-ssl-errors=true '$(XTK_INSTALL_DIR)/bin/htmlToPdf.js' '-out:{outPdf}' '-post:{postFile}' '-url:{originUrl}' -sessiontoken:{sessiontoken} -format:{format} -orientation:{orientation} -marginTop:{marginTop} -marginLeft:{marginLeft} -marginRight:{marginRight} -marginBottom:{marginBottom}

         maxProcessusCount :  Max. number of conversion processes allowed at a time on one machine. Default: 5

         mode :  Tool to use for the conversion (phantomjs|wkhtmltopdf|other|disabled) Default: 'phantomjs'

         timeout :  Maximum conversion time in seconds. Beyond this threshold, the conversion process is stopped and an error is raised. Default: 120

         verbose :  Start in verbose mode to diagnose possible errors. Default: false

         waitTime :  Delay in seconds, when all processes are used at the same time and when waiting for a process to free up. If this delay is exceeded, conversion is stopped and an error is raised. Default: 15 -->

    <htmlToPdf command="" maxProcessusCount="5" mode="phantomjs" timeout="120" verbose="false"

               waitTime="15"/>

Alternately , if the mode is set to phantomjs , you may try to change the mode to htmlToPdf.js and give a try.

Regards,
Adhiyan