hanibal
24th November 2008, 06:46
can someone please help with this issue:
i have 2 reports for a session, when i run the session and press " print " it should by default print the first report and in case some conditions exist then to print the second one aswell ,BUT, when i click the print buttom a dialog windows should not appear asking for which report to print.

NirajKakodkar
24th November 2008, 07:12
Hello Hanibal ,

Setting the predefinde variable "reportgrp" will solve your problem .

Regards,
Niraj

hanibal
24th November 2008, 12:04
can u specify more,as i found nothing in the help guide about "reportgrp"

litrax
24th November 2008, 14:12
Hello Hanibal,

the predefined variable "reportgrp" (look in the help under "predefined variables") controls the reportgroup, which has to be opened or displayed when you click "print".
When you insert the second report in "Maintain Reports by Session" into reportgroup 2 then you can use the variable in the program script to control which reportgroup should open.

Simple as long you have just one report per group and don't want the report choice window to open ... ;)

cyprus
29th November 2008, 13:19
can someone please help with this issue:
i have 2 reports for a session, when i run the session and press " print " it should by default print the first report and in case some conditions exist then to print the second one aswell ,BUT, when i click the print buttom a dialog windows should not appear asking for which report to print.

You can use brp.open() or spool.open() functions to control this. Check the help file, examples are given quite well.

Also you can check the following thread :
http://www.baanboard.com/baanboard/showthread.php?t=54399

NvpBaaN
30th November 2008, 10:59
reportgrp can solve your problem, but it may pose problems since you want to print BOTH the reports under some conditions.

The easier way is to use the printing commands with proper arguments.

-- If you are using brp or spool commands for printing, then you can specify mode as 0 when you issue the brp.open command
-- If you are using rprt_open(), then you cannot suppress the report selection window

litrax
18th November 2009, 12:36
We often develope new reports in a copy of the original one.
org. reportcode: tdsls010101000
New custom reportcode: tdsls010101010

The disadvantage of the brp and spool commands is:
First of all you need to know at all that the reportcode is in the program script.
Perhaps you stumble upon if you link the new reportcode in the session and still the old report is printed...
And thats a fact if more than one programmers maintain the system!

Then you need to find the code where the reportcode is placed and change it.
Of course if you have e.g. more than 1 report in a group or want to print 2 reports at the same time you must use the commands in the scripts. But the other solution is easier to maintain.

Litrax