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!

data parameters to reports

Status
Not open for further replies.

tyb

Technical User
Feb 10, 2004
137
IR
dear frends

plz help me that how can i use data parameter(containing record group) to pass to the report.
 
Say you have 2 fields in your report: field1 and field2 given by a query
select
field1, field2
from tbl.
So far you have a single group in the datamodel, say G_1.
Say you have parameter p_1, and if it equals 1 you want to group by field1, otherwise by field2.
1. In the group where field1 and field2 are define calculated field cf_1 with the following formula:

function CF_1Formula return Number is
begin
if :p_1 = 1 then return :field1;
else return :field2;
end if;
end;

2.Define the break order on cf_1 to be ascending.
3.Drag cf_1 in front of G_1 to form the new group G_CF_1.
4.Define your report as 2 repeating frames, one insede another. The source of outer frame to be G_CF_1, the source of inner one to be G_1.
5.Place cf_1 to the outer frame, field1, field2 to the inner one.
 
many thanks for ur response

but may be i couldnt comunicate u the exact thing i wanted to know i.e

i've a data parameter "REM" within my form and it contains multiple IDs (say record group), now i want my report to run for these IDs.

i've following code on the when-new-from-instance to run the report on form starting

DECLARE
rg_name VARCHAR2(40) := 'due_dates';
rg_id RecordGroup;
errcode NUMBER;
pl_id paramlist;

BEGIN
rg_id := Find_Group(rg_name);
IF Id_Null(rg_id) THEN
rg_id := Create_Group_From_Query(rg_name,'select styleid from styles
where styles.styleid =( select tnid from tna where PFAUDIT_DT = trunc(sysdate)+2
or
FAUDIT_DT = trunc(sysdate)+2
or
HO_DT = trunc(sysdate)+2)');

END IF;
errcode := Populate_Group(rg_id);


pl_id := get_parameter_list('rem');
if not id_null(pl_id) then
destroy_parameter_list(pl_id);
end if;
pl_id := create_parameter_list('rem');
add_parameter(pl_id,'rem',data_parameter,rg_name);


run_product(reports,'E:\reports+forms\reports\tnareminders.rep',synchronous,runtime,filesystem,pl_id);

END;


and i've used following query

select * from styles
where styles.styleid in :rem

in the report. but nothing gets passed to the report.
 
I don't think list parameters are supportet by Oracle Report. To do what you need use lexical parameter

select * from styles
where styles.styleid in &REM

and pass from your form for the REM parameter either a piece of sql, or explicit list. Any of those substituted for &REM should create meaningful report query.
For example, REM can be
(select field1 from TBL) -- subquery, or
('value1', 'value2', 'value3') -- list of values.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top