Home » Developer & Programmer » Forms » How to pull off report from form builder 6i within specific date(s) (Oracle Form Builser 61, Report Builder 6i , Windows Xp Professional)
How to pull off report from form builder 6i within specific date(s) [message #522451] Fri, 09 September 2011 13:43 Go to next message
Hometown
Messages: 35
Registered: October 2010
Location: India
Member
SQL Plus version Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
PL/SQL Release 8.0.5.1.0 Production
Forms Version : 6i
Reports Version: 6i
O/S : Microsoft Windows Xp professional Version 2002 Service Pack 3

Dear Friends
With regards to the above version description here is my query. I have a form which calls report it accepts various parameters like date between, appeal and so on . I want the report to be restricted to the date parameter as passed by the user.Here is my coding which runs report
Declare
Pl_id ParamList;
where_cond varchar2(2500);
Begin
------------Appeal------------------
if
upper(ltrim(rtrim(:appeal)))<> 'ALL' then
where_cond:= where_cond ||'and tbl_donation.appeal_code='||ltrim(rtrim(:blk_ihelp.appeal_code));
else
where_cond:= where_cond||' and tbl_donation.appeal_code is not null';
end if;

-------------Date Option----------------
if
:date_option is not null then
if
:date_option = 'BETWEEN'then
where_cond:=' and tbl_donation.donation_date between '''||ltrim(rtrim(:fdate))||''' and ''' ||ltrim(rtrim(:tdate))||'''';
else
where_cond:=' and tbl_donation.donation_date '||:date_option||''''||ltrim(rtrim(:fdate))||'''';
end if;
end if;
--------------Country-------------------
if
upper (ltrim(rtrim(:country))) <> 'ALL'then
where_cond:= where_cond||'and tbl_donation.country_code='||ltrim(rtrim(:blk_ihelp.country_code));
else
where_cond:= where_cond||'and tbl_donation.country_code is not null';
end if;

-------------Contact Code---------------
if
:contact_code is not null then
if
:contact_code = 'BETWEEN'then
where_cond:= 'and tbl_contact.contact_code between '''||ltrim(rtrim(:fcode))||''' and '''||ltrim(rtrim(:tcode))||'''';
else
where_cond:= 'and tbl_contact.contact_code '||:contact_code||''''||ltrim(rtrim(:fcode))||'''';
end if;
end if;

pl_id := Get_Parameter_List ('tmpdata');
IF NOT Id_Null(pl_id) then
Destroy_Parameter_List (pl_id);
END IF;
pl_id:= Create_Parameter_List ('tmpdata');
Add_Parameter(pl_id,'param_value',TEXT_PARAMETER,ltrim(rtrim(where_cond)));
Add_Parameter(pl_id,'appeal',TEXT_PARAMETER,ltrim(rtrim(:appeal)));
Add_parameter(pl_id,'fdate',TEXT_PARAMETER,ltrim(rtrim(to_char(:fdate,'dd.mm.rrrr'))));
Add_Parameter(pl_id,'tdate',TEXT_PARAMETER,ltrim(rtrim(to_char(:tdate,'dd.mm.rrrr'))));
Add_Parameter(pl_id,'country',TEXT_PARAMETER,ltrim(rtrim(:Country)));
Add_Parameter(pl_id,'fcode',TEXT_PARAMETER,ltrim(rtrim(to_number(:fcode))));
Add_Parameter(pl_id,'tcode',TEXT_PARAMETER,ltrim(rtrim(to_number(:tcode))));
Add_parameter(pl_id,'PARAMFORM',TEXT_PARAMETER,'NO');
Add_parameter(pl_id,'maximize',TEXT_PARAMETER,'Yes');
--if
--:rpt_type = 'DWR' then
Run_Product(REPORTS, '\\hsbt-server\c$\ihelp_working\reports\rpt_water_pump_working',SYNCHRONOUS,RUNTIME,FILESYSTEM,pl_id,NULL);
--end if;
END;
The code compiles successfully, but does not caters the need.Any help will be appreciated.
Re: How to pull off report from form builder 6i within specific date(s) [message #522463 is a reply to message #522451] Fri, 09 September 2011 15:29 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Looks like you are comparing DATEs to character strings, but without the helpful information like table definition and variable types, I can offer no further help. And "does not caters the need" is not an Oracle error message.
Previous Topic: Using externally identified id to LOGON to ORACLE FORMS
Next Topic: forms with the JPI
Goto Forum:
  


Current Time: Sat Sep 07 13:05:01 CDT 2024