I created a report (A) that calls another report (B). A report has an option to print to PDF so that it shows on screen as a PDF format. But when I run report A with the PDF option, report B is not taking that in consideration and prints straight to the printer. Is there a way to transfer the PDF output option to Report B?
PS: I'm not thinking about the SAVEASPDF option.
Thanks.
0
Answers
how do you call the Report (B)?
You could define a function, where the option for the PDF get's set and run the report afterwards.
Example:
PrintAsPdf is a function in Report(B) where you set the variable for the pdf print.
I understand your approach but I don't see an option in a report to set to print as PDF.
Only 'SAVEASPDF'. Unless I miss something? Which variable for the pdf print would that be?
I don't know, how to access this information from within NAV.
In the rdl layout you can find out using Globals!RenderFormat.Name, but I guess that does not help much here.
The reviewing using PDF option is working fine if you run just report B but what I have is calling report B from report A. If I use the PDF option in report A, it doesn't view but it prints straight to the printer. So I'm looking at functionality that I can set in report A for report B, before report B is printing.
i thought you have already a function for the pdf print. Sorry for the late response.
How do you call Report B from Report A right now?
I think the easiest solution would either you show for the second Report the Requestpage, so that the user can select the PDF print, as shown from vaprog, or you use the SAVEASPDF function and afterwards the DOWNLOAD function.
If i use the above function, the file get's downloaded to my computer and get's directly openend in my pdf viewer.
Yes, I think I understood this. I assumed, you will want to print report B if the user chose to print report A, and show report B as PDF is the user chose to render report A as PDF. Therefor you need to be able to
- Read the rendering target from report A
- Set the rendering target in Report B
Depending on exactly what you need to do, reading the rendering target from report A might not be needed. In any case you need to be able to set it. Anyway This statement is true for both, reading and writing.So, I guess, your only options are those listed by @Aluan, unless someone else knows, how to set it. Possibly you can manipulate the RDL property I mentioned above, but I don't know.
So, long story short: it's not possible what I had in mind. Bummer.