benkoolstra
24th October 2002, 19:12
I would like to print a report which automatically should start up the printing of a second report.
Does anybody know a way to do this or is it impossible ?
evertsen
24th October 2002, 20:30
It is definitely possible and is not that hard to set up. I'll post the code as soon as I remember where it is:)
Ev
evertsen
24th October 2002, 20:40
I believe this is the function you are looking for.
example:
long brd_id1
brd_id1 = brp.open("tiitm040101000","",0)
mark_h
24th October 2002, 21:01
I need more details on what you are trying to do. Are you trying to generate two reports one script or two reports from two different sessions,etc. Then I might have a suggestion or two. :)
Mark
benkoolstra
24th October 2002, 23:34
Fist of all thank you for the help.
When an quote becomes and order we print a special version of the quote report (the order confirmation) we also directly print an document with details for internal use. The users would like to be able to just once make the selection of the quotes they want to print and then get both reports printed.
I hope this makes things more clear.
Regards,
Ben
mark_h
24th October 2002, 23:57
One solution is to create a new session with the minimum number of inputs to print both reports. Then use a function server to print both reports. Or modify you first report session to use the function server method to print the second report. You can check the API forum for documentation on creating function servers.
Mark
Paul P
25th October 2002, 04:27
Dear Ben,
Evertsen pointed out the right function set. You can open 2 report, say
brp_id1=brp.open(string rep_name(16), string device(14), long mode )
brp_id2=brp.open(string rep_name(16), string device(14), long mode )
Then as you find record to throw to report engine, you send it to both reports
brp_ready(brp_id1)
brp_ready(brp_id2)
Finally, you close both reports before ending session
brp_close(brp_id1)
brp_close(brp_id2)
Rgds,
Paul
Armando_Rod2000
25th October 2002, 18:57
i think u can try with it:
if not open.report(1, spool.device, 1, language$, 1) then
choice.again()
endif
.
.
.
.
when you want to send data to the first report:
print.record(1)
when you want to open the second report then:
if not open.report(2, spool.device, 0, language$, 2) then
choice.again()
endif
and when you want send data to the second report use:
print.record(2)
to close all reports:
close.reports()
good luck!!!!
baanprog
26th October 2002, 01:39
If you want to print two reports simultaneously like that, without popping the normal baan report menu selection(small menu that pops up when u try to print, if more than one report is linked to the session), you have to do the following things:
1.Link the reports in different report groups to avoid the pop up menu and directly print the reports.
2. Handle printing of reports urself, ie when which report should be printed by calling brp.ready(id).(This will be normally done by baan as you select only one report in one group but here you have to tell Baan how to handle)
3.brp.ready will not handle "no data within selection" like in tccomdll0010, print_report, rprt_send(the others ways to print a report in baan).So you have to handle them urself.
4.Last of all test the report well by debugging, bcos using brp.ready does give some problems.
I have written sessions that print 8 reports simultaneously and had fun with baan.
Paul P
26th October 2002, 05:22
Dear Armando,
The functions you mentioned are available in B5 under the DLL tccomdll0010 as mentioned by baanprog. Is it available in B4c4 system used by Ben? If yes, what's the library name? Thanks.
Rgds,
Paul