Reputation: 111
I want to pass a parameter using web.show_document() from a Form to a Report, I added the parameter in the URL but I don't know how to get it in the Report and use it .. anyone has an idea about that ?
Thanks in advance :)
Upvotes: 0
Views: 3440
Reputation: 1
You don't have to run the report thru run_report_object first. Simply create the parameter as a user parameter in report builder, e.g. P_EMPNO. Then create your report url with the parameter and value. The value will be passed to the report. Run web.show_document with the url i.e. ...?report_server=xxxxxxxx+report_id=myreport+P_EMPNO=0001.....
Upvotes: 0
Reputation: 679
To pass the parameters to report in Oracle Forms, you should use paramlist and pass it through run_report_object built-in and after that you can call the report using web.show_document by passing the report id. You can not pass report runtime parameters in web.show_document, below is the example:
pi_id := Create_parameter_list ('rep_param');
Add_parameter (pi_id,
'PARAMFORM',
TEXT_PARAMETER,
'no');
--- report object
--- the below report object 'cproreport' must be created in Report object navigator.
repid := Find_report_object ('cproreport');
Set_report_object_property (repid, report_filename, Rtrim(:parameter.report_path)||preport);
Set_report_object_property (repid, report_server, :parameter.r_server);
Set_report_object_property (repid, report_execution_mode, RUNTIME);
Set_report_object_property (repid, report_comm_mode, SYNCHRONOUS);
Set_report_object_property (repid, report_destype, cache);
Set_report_object_property (repid, report_desformat, pformat);
vc_reportserverjob := Run_report_object (repid, pi_id);
After that run web.show_document as following:
report_job_id :=
Substr (vc_reportserverjob,
Length (:parameter.r_server) + 2,
Length (vc_reportserverjob));
v_rep_status := Report_object_status (vc_reportserverjob);
If v_rep_status = 'FINISHED'
Then
web.show_document (
'http://'
|| :parameter.host
|| ':'
|| :parameter.port
|| '/reports/rwservlet/getjobid'
|| report_job_id
|| '?server='
|| :parameter.r_server,
'_blank'
);
Upvotes: 1