Home » Developer & Programmer » Forms » Passing Parameters-form to report, print to csv (merged)
Passing Parameters-form to report, print to csv (merged) [message #418283] Thu, 13 August 2009 19:38 Go to next message
johncano
Messages: 3
Registered: August 2009
Location: Manila, Philippines
Junior Member


help sir/ma'am..i am a newbie and a newly trained oracle programmer(w/c lasted for only 13 days covering sql,plsql, reports and forms)...uhm, i have searched this forum and found answers to my questions especially how to pass parameters from forms to reports..so iam already done with that, but my boss aside from generating a report, wants it to be generated to a .csv file, which i am having a hard time doing..
let me paint you guys a picture on how my small and first project looks like..

i have a report which generates depending on the 3 parameters that my boss asked me to do, from_date, to_date and department..and it's working perfectly already..then, i have this form that passes those parameters to my report so that i won't call the parameter form of the report and then i have this button that when i click it, it generates the report based on the parameters that i or the user supplied..

my problem is about the "print to file" or "print to csv" option that my boss demands..my understanding of oracle built-in procedures are limited..sir David mentioned in some thread/topic that web.show_document could be of some help, but i don't really understand the parameters needed for that command, i think i need a report server for that?which i believe we don't have here on our office thou i am not sure..

here's the code i use to run my report from my form...

DECLARE
pl_id ParamList;
BEGIN

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,'PARAMFORM',TEXT_PARAMETER,'NO');
Add_Parameter(pl_id,'P_dept',TEXT_PARAMETER,:BLOCK3.dept);
Add_Parameter(pl_id,'P_from_date',TEXT_PARAMETER,:BLOCK3.from_date);
Add_Parameter(pl_id,'P_to_date',TEXT_PARAMETER,:BLOCK3.to_date);
Run_Product(REPORTS,'D:\old_new_success.rep',SYNCHRONOUS,RUNTIME,FILESYSTEM,pl_id, NULL);
END;


my real problem is, let's say the user inputs those 3 parameters(from and to date and dept) and i clicked the generate to file button, it should be able to generate a .csv file from my report using those 3 parameters..hope you guys can help me out with this..thanks...

icon5.gif  Passing Parameters-form to report, print to csv [message #418284 is a reply to message #418283] Thu, 13 August 2009 19:40 Go to previous messageGo to next message
johncano
Messages: 3
Registered: August 2009
Location: Manila, Philippines
Junior Member

help sir/ma'am..i am a newbie and a newly trained oracle programmer(w/c lasted for only 13 days covering

sql,plsql, reports and forms)...uhm, i have searched this forum and found answers to my questions especially how

to pass parameters from forms to reports..so iam already done with that, but my boss aside from generating a

report, wants it to be generated to a .csv file, which i am having a hard time doing..
let me paint you guys a picture on how my small and first project looks like..

i have a report which generates depending on the 3 parameters that my boss asked me to do, from_date, to_date and

department..and it's working perfectly already..then, i have this form that passes those parameters to my report

so that i won't call the parameter form of the report and then i have this button that when i click it, it

generates the report based on the parameters that i or the user supplied..

my problem is about the "print to file" or "print to csv" option that my boss demands..my understanding of oracle

built-in procedures are limited..sir David mentioned in some thread/topic that web.show_document could be of some

help, but i don't really understand the parameters needed for that command, i think i need a report server for

that?which i believe we don't have here on our office thou i am not sure..

here's the code i use to run my report from my form...

DECLARE
pl_id ParamList;
BEGIN

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,'PARAMFORM',TEXT_PARAMETER,'NO');
--Add_Parameter(pl_id,'DISABLEprint',TEXT_PARAMETER,'YES');
Add_Parameter(pl_id,'P_dept',TEXT_PARAMETER,:BLOCK3.dept);
Add_Parameter(pl_id,'P_from_date',TEXT_PARAMETER,:BLOCK3.from_date);
Add_Parameter(pl_id,'P_to_date',TEXT_PARAMETER,:BLOCK3.to_date);
Run_Product(REPORTS,'D:\old_new_success.rep',SYNCHRONOUS,RUNTIME,FILESYSTEM,pl_id, NULL);
END;


my real problem is, let's say the user inputs those 3 parameters(from and to date and dept) and i clicked the

generate to file button, it should be able to generate a .csv file from my report using those 3 parameters..hope

you guys can help me out with this..thanks...
Re: Passing Parameters-form to report, print to csv [message #418293 is a reply to message #418284] Thu, 13 August 2009 21:09 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please be careful when posting. When dealing with the same issue, add a post to your existing thread instead of creating a new thread. If you DO create a second thread accidentally (for example, by pressing 'refresh') then use the 'Report message to a moderator' facility to ask a moderator to delete it.

Please post code in 'code' tags.

What version of Forms and Reports are you using?

Use 'utl_file' or 'text_io' to produce the 'csv' file. If you HAVE to produce a REAL spreadsheet then search this forum for 'excel'. The 'web.show_document' command only has two parameters. Building them can be interesting but is no more difficult that building a typical parameter list, they are just concatenated.

David
Re: Passing Parameters-form to report, print to csv [message #418296 is a reply to message #418293] Thu, 13 August 2009 22:44 Go to previous messageGo to next message
johncano
Messages: 3
Registered: August 2009
Location: Manila, Philippines
Junior Member

What version of Forms and Reports are you using?

oracle forms 6i and reporrtts 6i...
Re: Passing Parameters-form to report, print to csv [message #418305 is a reply to message #418296] Fri, 14 August 2009 00:36 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Search the 'reports' forum. There should be other threads in there.

David
Previous Topic: Webinar on Choosing the Future Direction for Your Oracle Forms Applications
Next Topic: Automatically Attach RP2RRO
Goto Forum:
  


Current Time: Sun Dec 04 06:15:44 CST 2016

Total time taken to generate the page: 0.10987 seconds