dmcgrath
5th March 2002, 12:42
I have created a report that will be run as a job. My problem is that we would ideally like to split the output of the report based on a field within in the report such that in condition 1 device 1 is used and in condition 2 device 2 is used. Is this possible? If so how could it be achieved?

We have an idea about sending the output to a forms package and using this to determine the output device, but would be happier if it could all be done through Baan.

We use IVc3

Darren

i96nds
5th March 2002, 14:10
Check the functions BRP.OPEN, BRP.CLOSE, etc....

Remember that RPRT_OPEN(), RPRT_CLOSE() are the short syntax of functions BRP.OPEN, BRP.CLOSE.

See the help for these functions for more details.

For your problem:

brp_id1=brp.open(("rtcqms040101000", "D",2)

more elabourate:

if field=1 then
brp_id1=brp.open(("rtcqms040101000", "WP",2)
else
brp_id1=brp.open(("rtcqms040101000", "D",2)
endif

Regards,

mark_h
5th March 2002, 14:39
I am not sure how you could do this in the report script itself. If you wanted to do it in the session script then the way i96nds mentions would work. If for some reason you can not modify the session script then I would run the report to an ASCII file in the job. Then I would create a script to read the report and send it the two different places. Not a pretty solution, but possible.

Mark

i96nds
5th March 2002, 15:29
I did not read carefully that the choice of the device should be done in the report script... It is my fault. It can only be done in the session's script, of course, it is quite obvious why this cannot be done in the report script. When data goes to the report, the spooling device should be already known. Right?

Mark's solution is the best choice, of course. I mean sending the report to an ASCII file. You can run the job using a user that has a resonable setting in "User Data" at the "Delete delay time", for example 72 hours. Be sure you do not delete the content of $BSE/TMP with another job.

Then, go to "Maintain Device Queue" and search for your print request, then choose "Repeat Request". There you can choose any other Baan Device.

Regards,