Home » Developer & Programmer » Reports & Discoverer » calling report from form with parameters (sample code)
calling report from form with parameters (sample code) [message #89237] Tue, 16 December 2003 19:45 Go to next message
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 #89238 is a reply to message #89237] Tue, 16 December 2003 23:24 Go to previous messageGo to next message
Muzzammil
Messages: 99
Registered: February 2003
Member
Hi,

See the answer in the same page below question

how to avoid runtime parameter form in reports2.5 when calling it from a form

Hope this what you are seeing for.

Bye

Syed Muzzammil
Re: calling report from form with parameters (sample code) [message #89280 is a reply to message #89237] Mon, 19 January 2004 12:37 Go to previous messageGo to next message
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 #89787 is a reply to message #89280] Sat, 24 July 2004 11:10 Go to previous messageGo to next message
Mamun
Messages: 2
Registered: July 2004
Junior Member
HI ,

i am having the same problem... when i pass the parameter as single string it works perfect...but if there is any space..it doesn't execute...could anybody help ASAP

Thanks,

Mamun
Re: calling report from form with parameters (sample code) [message #261898 is a reply to message #89237] Fri, 24 August 2007 00:18 Go to previous message
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 month
code:

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
Previous Topic: REP-1223: Invalid page size
Next Topic: page break on alphabet
Goto Forum:
  


Current Time: Thu Jul 04 12:19:33 CDT 2024