How to generate a report in pdf from a stored proc
Hi, i need guidance on how to generate a report in pdf from an oracle stored proc.
The environment is oracle 10gas + 10gdb.
On a specific event, a PL/SQL stored procedure is called to do some processing and at the end of the processing to generate report which has to be sent to the printer (and optionally previewed by the user).
Can anyone assist me with this?
Hi ,
One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
Read for further info in 'PL/SQL Packages and Types Reference'.
If you have access to OEM ... you can configure this there using wizard.....
Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
My greetings,
Sim
Similar Messages
-
How to generate jasper report in pdf format using swing
hi all,
im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
1)delegate:
public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
return generateReportDto;
2)sessionBean:
public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
//Map parameters = new HashMap();
ReportManager reportManager = new ReportManager();
3)ReportManager()
public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
Connection conn = null;
try {
conn = dataSource.getConnection();
//Generate the report to bytes
File reportFile = new File(fileName);
byte[] bytes =
JasperRunManager.runReportToPdf(
reportFile.getPath(),
parameters,
conn
//conn.close();
//Write the bytes to a file
ByteBuffer buf = ByteBuffer.wrap(bytes);
File file = new File(outputFileName);
// (if the file exists)
boolean append = false;
// Create a writable file channel
FileChannel wChannel = new FileOutputStream(file, append).getChannel();
// Write the ByteBuffer contents; the bytes between the ByteBuffer's
// position and the limit is written to the file
wChannel.write(buf);
// Close the file
wChannel.close();
} finally {
if (conn != null) {
conn.close();
Any help would be highly appreciated. Thanks in advanceHi ,
One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
Read for further info in 'PL/SQL Packages and Types Reference'.
If you have access to OEM ... you can configure this there using wizard.....
Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
My greetings,
Sim -
How to trigger a report based on a event/stored proc or sql dts completion
Post Author: Crystaldev
CA Forum: Publishing
I want to run/trigger a crystal report based on file existence or based on a stored proc/sql dts/a value present in a sql table. The way I want to do is schedule a crystal report in crystal enterprise and then run the report based on a event like file existence or based on a sql dts completion or a value existence in a sql table. We are using crystal reports v10.
I am not sure how we can do this, any help is appreciated. Thanks.Hi
When you click on View Data, at bottom click on Edit button
It will prompt a connection details tab wherein you can view and modify the connections
Nik -
How to generate custom report with PDF output?(Payables)
Hi All,
we are using some custom reports in payables modual production server the reports are working fine .
my question is i need creat same reports in test server i have done following activities.
1. copied rdf file from prod server and pasted into test server
2.given excutable name in system administrator modual(concurrent-progrem-excutable)
3.define report in system administrator modual(cocurrent-program-define) output selected PDF and given parameters.
4. switch to payables moduale run the report ,following error showing in log file plese help how to resolve it we don,t have any custom reports in test server this is first time to creat the report.
APPLLCSP Environment Variable set to :
XML_REPORTS_XENVIRONMENT is :
/APPS/dkvuatora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
XENVIRONMENT is set to: /APPS/dkvuatora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
American_America.UTF8
Spawned Process 2707514
X connection to oraclefinof1:0.0 broken (explicit kill or server shutdown).
Report Builder: Release 6.0.8.25.0 - Production on Wed Nov 18 16:06:17 2009
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Enter Username:
Start of log messages from FND_FILE
End of log messages from FND_FILE
Program exited with status 1
Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 339487.
Review your concurrent request log and/or report output file for more detailed information.
Executing request completion options...
Finished executing request completion options.
Concurrent request completed
Current system time is 19-NOV-2009 16:24:52
---------------------------------------------------------------------------Hello.
Have a look to Metalink Doc ID 252715.1
You have to login to server and issue the 'xhost +' command.
Hope this helps.
Octavio -
How to generate a new predefined PDF from certain form data?
Hi,
I want to create a form (in either Word or PDF) with diffrerent sections for people to fill out. I then want them to easily turn some of the data from the form into a new predefined PDF template.
For example, I have created a case study form for academics to complete. Then i'd like them to be able to generate an actual case study that they can distribute. The case study will be a predefined template that only needs to contain certain data from the form. Some of the sections on the form will be for internal purposes only.
How can i do this? I have Abobe Pro, but not everyone does.
Thanks
KellieThis type if thing is fairly easy to do for people who have Acrobat since the form data can be readily exported from one PDF and imported into another, but this isn't an option with Reader. There are methods you can use to easily copy data from one form to another with Reader, but it relies on JavaScript programming in both of the forms. If this sounds like something you want to pursue, post again and I can provide some guidance.
-
How to generate a report direct in PDF with oracle developer 6i
hi all
Please help me about this issue.
THAT How to generate a report directly in PDF using oracle developer 6i.
Regards
Yousuf Ahmed SiddiquiHi,
You can create the Report directly in PDF by setting some of the Report Parameters
i.e. DESTYPE, DESNAME AND DESFORMAT as follows before calling the Report.
DECLARE
PL_ID PARAMLIST;
PL_NAME VARCHAR2(10) := 'param_list';
BEGIN
PL_ID := GET_PARAMETER_LIST (PL_NAME);
IF NOT ID_NULL (PL_ID) THEN
Destroy_Parameter_List(PL_ID);
END IF;
PL_ID := Create_Parameter_List(PL_NAME);
Add_Parameter (PL_ID, 'DESTYPE', TEXT_PARAMETER, 'FILE');
Add_Parameter (PL_ID, 'DESNAME', TEXT_PARAMETER, 'c:\test.pdf');
Add_Parameter (PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'PDF');
RUN_PRODUCT (REPORTS, 'REPORT_NAME', ASYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);
END;Hope this helps.
Best Regards
Arif Khadas
Edited by: Arif Khadas on Apr 22, 2010 9:24 AM -
How to get a report in pdf format.
Hi Experts,
Could any one let me know that, how to get the report in PDF format.
Once a report is generated it should be displayed in pdf format or downloaded in pdf format.
Thanks in Advance,
Regards,
Irfan HussainHi,
Check out this code:
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
* Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
* Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
* Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
* Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
*** Alternative way could be to submit another program and store spool
*** id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
* to sap-spool
* spool parameters %_print
* archive parameters %_print
* without spool dynpro
* and return.
* Get spool id from program called above
* IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
* FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
* FORM get_job_details *
FORM get_job_details.
* Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
* FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
* Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
* FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
Regards,
Gayathri -
How to generate my report in HTML format
Hi
I am using Forms and reports 6i . How to generate a report in Html format.
Please explain what are the option available in reports and the way to do
thanks in advance
prasanth a.s.*specify desformat=html in cmd line
refer
* Forms Reports integration 6i
http://otn.oracle.com/products/forms/pdf/277282.pdf
[ All Docs for all versions ]
http://otn.oracle.com/documentation/reports.html
[ Publishing reports to web - 10G ]
http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
[ Building reports - 10G ]
http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
[ Forms Reports Integration whitepaper 9i ]
http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
--------------------------------------------------------------------------------- -
How to generate classical report
Hi guys,
I need a help from you. how to generate classical report can you guide me please.
Thanks guys.Vijay,
To generate a report, follow the steps below
1) Determine the desired output for End-user
2) Based on the desired output, write a program with data declarations for all the variales u will display in the report
3) Write extraction routines to fetch data from the DB tables
4) Read extracted data and bind the data for final output
5) Output data
here's a simple example for your ref
report ztest.
Table declaration
data: it_mara type table of mara with header line.
SELECTION SCREEN
parameters: p_matnr like mara-matnr.
start-of-selection.
select * from mara into table it_mara where matnr = p_matnr.
end-of-selection.
loop at it_mara.
write: it_mara-matnr, it_mara-mtart, it_mara-mbrsh.
endloop.
reward if helpful,
Karthik
Message was edited by:
Karthik -
How to generate interactive report in alv
hi,
how to generate interactive report in alv,for this what are the requirements,
give me one sample report.
thankyou.Hi,
Chk these helpful links..
ALV
http://www.geocities.com/mpioud/Abap_programs.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Go thru these programs they may help u to try on some hands on
ALV Demo program
BCALV_DEMO_HTML
BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
BCALV_GRID_DEMO Simple ALV Control Call Demo Program
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO
BC_ALV_DEMO_HTML_D0100
Regards
Anversha -
How to generate a report in Excel with multiple sheets using oracle10g
Hi,
I need a small help...
we are using Oracle 10g...
How to generate a report in Excel with multiple sheets.
Thanks in advance.
Regards,
RamThanks Denis.
I am using Oraclereports 10g version, i know desformat=spreadsheet will create single worksheet with out pagination, but my requirment is like the output should be generated in .xls file, and each worksheet will have both data and graphs.
rdf paperlayout format will not workout for generating multiple worksheets.
Is it possible to create multiple worksheets by using .jsp weblayout(web source) in oracle reports10g. If possible please provide me some examples
Regards,
Ram -
How to generate a report based on account description
Hi Experts,
How to generate the report based on account description, that means
i want to generate a report on G/L account and which account numbers are having 'CASH' description.
for Ex: G/L a/c no: 25010026-Cash and Bank balance(des)
G/L a/c no: 101000-Cash-freight
like this.
please help to do this,
good answer will be appreciated with points,
Thanks in advance
VenkatHi shana,
my requirement is
I have G/L account numbers, that account numbers having some descriptions, in these some descriptions are belongs to cash transactions, i want to generate the report on these cash transactions, and the report is " G/L account, debit cash, credit cash, balance".
is it possible or not,
thanks in advance,
Venkat -
How do I convert emails to PDF from Outlook to make a file on the PC?
how do I convert emails to PDF from Outlook to make a file on the PC
It is always tough for anyone when we need to save our emails into one file for future reference. You could either do it manually or can use a simple tool to Convert all your messages into one pdf file . This Single pdf file can be used if we need to read any past email. you can easily convert oulook to pdf in no time. If you are converting several email messages, you can either save them as separate files with initial layout fully intact or combine them into one big PDF document.
-
How to generate addm report using grid
Hi,
how to generate addm report using grid, please provide any relevant doc/links etc.
Thanks in advance.how to generate addm report using grid, please provide any relevant doc/links etc.When you start with the wrong question, no matter how good an answer you get, it won't matter very much.
what is best way to divide board into 2 pieces using a hammer?
Edited by: sb92075 on Oct 25, 2010 7:22 AM -
How to generate an OUTBOUND INVOICE IDOC from the ABAP Program?
How to generate an OUTBOUND INVOICE IDOC from the ABAP Program? Any Function Module that can be used for this?
Hi
This is more of configuration
(1) Create a Output type with Medium 6 ( Check with your functional consultant)
(2) Maintain Partner Profiles using WE20 transaction
Idoc type - INVOIC02
Message type - INVOIC
Process Code - SD09
Regards
Madhan D
Maybe you are looking for
-
APP-FND-01050: This flexfield cannot be opened because it has no displayed
Hi, I am new to Oracle EBS R12.I created a profile and assiged "Indian HRMS Manager" when i try to select Respnsibilities->work structure:Grade->Description I got the Error APP-FND-01050: This flexfield cannot be opened because it has no displayed se
-
Rejecting a BPF step:Planner to be notified
Hi everybody, Is there a way by which a planner can be notified that the reviewer has rejected his step via BPF? We can have email notifications set up for completion as well as a change in status.However i dont see any standard way by which a planne
-
Copy paste from pdf without the formatting
I've never understood how to copy and paste from pdf to word without getting the line return characters which mess up the formatting. Why doesn't text flow from line to line as it does in a normal word processor? Why does adobe insist on copying the
-
hello all, i am working on a scenario where i need to send an idoc from my r/3 system to xi process it and store it in application layer folder of XI. i am able to see the idoc xml in message monitor also. but i am getting a error message "<SAP:Sta
-
ME51N - Account Assigment Category Value
Hi All, My need is, While creating purchase requisition (ME51N) based on purchase requisition type ( combo box value ) in Line Item Account assignment category value should be defaulted. How can i achieve this? Points will be rewarded Thanx in advanc