Home » Developer & Programmer » Reports & Discoverer » Passing multiple information through a parameter
Passing multiple information through a parameter [message #89646] Fri, 11 June 2004 05:09 Go to next message
Nidia
Messages: 2
Registered: June 2004
Junior Member
-

I need help with creating a parameter that passes various values.

For example, I want to print the report for Purchase Order 1, 6, 10, and 25. To print one report it says

where po_no = :p_po_no.

But, how would it be for several. Each time I print this report it might be one, two, five, etc. I will never have a set number of POs to print.

Any help or more details on how to do it would be great.

Thanks in advance
-
Re: Passing multiple information through a parameter [message #89649 is a reply to message #89646] Sat, 12 June 2004 12:28 Go to previous messageGo to next message
Ranjit
Messages: 19
Registered: November 1999
Junior Member
Few years ago, I wrote a piece of code to handle this case. I had developed a form showing a checkbox, PO number and 2/3 other important details and a button to invoke PO priting report. The user has to select POs (I used to display all POs created on sysdate by default) and Press Report to invoke report. The report has a parameter :from_po and :To_po too. The selected POs from Form were stored in a staging table and used to be cleared with every invoke of the form. The query in report used to be
<<where po_no between :from_po and :to_po OR po_no in (select po_no from <staging_table>)

May sound nasty...but this helped.

Regards
RKB
Re: Passing multiple information through a parameter [message #89654 is a reply to message #89649] Sun, 13 June 2004 23:23 Go to previous message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
For this you may Prepare a Parameter in you calling Form say as
L_str Varchar2(10000):=null;
Begin
L_Str:=' And Order_no in('||Ord1||','||ord2||....);
Add_parameter(L_Rp_Nm, 'P_NO', Text_Parameter,L_STR);

Increase the size of P_NO in your report to Varchar2(1000);
In your Datamodel chnage the query as follows:

Select * From XYZ
Where 1=1 /**whatever is your where clause**/
&P_No;

P_NO will be used as a Lexical parameter in your query and the complete L_STR passed to P_NO from the form will be appended to your Query at runtime i.e.:

Select * From XYZ
Where 1=1
AND Ord_no in(1,2);

HTH
Regards
Himanshu
Previous Topic: call report from report
Next Topic: .REP files
Goto Forum:
  


Current Time: Thu May 02 01:23:01 CDT 2024