muheeb
20th August 2002, 10:33
Hi all,

I have a little problem running session with multi reports;

like "Print Quotation" or "Sales Order Acknowledgement" which

produces 2/3 reports. I wrote a 4GL/3GL device... when I run the

session it give me to select the device 1 after another and I select

my device and then it begins to run the device (although 1 after

another). but what I discovered that "spool.report" in both

running device (the 1st and the 2nd) will be the same report

name and it's for the last report selected (however the data

is ok). I have Baan4c.

I need to know the right report name in each run; is there a

solution for that?

Thanks.

NPRao
20th August 2002, 10:53
You can use the predefined variables for reports -


string report$ 4GL - Current report code.

long reportgrp 4 GL - Current report group.

long reportno R
Reports are numbered (1..n) within a report group.
This number indicates the sequence number within the report group.
Note: The numbers (labeled "No.") in the session "Reports by Session"
only match with reportno if these numbers are consecutive.


and for spool -


string spool.device(14) Name of spooler device.

string spool.report(20) Report to be printed.


Then use, this function to get the description for more clarity -

http://www.baanboard.com/programmers_manual_baanerp_help_functions_runtime_dictionary_information_tt_report_desc

muheeb
20th August 2002, 11:08
Thank you for replying..

but this didn't help!

"report$" is the same like "spool.report" variable..

I got in report$ the wrong current report code in the situation

I described before:

there're 2 reports, 1 for each group (group 1 & 2; both no. 1)

I select the wanted device twice, and then see the device

runs for the first report (but with wrong report code in report$

- with the code of the 2nd report) and after finishing it runs for

the second report!

Do you have BaanIVc? could you try it yourself?

david7
8th March 2008, 16:57
Hi,

I think have the same problem.

One print session is generating two reports. one after the other. I am getting the "Select Device" session twice one after the other. Then if I choose a display divce I will see the two reports.

The problem is that when I run my customized device, "spool.report" gets the value of the second report in the two devices! I need to know both report code names.

Is there a solution for this?

- D7

mark_h
10th March 2008, 02:48
I think I understand - in your customized device can you read the report description from the temporary file and associate in with the report number(using one of the tools tables)? Just a thought.

Other than that is this a customized session or do you have source code? Then you could probably store off the number and pass it to the report.

george7a
4th June 2008, 14:23
I have found a solution for this problem. I just went through it myself.

The idea is to take the report name from the printer queue table!

Use the following function in your device, and it will return the current report code even if there were two runs after each other:

function string get.report.name()
{
string rpac(2),rmod(3),repc(15)

get.var(parent,"ttaad320.rpac",rpac)
get.var(parent,"ttaad320.rmod",rmod)
get.var(parent,"ttaad320.repc",repc)

return (rpac&rmod&repc)
}
I hope it helps,

- George