Hi,
when i pres the print-button i want that always two reports are printed. They are almost the same reports, but they are different in a few little things. what i need is when i press the preview-button i want that both are visible there. is that possible? what would be the best way to make that both reports are printed at once? is it possible to make an entry in table 77 (Report Selection)??
Nico
0
Comments
This is possible with coding.Just write the code in 1 report on its OnPostReport trigger and run the 2nd report and set userequestform to false of 2nd report in coding.
I think it will solve ur problem.
Cheers!!!!!!!!!!!
Have a nice day
Navision Technical Consultant
You will find the OnPostReport trigger if you select a blank dataitem and then select the C/AL code button (F9).
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
It's the first time
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
i wrote the following line in that trigger of report one.
REPORT.RUN(5078953,FALSE,FALSE,dataRecord);
the numer is the id of the second report (the source question was how to see both reports in one preview). but actually if i do that nothing happens... (I wrote also a MESSAGE in this trigger but no message box appeared... so i think this trigger is not raised when i press the preview button).
I have heard that this feature (to see more than one report in one preview) is not possible with NAV...
Thats true. It's like on printing. You can only view reports step by step.
First Report A, then Report B and so on.
Also the Report - OnPreReport() is fired, when the first when the user press the Preview / Print Button and before the first rec for the first dataitem is get.
So your start function is Report - OnInitReport(). But also here (the new report is behind you report form), you must manuelly press the Preview Button. And this is not what you want. Àlso you can create a new Report that is based on both ;-)
Question: Why do you need this?
I have not tested this solution but the onpostreport trigger should fire.
If its only two reports then why not add the dataitem(s) and sections to the first report and make one "super" report.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
So, and when the user selects category 1 report 1a and report 1b is printed and it would be very user-friendly, when he could handle both reports as one (while printing, with preview and so on)... Thats the idea...
So, in one Preview it's not possible. You can only run the Report 1b from 1a. But the user must then press the preview button self.
For a direct print of report 1b from 1a u can use Report.run(ID,false,false,Rec) or, if you need before in report 1b some parameters. declare Report1b as variable and use
Regards
1st parameter is the ReportID
2nd is UseRequestForm (to show the user the report so he can add some filters and can also change the defaultprinter)
3rd is UseSystem Printer (true -> WindowsSystenPrinter, false -> Printer from PrinterSelection table)
4th REc is the filtered Record
Thinking about what is required here - is it not similiar to the standard invoice print. In this report you have a copy loop based on the integer dataitem to print more that one copy and then conditional printing of sections. This will also solve the slight variances (I'm assuming) in the layout for the category type. You can pass the category down to the report (if not in the data) and then decide which sections to print.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html