halvorn
3rd April 2002, 17:09
Hi,

I have several reports in "Maintain reports by session"

When the choice.print.data section is executed in the Session script, the user can select between the reports in the current group. The section in the script looks like this:

choice.print.data:
on.choice:
if rprt_open() then
get_records()
rprt_close()
else
choice.again()
endif

This functionality seems to be "built in" for the choice.print.data section.

But how can I obtain this in a user section.
I manage to print a specific report assigned to the spool.report predefined variable, like this.

choice.user.1:
on.choice:
spool.report="rtirou9101110002"
if rprt_open() then
get_records()
rprt_close()
else
choice.again()
endif


If I don't assign the report name to spool.report then rprt_open() fails. How can I obtain that the user needs to select from one of the reports belonging to the Current group ?

Thanks

mark_h
3rd April 2002, 18:49
Your code in both sections looks the same. So is it possible to choice the choice.user section to just execute(print.data) - see below. Does this session have both sections as listed?

Mark


choice.user.1:
on.choice:
execute(print.data)

agramm
3rd April 2002, 19:12
choice.print.data:
on.choice:
calls tools function

long choice.report(ref string reportname(15))

implicitly.
you can call this function by yourself and all reports of current reportgroup are shown for selecting.
if you want a specific reportgroup set predefined variable reportgrp to your group.
But be carefully, use
if (choice.report(myreportname)>0) then
...
endif
because the user can cancel the selection.

Good Luck
Andy