mig28mx
28th November 2008, 17:53
Hello all,
I´m developing a sesion with two reports.
I´m wondering how to do the following:
Depending on user's choice buttons, let say, button1 and button 2,
I need to take the appropiate report without prompting what report the user need.
For example, if user chooses button 1, then the session output must be, report1, and if user chosses button 2, then the session output must be report2, and so on.

Any ideas?

Thank you in advance.

_Ralph_
28th November 2008, 21:04
I work quite a little with baan IV but in LN if you can specify a Report Group and a Sequence for each report linked to a session.

Reports of the same group appears on a window to the user choose the one he wants.

But if you use different groups no window appears. So you need to make some Spooling to handle the report you want

take a search for

brp.open() or spool.open()

cyprus
29th November 2008, 12:52
Hello all,
I´m developing a sesion with two reports.
I´m wondering how to do the following:
Depending on user's choice buttons, let say, button1 and button 2,
I need to take the appropiate report without prompting what report the user need.
For example, if user chooses button 1, then the session output must be, report1, and if user chosses button 2, then the session output must be report2, and so on.

Any ideas?

Thank you in advance.

Hi,
If you are using two buttons on the form, Button 1 & Button 2, your requirement can be met quite comfortably.

You can write the following code in the "before.choice" or "after.choice" of the respective buttons, you can use brp functions instead of rprt functions :

brp.id = brp.open("report 1", "device name", 1 or 0)
read.main.table() -> function to fetch data for report
brp.close(brp.id)

Note : Instead of rprt_send(), you will use brp.ready(brp.id)

As Ralph has already suggested, you can serach for brp.open() or spool.open() for more help...

NvpBaaN
30th November 2008, 11:11
Define the two reports in separate report groups, and based on your conditions, set the appropriate report group. When calling brp.open or spool.open functions to open the report, pass mode argument as 0 so that report selection window is suppressed.