Joy Conner
17th January 2002, 18:12
I have a report attached to a "Maintain" session. When I execute the session, I want to ask the user for an output device when the session starts. Not for each record. Here is my code.
form.1:
init.form:
rprt_open()
I'm getting 2 errors. The fatal error states "No permission for 2"
The other error is a message stating "Report not present"
Any help would be appreciated.
Thanks - Joy
~Vamsi
17th January 2002, 19:50
Joy,
rprt_open will not detect the reports until the event "choice.print.data" is executed. That is why the typical code looks like
choice.cont.process:
on.choice:
execute(print.data)
choice.print.data:
on.choice:
if rprt_open() then
and not like
choice.cont.process:
on.choice:
if rprt_open() then
This should solve your second error. A wild guess about the first one - does the "2" have anything to do with the language "2" English?
Youp2001
18th January 2002, 11:41
If you really need to open your report without using the choice.print.data section you probably can use the following:
- First select the correct report group for your report by assigning a value to the variable reportgrp. This is only necessary if you use another reportgroup than 1 (this is the default value)
- Call the function choice.report(). In case more reports are available within the selected reportgroup the use gets a list to select correct report. After this the argument of the function will contain the selected reportcode. See the tools manual for more details.
Hope this helps.
lbencic
18th January 2002, 22:46
I am not sure on Youp's solution, but for Vamsi's, you can try moving the execute(print.data) around to different sections if you don't want to wait for the user to choose "continue", but the rprt_open should stay in the print.report section, just as ~Vamsi has posted.