From form calling report to result to pdf file
Dear All,
Usually, when we call a report from form, it calls to preview. Now, I would like to autometically call the report and upon execute, the pdf file will be created. Can anybody tell me how to do that.
p/s: I do not want the preview becasue this report is a complicated report and it takes quite some time to process. So I would like my user to get the pdf directly instead of going though the preview.
Thanks
DECLARE
pl_id ParamList;
Begin
pl_id := Create_Parameter_List('Reports_Parameters');
Add_Parameter(pl_id,'PARAMFORM',TEXT_PARAMETER,'NO');
Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER,'FILE');
Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER,'C:\aRep1.Pdf');
Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'PDF');
RUN_PRODUCT REPORTS,'C:\Rep1',SYNCHRONOUS,RUNTIME,FILESYSTEM,pl_ID);
Destroy_Parameter_List(pl_id);
End;
Similar Messages
-
Forms calling Reports output issue RTF/PDF - strange issue
Dear All,
I'm looking for a bit of help with a strange situation calling reports from Forms.
This problem I'm getting in both 11.1.1 and 11.1.2 of Forms/Reports. Client is WinXP/7 (issue appears on both), Weblogic server is Linux (SLES11 and Red Hat - issue on both)
So the issue is
1. calling a report with output as RTF (this works fine and we use OLE2 to open the report in Word)
2. Wihile in that form call the same report though change the output to be created as PDF in the cache and the report then opens in IE (this too works fine)
3. Now if we try and do number 1 again (still in the same form) and run the same report again and choose to generate as RTF and open in word, it erroneously generates the report in PDF format but with an .RTF extension on the file.
Of course most of the time people would not want to do this, but the client has identified this issue and classified it as a bug, so we need to fix it (and it doesn't happen in the Forms6i version it is migrated from).
I have tried to ensure that the parameter list is correctly deleted and re-created, which appears to be the case. I also tried to generate a new unique parameter list for every run, which made no difference to the problem.
If I choose to run a completely different report, the problem has reset itself. So the problem exists only when I've chosen the PDF output and then run the same report thereafter as RTF output to a file.
Code to prepare for the RTF option is:
Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'FILE');
Add_Parameter(pl_id,'desname',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.rtf');
l_report_desname := l_temp_env||'/'|| p_report || '.rtf';
Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'RTF');
Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'RTF');
Add_Parameter(pl_id,'mode',TEXT_PARAMETER,'BITMAP');
l_report := p_report;
Code used to prepare for PDF option is:
Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'CACHE');
Add_Parameter(pl_id,'desname',TEXT_PARAMETER,'');
Add_Parameter(pl_id,'desformat',TEXT_PARAMETER,'PDF');
l_report := p_report;
Any ideas gratefully received.
cheers
TonySo I delete the paramlist correctly, then the code is:
IF (p_display_method = 'W')
THEN
--WORD Format
--delete file on client
Delete_File('c:\temp'||'\'|| p_report || '.rtf');
--delete file on app server
host('rm '||l_temp_env||'/'|| p_report || '.rtf');
Add_Parameter(pl_id,'REPORT_DESTYPE',TEXT_PARAMETER,'FILE');
Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER,'FILE');
Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.rtf');
l_report_desname := l_temp_env||'/'|| p_report || '.rtf';
Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'RTF');
Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'RTF');
Add_Parameter(pl_id,'MODE',TEXT_PARAMETER,'BITMAP');
Add_Parameter(pl_id,'printjob',TEXT_PARAMETER,'no');
l_report := p_report;
ELSIF (p_display_method = 'E')
THEN
--EXCEL format
--delete file on client
Delete_File('c:\temp'||'\'|| p_report || '.csv');
Delete_File('c:\temp'||'\'|| p_report || '.xls');
--delete file on app server
host('rm '||l_temp_env||'/'|| p_report || '.csv');
Delete_File(l_temp_env||'\'|| p_report || '.cvs');
Delete_File(l_temp_env||'\'|| p_report || '.xls');
Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'FILE');
Add_Parameter(pl_id,'desname',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.csv');
Add_Parameter(pl_id,'desformat',TEXT_PARAMETER,'csv.prt');
Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'csv.prt');
Add_Parameter(pl_id,'MODE',TEXT_PARAMETER,'character');
Add_Parameter(pl_id,'printjob',TEXT_PARAMETER,'no');
l_report := p_report || '_d';
ELSIF (p_display_method = 'P')
THEN
-- PDF Format
Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'CACHE');
Add_Parameter(pl_id,'desname',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.pdf');
Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'PDF');
Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'PDF');
l_report := p_report;
END IF;
So all of the above works fine when generating a report the first time you enter a form, but if you run a PDF output report then immediately in the same form generate the report again to a non-PDF format, it comes out in incorrectly in PDF format.
rgds
Tony
Edited by: tony.g on Nov 29, 2012 1:37 PM -
How to send more than one parameter from FORM to REPORT?
Dear all,
i can send one parameter from FORM to REPORT. but when i send more than one parameter it gives error: frm 41214 unable to run report.
here is the code i think the error is in the following line of procedure:
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no p_date_from='||v_date_from||'p_date_to='||v_date_to);
where to place the parameters and is there any space is required?
Thanks
Muhammad NadeemDear Saeed Iqbal,
thanks for you reply.
dear i am using Form 10g run_product is not supported in this version.
i am using RUN_REPORT_OBJECT.
PROCEDURE rep_gl_ledger IS
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(50);
v_date_from date;
v_date_to date;
v_detail_id_from varchar2(100);
v_detail_id_to varchar2(100);
v_voucher_type varchar2(100);
--req_no char(17);
BEGIN
v_date_from := :ledger_para.p_date_from;
v_date_to := :ledger_para.p_date_to;
v_detail_id_from := :ledger_para.p_detail_id_from;
v_detail_id_to := :ledger_para.p_detail_id_to;
v_voucher_type := :ledger_para.p_voucher_type;
repid := find_report_object('gl_ledger');
--repid := find_report_object('REPORT80');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_online_FRHome');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no p_date_from='||v_date_from||'p_date_to='||v_date_to);
--SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
IF rep_status = 'FINISHED' THEN
/* Display report in the browser */
WEB.SHOW_DOCUMENT('http://'||:GLOBAL.G_IP||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?','_blank');
ELSE
message('Error when running report');
END IF;
END;
Regards:
Muhammad Nadeem -
How to Pass User-defined Parameters from Forms to Reports
Hi!I am trying to launch an existing report from a form then spool it into a PDF file. I have been successful in passing the report properties using SET_REPORT_OBJECT_PROPERTY built-in and I am also able to launch the report using RUN_REPORT_OBJECT built-in. My problem is, I cannot seem to pass the user defined parameters from my form to the report eventhough I am using the same variable names.
this is a part of my code:
repid := Find_Report_Object('ACPPRACS');
Set_Report_Object_Property(repid, REPORT_EXECUTION_MODE,BATCH);
Set_Report_Object_Property(repid, REPORT_DESTYPE,FILE);
Set_Report_Object_Property(repid, REPORT_DESNAME,'C:\TMP\ACS01.PDF');
Set_Report_Object_Property(repid, REPORT_DESFORMAT,'PDF');
Set_Report_Object_Property(repid, REPORT_OTHER,'PF_NBO_CD='| |'"'| |:acs.nbo| |'"');
v_rep := RUN_REPORT_OBJECT(repid);
Hope you can help me soon. Thanks!first of all u will create a paramlist
then add_paramter to this list
and then pass this list to the report
by using run_product.
i think this is all.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jenny ([email protected]):
Hi!I am trying to launch an existing report from a form then spool it into a PDF file. I have been successful in passing the report properties using SET_REPORT_OBJECT_PROPERTY built-in and I am also able to launch the report using RUN_REPORT_OBJECT built-in. My problem is, I cannot seem to pass the user defined parameters from my form to the report eventhough I am using the same variable names.
this is a part of my code:
repid := Find_Report_Object('ACPPRACS');
Set_Report_Object_Property(repid, REPORT_EXECUTION_MODE,BATCH);
Set_Report_Object_Property(repid, REPORT_DESTYPE,FILE);
Set_Report_Object_Property(repid, REPORT_DESNAME,'C:\TMP\ACS01.PDF');
Set_Report_Object_Property(repid, REPORT_DESFORMAT,'PDF');
Set_Report_Object_Property(repid, REPORT_OTHER,'PF_NBO_CD='| |'"'| |:acs.nbo| |'"');
v_rep := RUN_REPORT_OBJECT(repid);
Hope you can help me soon. Thanks!<HR></BLOCKQUOTE>
null -
How to pass parameters from Forms to Reports
dear all,
i'm running a report from a form using run_product(), now i want
to pass a parameter from a form to report, say i want to display
all the employees of deptno=10, so what parameter should i give
in run_product() and what modifications should i make in the
report???
thanks and regards
Tariq.Yeah,
You can pass parameters to from form to report using
Parameter list. E.g. You want to display all employees of Dept
10.
1. Create report with one user paramter say p_dept
2. Now Using Parameter list and Run Product you can call report,
see following procedure.
/* This Procedure passes department number as a paramter to
Report and displays Report.
Author - Mr. Adinath R. Kamode
Parameter - Deptname (p_dept)
PROCEDURE CALL_REPORT (V_DEPT IN NUMBER)
V_PLIST PARAMLIST; -
- Parameter List and Name
V_PLISTNAME VARCHAR2
(30) := 'RPTLIST';
BEGIN
-- Check existance of Parameter List
V_PLIST := GET_PARAMETER_LIST(V_PLISTNAME);
IF ID_NULL (V_PLIST) THEN
V_PLIST := CREATE_PARAMETER_LIST
(V_PLISTNAME);
IF ID_NULL (V_PLIST) THEN
MESSAGE('Error in
creating parameter list.');
MESSAGE('.');
RAISE
FORM_TRIGGER_FAILURE;
END IF;
-- Add parameter data , name must be same as in Report
ADD_PARAMETER(V_PLIST,'P_DEPT',TEXT_PARAMETER,TO_CHAR
(V_DEPT));
-- Don't display parameter Form
ADD_PARAMETER(V_PLIST,'PARAMFORM',TEXT_PARAMETER,'NO');
RUN_PRODUCT
(REPORTS,'DEPT.RDF',ASYNCHRONOUS,RUNTIME,FILESYSTEM,V_PLIST,NULL)
ELSE
DESTROY_PARAMETER_LIST(V_PLIST);
END IF;
END;
Adi -
Passing date parameter from forms to report
Hi,
I'm using forms and reports 6i.
I want to pass one date parameter from forms to reports.
Using
Add_Parameter(pl_id,'P_FROM_DATE',TEXT_PARAMETER,:FROM_DT);
giving me error REP-0091- Invalid value for parameter 'P_FROM_DATE'
This i think is because report expects date and here it is converted as varchar.
Please helpHi Divya,
Even I use this kind of statement
Add_Parameter(pl_id,'P_FROM_DATE',TEXT_PARAMETER,:FROM_DT);and works fine for me.
This i think is because report expects date and here it is converted as varchar
Correct.
Open the report in the builder and under Data Model -> User Parameters, Go to the Property Inspector of P_FROM_DATE. Under Parameter, set Datatype as Character instead of Date.
Hope this should work. and tell me if it works(coz it wokred for me). -
Graphics from Forms or Reports
When I am running graphics from forms or reports either using the chart wizard or by run_product built-in, I am getting error message OG-01603: UNABLE TO CREATE PL/SQL DEVELOPMENT ENVIRONMENT CONTEXT
I am using Developer 6i.
Please help me out.
Thanks
ZulqarnainI have tested on my pc it is perfectly working.
Please check before installations..
Is there any other oracle product is running in the same machine?
1. Are you installing Dev 6i in a machine where Oracle database(8.0 or 8i) is installed?
2.First shutdown the database. Stop the oracle services running.
3. Then start installing Dev 6i in a different oracle home. -
Forms 6i - Types of parameters, which can be passed from forms to reports?
Hello all,
Can somebody tell me about
Types of parameters, which can be passed from forms to reports?
plzzPlease ask this question in the appropriate forum for [url http://forums.oracle.com/forums/forum.jspa?forumID=82]Oracle Forms.
Regards,
Rob. -
Form call report,but form hang when report sun slowly,how to set server?
In version 10.1.2
Form call report, form hang when report sun slowly,
finally the report will done,I can see the output in the server disk,but form hang,
I think it's out of the report session, ,how to set server?
thanks for any help!
lindHello,
If you are using the "Paper Layout", check the Reports's "Before Report Value" property:
Before Report Value :
<meta http-equiv="Content-Type" content="text/html; charset=&Encoding">
If you are using the "Web Layout", take a look to the document :
http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_nls.htm#i1006142
18.3 Specifying a Character Set in a JSP or XML File
Regards -
Concatenate different reports in a single PDF file
Hi,
I need to concatenate different reports in a single PDF file.
What I want is to have a single PDF file as a result of a single URL request; but my request runs different reports having a single file as a result.
In other words, I already have the report A, B and C.
I'd want to build a new report "D" that invokes A, B and C returning a single PDF that contains A + B + C.
How can I do it? Is there a SRW function?
Thanks in advance for your help
Samuele GallazziYou can concatenate pdf's together using Ghostscript on unix. Just a bit of scripting.
-
Exporting or Printing each page of a Crystal Report to a separate pdf file.
Is there a way to export or print each page of a Crystal report to a separate pdf file? If possible, I would look to use the family nunmber field in my report as the file name. This is not required, but would be helpful. Thanks
Hello,
Standalone CR Designer doesn't have the ability but CR Server or BOE does. Or if you have a .NET or Java you could write an app that would spit out one page at a time.
Don -
Scanning from my iphone 4 and saving to PDF file on to laptop later
how can i scan from my iphone 4 and create a pdf file to store on my laptop my wireless printer is photosmart 6510
Hi,
You may scan by using the HP ePrint Home and Biz app.
Below you may find the steps to get the App:
http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02775166&cc=us&dlc=en&lc=en&product=3795314&tmp...
Set the scan as Document and it will be saved as PDF.
You may also share the scanned files from the app.
Click the Help (?) icon at the top and you will find the steps to share and access the files from your computer under the Transferring Files Wirelessly section.
Regards,
Shlomi
Say thanks by clicking the Kudos thumb up in the post.
If my post resolve your problem please mark it as an Accepted Solution -
Displaying Report name in the PDF File.
HI,
I want to print the report in the PDF format.
I executed one report and i am trying to print that report in PDF format.
But in that PDF format it is not showing any report name.
Can any body suggest me how can i get the report name in the PDF file.
Thanks in Advance.
BR
Rajeshhi suri,
chk this link..
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6dd54713-0c01-0010-8691-a3576b9a95d9
go thru these threads for more details..
Reg converting the BW report in PDF format
PDF Report
assign pts if helpful.. -
How do I prevent Adobe from taking my jpegs and making them pdf files? I have had to uninstall Adobe to access my photos as jpegs.
I would suggest you change your file associations so that jpgs open in a program other than Acrobat. Assuming you have a Windows machine, just go to the Start, and search for "file associations" ... it's part of the Control Panel.
Scroll down to the file type jpg, and set it to open with whatever graphic preview or editing program you have that you want to use as the default. From that point on, when you click on a jpg, it should not open Acrobat and instantly try to convert it to a pdf. -
Form calling Report with web.show_document caught by SSO
A 10g form button calls a 10g report via web.show_document.
In the dev environment it works, but in the full app server SSO is enabled and stops & prompts for a login/password.
I'm trying to include the SSOCONN parameter in the URL. I've tried the db userid & the sso userid without success.
Any help is much appreciated.How are you calling the report with Web.Show_Document (what's the URL you're passing)? The application I'm working on uses SSO and I call Reports from Forms and don't have this issue. You should just have to pass the return value of RUN_REPORT_OBJECT() in the URL along with the server name - at least that is how we do it. For example (bare in mind this is an abbreviated example):
DECLARE
v_rep_rtn VARCHAR2(4000);
v_repsvrname VARCHAR2 (100); /* This is a CONSTANT and used here as an example */
v_paramlist paramlist;
BEGIN
v_rep_rtn := Run_Report_Object(v_report, v_paramlist);
Web.Show_Document('/reports/rwservlet/getjobid'||substr(v_rep_rtn,Instr (v_rep_rtn, '_', -1) + 1)||
'?server=' || v_repsvrname);
v_report := Find_Report_Object('REP1');
Set_Report_Object_Property(v_report, report_execution_mode, batch);
Set_Report_Object_Property(v_report, report_comm_mode, synchronous);
Set_Report_Object_Property(v_report, report_destype, CACHE);
Set_Report_Object_Property(v_report, report_desformat, 'pdf');
Set_Report_Object_Property(v_report, report_server, v_repsvrname);
v_rep_rtn := Run_Report_Object(v_report, v_paramlist);
rep_status := Report_Object_Status(v_rep_rtn);
WHILE rep_status IN ('RUNNING', 'OPENING_REPORT', 'ENQUEUED') LOOP
rep_status := Report_Object_Status(v_rep_rtn);
END LOOP;
IF rep_status <> 'FINISHED' THEN
msg_box('Error when running report. Status = '||rep_status);
else
Web.Show_Document('/reports/rwservlet/getjobid'||substr(v_rep_rtn,Instr (v_rep_rtn, '_', -1) + 1)||
'?server=' || v_repsvrname); -- || '&authid=orcladmin/admin999');
END IF;
END;Hope this helps.
Craig...
-- If my response or the response of another is helpful or answers your question please mark the response accordingly. Thanks!
Maybe you are looking for
-
Is there a way to open a corrupted image?
I took about 80 photos with my Canon PowerShot A590 last week of very cool street art in SF. About 7 of the photos were of artists doing their work ... a one time opportunity to catch this. Later that day I looked back at those photos in the camera
-
[SOLVED] New Install of Gnome 3.2 doesn't feel like loading
Greetings, Before making this post, I have spent the majority of the day trying to solve this issue. I have switched from nvidia drivers to nouvela (sp?) drivers, incase that was the issue. I have scoured google, arch-wiki, and the forums until my ey
-
Most efficient way to track 3 states?
In a program I am writing, I have an object with three states, which it progresses through during the corse of the program. Since the program uses a lot of these objects (potentially) I want to keep the size of them down. Here's the issue. How to sto
-
Jar and classpath with space in folder name?
Hi, all. Just for fun: what if I have a jar file that is dependant on the other jar file which is placed in folder with space in its name? How would I link it in manifest file? Thanks.
-
Is Manual Wifi the best Mac Mini can do?
My Wifi keeps dropping. It works when I'm using the internet on the Mac, but if I'm not working on the Mac then after a few minutes it drops connection. My Windows PC if fine - never drops connection, my iPad is fine, my iPhone is fine - and all 4 de