Hi everyone,
I work an a report(named R_main) and in this report I use createExecInfo and execute to call another report(named R1). As below:
var execInfo = reportcomponent.createExecInfo ( reportGUID, [model], lang, outputFormat, reportName);
execInfo.setProperty("SAVE_TO_DOC_STORAGE","true");
var result = reportcomponent.execute(execInfo);
But if I choose some specific models there will be an error by the function execute, and the error says in R1
var outFile = Context.createOutputObject( Context.getSelectedFormat( ), Context.getSelectedFile( ) );
could not use a full path.
Directly running R1 on the same models there is no error.
So I want to check the Context.getSelectedFile( ), when I run R_main and R1 is called.
However the createExecInfo doesn't allow the called report to show any Dialogs.
Could anyone give some help?
Thanks
Hi there,
you seem to be already aware of the existence of properties (at least there is one used in your code called "SAVE_TO_DOC_STORAGE"), you can use those to pass information back and forth from report to report.
In your R1 report you should comment out all the things that cause you trouble (with /* your code lines here */ ).
You can then use Context.setProperty("logProperty", Context.getSelectedFile()) in your R1 report.
You don't have to call the property logProperty, really any string will do - you just have to use the same string in both reports.
In your R_main report you can access this property with the object .execute(execInfo) returned (you called it result). You can use result.getProperty("logProperty") in your R_main report to retrieve the value you set for the "logProperty" property in your R1 report. Of course you can encapsulate that with a Dialogs.MsgBox(result.getProperty("logProperty")).
It's just really important that you comment out the troublesome stuff in your R1 report, otherwise your report execution will crash before .execute(execInfo) can even return something in your R_main report.