calling report from form with parameters (sample code) [message #89237] |
Tue, 16 December 2003 19:45 |
Santosh Kshirsagar
Messages: 3 Registered: October 2003
|
Junior Member |
|
|
for all
who want to call report from form and pass parameter
to report and do not want to show parameter form and
directly report get executed.
here is my code where
report having path c:sample.rdf which
requires mthyr and vndcd paramters.
code as under is written on my form's button
to call report sample.rdf
declare
pid ParamList;
BEGIN
pid := Get_Parameter_List('san');
IF NOT Id_Null(pid) THEN
Destroy_Parameter_List( pid );
END IF;
pid := Create_Parameter_List('san');
Add_Parameter(pid, 'mthyr',
TEXT_PARAMETER,:mthyr);
Add_Parameter(pid, 'vndcd',
TEXT_PARAMETER, :vndcd);
ADD_PARAMETER(pid, 'PARAMFORM',
TEXT_PARAMETER, 'NO');
Run_Product(REPORTS, 'c:sample.rdf', SYNCHRONOUS,
RUNTIME,FILESYSTEM, pid, NULL);
end;
hope it will help you
santosh
|
|
|
|
Re: calling report from form with parameters (sample code) [message #89280 is a reply to message #89237] |
Mon, 19 January 2004 12:37 |
Prasanna
Messages: 43 Registered: April 2001 Location: India
|
Member |
|
|
Thanks for giving the sample code. But if my parameter contains a space then my report is not called from the form. I am getting error Invalid report object.
Any parameter with space in between like Firstname space Lastname as a single parameter then report is not opening.
Please help me in then
thansks
|
|
|
|
Re: calling report from form with parameters (sample code) [message #261898 is a reply to message #89237] |
Fri, 24 August 2007 00:18 |
sams
Messages: 100 Registered: August 2007
|
Senior Member |
|
|
your report having path c:sample.rdf which
requires mthyr and vndcd parameters.
where u define these parameters.
i have written following code under when_button_pressed trigger of button to call report my report's path is : 'D:\rep_ latest\run1\r5'
and parameters are class and monthcode:
declare
pid ParamList;
BEGIN
pid := Get_Parameter_List('san');
IF NOT Id_Null(pid) THEN
Destroy_Parameter_List( pid );
END IF;
pid := Create_Parameter_List('san');
Add_Parameter(pid, 'class',
TEXT_PARAMETER,:class);
Add_Parameter(pid, 'month',
TEXT_PARAMETER, :month);
ADD_PARAMETER(pid, 'PARAMform',
TEXT_PARAMETER, 'NO');
Run_Product(REPORTS, 'D:\rep_ latest\run1\r5', SYNCHRONOUS,RUNTIME,FILESYSTEM, pid, NULL);
end;
this code causes error :
bad bind variable class and month
tell me where i can define them (i have defined them in report builder)
plz reply me earlier
|
|
|