Hi tyb,
Following is the code we will using in Oracle forms to call the report and pass the parameters to report.
This code is written in the form wile calling Oracle Reports.
-------------------------------
Declare
CLIENT_PARAM_LIST PARAMLIST;
lv_vcVariableName VarChar2(50);
Begin
lv_vcVariableName := 'Value to be passed to reports';
CLIENT_PARAM_LIST := CREATE_PARAMETER_LIST('LISTFILETAB');
Add_Parameter(CLIENT_PARAM_LIST, 'UserParameterName', Text_Parameter, lv_vcVariableName);
Run_Product(REPORTS, 'ReportFileName.rep', SYNCHRONOUS, RUNTIME, FILESYSTEM, CLIENT_PARAM_LIST, NULL);
DESTROY_PARAMETER_LIST('LISTFILETAB');
--------------------------------------------
First we will create PARAMLIST, which holds all the parameters to be passed to the report. check the "Add_Parameter" syntax. Use the "Add_Parameter" statement to pass more varibales to the report
We will get all the values to be passed to the form into local variables.
Create the Paramlist
Add the Userparameters/system parameters values to the paramlist. The link between forms and reports are established here.
What ever the 'UserParameterName' in forms is mapped to the reports 'UserParameterName' name. The link is established in the next statement "Run_Product". If you want to mention any system parameters value, you can pass in the same manner.
So the values from form to reports are passed now successfully.
In the reports if you want to use these parameters in the sql statements, just use ":" in front of the 'UserParameterName'. When ever the sql statement is executed the 'UserParameterName' is replaced with the value you passed.
Regards
Krishna Reddy M
mckreddy@visualsoft-tech.com