Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing parameters to report 1

Status
Not open for further replies.

tyb

Technical User
Feb 10, 2004
137
IR
Dear Frends

plz help me
i want my report to be shown against some spaecific form value .

can some one plz guide me the whole way to get at it.
some example will be greatly appreciated.

thanks in advance.
 
Hi tyb

Open your report in Object navigator mode (press F3). Select the "User Parameters" under Data Model. Create a new user parameter and change the data type as u required.

In your select statement use that variable as follows. Use the ":" before the parameter name. you can pass the parameter from forms are reports depending upon your requirement.

Select * from TableName where fieldName = :UserParameter

Regards
Krishna Reddy M
mckreddy@visualsoft-tech.com
 
hi dear krishna

i've used this way to pass the parameters to report at start up (from the parameter form).

but i'm wondering about how would i have the current cursor location (field value) from the form , then pass it to the report and then the report to be restricted to that value.

plz let me know the whole procedure as i'm new to oracle.

it would b a great help to me.
many many thanks for ur response
 
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
 
many many thanks krishna

its working very well, u've given me a great favor.

i've another problem that instead of passing this value directly to the report and run it , the value gets passed to the parameter form and then i've to press enter key to run report. is there a way that i can run it directly.

2ndly i want the reports to be started in maximized window.

thanks again.
 
Open the Report. In the reports menu, select Tools --> Prarameter Form Builder.

DeSelect the parameters which does not need to display before report running. Press "Ok". A warnning message displays, Press "Yes" to replace the existing Parameter form.

Select the remanining labels ("Report Parameters"...)and delete them. Now your Parameter form looks like empty new form.

Run the report. It will display the report output with out displaying parameter form.

Regards
Krishna Reddy M
mckreddy@visualsoft-tech.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top