|
|
Re: Can I Pass a Data on "Report Writter" from "Form Builder" without saving data [message #84114 is a reply to message #83582] |
Fri, 30 January 2004 11:56 |
Walt Elliott
Messages: 9 Registered: December 2003
|
Junior Member |
|
|
It's a real kludge, but you could also try creating 100 parameters and pass those
to the report. It's not the most eligant method I've ever seen but it might work if there's not a limit on how many parameters you can create. Of course, you'll still need to write some PL/SQL code in the report to parse out your columns.
Below you find some code where I create a parameter (the where clause of a select stmt) and pass it to a report.
Hope this helps if nothing else does.
Walter
declare
pl_id ParamList;
WS_PARM VARCHAR2(2048);
bmarked boolean;
begin
if not id_null(pl_id) then
destroy_parameter_list(pl_id);
end if;
pl_id := create_parameter_list('DEFAULTWHERE');
go_item(:global.last_item);
If :global.mark_flag = 'Y' then
ws_parm := get_block_property(:global.table_control_block, default_where);
else
bmarked := fnextrec;
bmarked := true;
ws_parm := '(BUS_NUMBER = '||CHR(39)||:BUS_EVENTS_LIST.BUS_NUMBER||CHR(39)||' AND EVENT_SEQUENCE = '||
CHR(39)||:BUS_EVENTS_LIST.EVENT_SEQUENCE||CHR(39)||')';
--' AND EVENT_DATE = TO_DATE('||CHR(39)||:BUS_EVENTS_LIST.EVENT_DATE||CHR(39)||',''DD-MON-YY''))';
bmarked := fnextrec;
while bmarked loop
ws_parm := ws_parm ||' OR '||'(BUS_NUMBER = '||CHR(39)||:BUS_EVENTS_LIST.BUS_NUMBER||CHR(39)||
' AND EVENT_SEQUENCE = '||CHR(39)||:BUS_EVENTS_LIST.EVENT_SEQUENCE||CHR(39)||')';
--' AND EVENT_DATE = TO_DATE('||CHR(39)||:BUS_EVENTS_LIST.EVENT_DATE||CHR(39)||',''DD-MON-YY''))';
bmarked := fnextrec;
end loop;
end if;
if ws_parm is null then
ws_parm := '1=1';
end if;
add_parameter(pl_id,'P_WHERE',TEXT_PARAMETER,WS_PARM);
run_product(REPORTS, 'MTCRPT', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
if not id_null(pl_id) then
destroy_parameter_list(pl_id);
end if;
end;
|
|
|