Create reports within pl/sql

I would like to create a report with all of the sorting capabilities that a standard wizard generated report has, but I'd like to define the columns within a PL/SQL procedure or function. My goal is to return a set of records and for each record concatenate multiple rows from a second set of records based on each unique value from the first. But I want to present the data on one line.
For example:
query1 results
col1 = 1, col2 = A
col1 = 2, col2 = B
query2 results
col1 = A, col2=testA1
col1 = A, col2=testA2
col1 = B, col2=testB1
col1 = B, col2=testB2
col1 = B, col2=testB3
report should look like
col1=1, col2=A, col3=testA1-testA2
col1=2, col2=B, col3=testB1-testB2-testB3

I would suggest using the str2tbl function that Tom shows at http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:110612348061
and doing something like
select col1,col2,str2tbl(...)
from ...
group by col1,col2

Similar Messages

  • Creating Report via PL/SQL

    We have an application using HTML DB from which the we need to create reports for which the standard CSV will not work. The report can be created via PL/SQL except that the report needs to be created on the users workstation or a public location and not the server. Since UTL_FILE writes to the server, I am looking for help from the HTML DB and PL/SQL experts on packages/tools that can be used to output reports to local directories.

    not sure of your exact requirements, but consider using utl_file or Oracle Reports to generate your report on the server and then providing your users a "download report" link that lets them pull the file down locally. we talked about using Reports for this at...
    PDF file creation
    ...regards,
    raj

  • Create trigger within PL/SQL

    I have a procedure that creates a trigger. When I execute the procedure I get an error: ORA-01031, however, when I copy and paste the create trigger command, it executes and will create the trigger without any problems. What is causing the 'insufficient privileges' error when it attempts to create it within a procedure?
    Here is the stream of commands SQLPlus that shows what I am getting:
    SQL> CREATE OR REPLACE PROCEDURE prc_create_trigger
    2 (Table_Name in varchar2)
    3 IS
    4 v_create_trigger VARCHAR2(4000);
    5 BEGIN
    6 v_create_trigger := 'CREATE OR REPLACE TRIGGER trg_pauls_table ';
    7 v_create_trigger := v_create_trigger || 'AFTER INSERT ON ' || table_name || ' ';
    8 v_create_trigger := v_create_trigger || 'REFERENCING NEW AS newrow OLD AS oldrow FOR EACH ROW ';
    9 v_create_trigger := v_create_trigger || 'DECLARE ';
    10 v_create_trigger := v_create_trigger || ' v_text varchar2(20);';
    11 v_create_trigger := v_create_trigger || 'BEGIN';
    12 v_create_trigger := v_create_trigger || ' v_text := ''Inserted Row'';';
    13 v_create_trigger := v_create_trigger || ' dbms_output.put_line(v_text);';
    14 v_create_trigger := v_create_trigger || 'END;';
    15
    16 DBMS_OUTPUT.put_line(v_create_trigger);
    17
    18 --
    19 execute IMMEDIATE v_create_trigger;
    20 END;
    21 /
    Procedure created.
    SQL> exec prc_create_trigger('pauls_table');
    CREATE OR REPLACE TRIGGER trg_pauls_table AFTER INSERT ON pauls_table
    REFERENCING NEW AS newrow OLD AS oldrow FOR EACH ROW DECLARE v_text
    varchar2(20);BEGIN v_text := 'Inserted Row';
    dbms_output.put_line(v_text);END;
    BEGIN prc_create_trigger('pauls_table'); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "BAAN.PRC_CREATE_TRIGGER", line 20
    ORA-06512: at line 1
    SQL> CREATE OR REPLACE TRIGGER trg_pauls_table AFTER INSERT ON pauls_table
    2 REFERENCING NEW AS newrow OLD AS oldrow FOR EACH ROW DECLARE v_text
    3 varchar2(20);BEGIN v_text := 'Inserted Row';
    4 dbms_output.put_line(v_text);END;
    5 /
    Trigger created.
    I am wanting to do this because I need to create this trigger dynamically when a table has been created. This trigger is simply for testing the procedure.
    Thank you for your assistance.
    Paul

    Why does the application need to drop and re-create tables in the first place? What is the purpose of this "re-org"? If it accomplishes anything useful, it's likely that there is some flaw in the application architecture/ design/ implementation that could be fixed once to remedy whatever problem this drop & rebuild option attempts to solve. If there really is a need to reorganize a table regularly, could the application at least be modified to use one of the various approaches Oracle provides for this sort of thing?
    The "re-org" process you're describing is, at best, a hack. A trigger on the TABLES_TO_BE_REORGED table that creates triggers on whatever table name was deleted from this table is, at best, a hack. Layering one hack on top of another is likely to cause lots of pain.
    For one thing, a trigger cannot commit. But DDL implicitly commits before and after the DDL is executed. So you cannot create a trigger within another trigger. You could have a trigger that creates a job that later runs and creates the new trigger, but that's adding an extra layer of asynchronisity to a problem that is already likely over-engineered. You could also declare the trigger that creates the trigger to be an autonomous transaction, but that would cause horrible problems if the re-org process ever were to encounter and exception and have to roll back.
    Justin

  • Problem with creating report in pl/sql

    hi all
    i'm doing a report which fetch from 8 column
    i did something like this :
    set pages 132
    set lines 150
    set und =
    set spa=5
    set feedback off
    set newpage 0
    the column which i select has an alias for the headlines like this
    select tvia_num "NUMBER OF TVIA",name_e "EMPLOYEE_NAME
    and so on form the 8 column
    the problem is that some of the alias are get cut in the middle
    like this NUMBER instead of NUMBER OF TVIA
    the max size of the page is 132 characters
    can someone please help me ?
    best regards

    COLUMN "NUMBER OF TVIA" FORMAT A15
    Replace A15 with the column width.
    By
    Vamsi Kasina

  • Creating a PDF-File from a report within a service

    Hello,
    I have to create PDF-Files from a report within a windows service.
    My source is as follows (quick and dirty) using Microsoft Report Viewer 2012
    Imports Microsoft.Reporting.WinForms
    Dim reportViewer1 As New Microsoft.Reporting.WinForms.ReportViewer()
    Dim objRDLC As New Microsoft.Reporting.WinForms.LocalReport()
    reportViewer1.LocalReport.ReportEmbeddedResource = "MyApplication.MyReport.rdlc"
    Dim deviceInfo As String = "<DeviceInfo>" & _
    "<OutputFormat>PDF</OutputFormat>" & _
    "<PageWidth>21cm</PageWidth>" & _
    "<PageHeight>29.7cm</PageHeight>" & _
    "<MarginTop>0.7cm</MarginTop>" & _
    "<MarginLeft>0.7cm</MarginLeft>" & _
    "<MarginRight>0cm</MarginRight>" & _
    "<MarginBottom>0cm</MarginBottom>" & _
    "</DeviceInfo>"
    objRDLC.DataSources.Clear()
    'Fill Report with data
    reportViewer1.LocalReport.DataSources.Clear()
    reportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("dsInfo", dt))
    reportViewer1.RefreshReport()
    'Output Report as File
    Dim byteViewer As Byte() = reportViewer1.LocalReport.Render("PDF", deviceInfo)
    Dim newFile As New FileStream("MyFileName", FileMode.Create)
    newFile.Write(byteViewer, 0, byteViewer.Length)
    newFile.Close()
    'Clean up
    newFile.Dispose()
    objRDLC.DataSources.Clear()
    objRDLC.Dispose()
    reportViewer1.Dispose()
    In most cases everything works fine.
    But the service crashes after some/many reports (e.g. after 270 reports or after 1.400 reports). There is no fix number of reports that causes the service to crash.
    The service crashes with the following error:
    System.ComponentModel.Win32Exception (0x80004005): Fehler beim Erstellen des Fensterhandles.
       bei System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
       bei System.Windows.Forms.Control.CreateHandle()
       bei System.Windows.Forms.Control.get_Handle()
       bei System.Windows.Forms.Control.PointToScreen(Point p)
       bei System.Windows.Forms.ToolStripItem.TranslatePoint(Point fromPoint, ToolStripPointType fromPointType, ToolStripPointType toPointType)
       bei System.Windows.Forms.ToolStripDropDownItem.DropDownDirectionToDropDownBounds(ToolStripDropDownDirection dropDownDirection, Rectangle dropDownBounds)
       bei System.Windows.Forms.ToolStripDropDownItem.GetDropDownBounds(ToolStripDropDownDirection dropDownDirection)
       bei System.Windows.Forms.ToolStripDropDownItem.get_DropDownLocation()
       bei System.Windows.Forms.ToolStripDropDown.GetDropDownBounds(Rectangle suggestedBounds)
       bei System.Windows.Forms.ToolStripDropDown.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       bei System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       bei System.Windows.Forms.Control.set_Size(Size value)
       bei System.Windows.Forms.ToolStripDropDown.AdjustSize()
       bei System.Windows.Forms.ToolStripOverflow.OnLayout(LayoutEventArgs e)
       bei System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
       bei System.Windows.Forms.Control.PerformLayout()
       bei System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
       bei System.Windows.Forms.Control.ResumeLayout()
       bei System.Windows.Forms.ToolStrip.OnLayout(LayoutEventArgs e)
       bei System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
       bei System.Windows.Forms.Control.PerformLayout()
       bei System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
       bei System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       bei System.Windows.Forms.TextBoxBase.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
       bei System.Windows.Forms.ToolStripControlHost.OnBoundsChanged()
       bei System.Windows.Forms.ToolStripItem.SetBounds(Rectangle bounds)
       bei System.Windows.Forms.ToolStripItem.set_Width(Int32 value)
       bei Microsoft.Reporting.WinForms.ReportToolBar..ctor()
       bei Microsoft.Reporting.WinForms.ReportViewer.InitializeComponent()
       bei Microsoft.Reporting.WinForms.ReportViewer..ctor()
       bei DC5Warteschlange.clsReportTools.Druck(DataTable dt, String Reportname, String ReportDataset, String Drucker, String Format, String Datei)
       bei DC5Warteschlange.clsInfoQueue.Snotiz(String[] CallIDs, String Speicherort)
       bei DC5Warteschlange.Imail.InformationMailSenden(Int32 AID, DataTable& tmpDT)
    Thank you very much....
    Gernot

    Unfortunately, it is not a piece of code that I can send. The SQL would be embedded inside Oracle Reports tool, and you would have the option to save the output of the report in PDF format.
    Once you have the Oracle Report developed, you can execute it from command line prompt and save the output to a pdf file. In your case, the cursor would be embedded inside Oracle Report
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers

  • Create a report with PL/SQL

    Hi,
    I have two pages: the first page contains two text fields and a submit button. In the first text field you can enter a name and in the second field you can enter a number. That means you can search a record by name or by number.
    In the second page the report is generated depending on the used text field of the first page.
    I tried to to define a region source code with PL/SQL for the report, but nothing appears on the report page although the record I was looking for exists in the database.
    begin
    if :ENTERNAME IS NOT NULL then
    FOR item IN (select "TB_PERSON_INSTITUTION"."PI_ID" as "PI_ID",
    "TB_PERSON_INSTITUTION"."PI_NAME" as "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" as "PI_VORNAME",
    from     "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    where      upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:ENTERNAME||'%'))
    loop
    DBMS_OUTPUT.PUT_LINE('First name = ' || item.PI_NAME ||
    ', Last name = ' || item.PI_VORNAME);
    end loop;
    end if;
    end;
    Regards
    Mark

    Hi,
    ok thanks. I tried to use the SQL-Report with type "SQL Query (PL/SQL function body returning SQL-Query)" and made a few changes in the SQL-Statement so that a second table is also included:
    declare My_select varchar2(500);
    begin
    if :TEXTEINGABENAME IS NOT NULL then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:TEXTEINGABENAME||"%")';
    else
    if :TEXTMITGLIEDSNUMMER is not null then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER") like upper(:TEXTMITGLIEDSNUMMER||"%")';
    end if;
    end if;
    return My_select;
    end;
    When I try to apply changes an error message occurs:
    "Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
    Regards,
    Mark

  • Dynamic SQL for creating report in portal

    Has anyone had to create report in Portal using dynamic sql. That is you build up the query commands depending on the parameters entered by the user.
    E.g the columns displayed will be what the users has selected in the parameter form.
    Urgent reply please,
    Femi

    Hi,
    You can use SQL based reports to do this. The report should have a bind variable. The bind variable is used for the users to enter their values and query is built using the value in the bind variable. The user should enter the value of the bind variable from the customization screen.
    Here is an example
    select * from scott.emp
    where deptno = :vdept
    Here vdept appears in the customization screen and user should enter a value for this and run the report.
    Thanks,
    Sharmila

  • Creating reports in BI EE from PL/SQL query

    Please provide me solution of how to create reports in Oracle BI EE tool while using PL/SQL query block.
    Thanks
    Rajni Sharma

    Narender Singh wrote:
    Dear All,
    We are using Oracle APPS, we have two tier structure.I bet it is actually 3-tier & WebServer exists
    1) Application Tier
    2) Database Tier
    My requirement is to run a PL/SQL script to create directory structure in Unix box of Database Tier. I would be very grateful to person proving the input related to the same.
    I want to create directory structure to store different type of files.
    /usr/tmp/2000/jan/file1
    /usr/tmp/2000/jan/file2
    /usr/tmp/2000/jan/file3
    /usr/tmp/2000/jan/file4
    similarly, I have to create directory structure from year 2000- 2011 and for each year I have to 12 folder for months and then for each month I can have n number of file folders.
    We are using 11g database.
    Thanks in Advance!!
    Regards,
    Narender
    Edited by: Narender Singh on Aug 9, 2011 10:50 AMDBMS_SCHEDULER that invokes OS shell script

  • Problem for create report by sql query under Protal!

    I'm trying create report by sql query method, however it came out the error:
    ORA-00918: column ambiguously defined (WWV-11230)
    Failed to parse as SENTRYDB - select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' ) as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid from pnames t1, people t3, groups t4 where t3.persongroup = t4.groupid and t1.personid = t3.personid order by rowid (WWV-08300)
    Error: Unable to execute query (WWV-10201)
    The query is :
    select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' )
    as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid
    from pnames t1, people t3, groups t4
    where t3.persongroup = t4.groupid
    and t1.personid = t3.personid
    I have no problem to run that query under sqlplus!

    Hi,
    I'm cuurently using the portal inside of 9iAs 1.0.2.2.2a. What version of that Portal? By the way, how can I find out the version of Portal that I using? And also can I display image inside of report which created by Portal? I tried statement:
    select
    '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg',
    owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' stu_pic,
    from stu
    However, it doesn't work. It came out error:
    Unable to describe SQL statement. Please correct it (WWV-13010)
    Invalid SQL statement: select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-13005)
    ORA-01001: invalid cursor (WWV-11230)
    ORA-00904: invalid column name (WWV-11230)
    Failed to parse as SENTRYDB - select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-08300)
    Do you know why?

  • Hi, I would like to create a database from my numbers spreadsheet and create reports (like SQL). Is there a way?

    Hi, I would like to create a database from my numbers spreadsheet and create reports (like SQL). Is there a way?

    Numbers is a lightweight spreadsheet.  If you know sql you will know that it can handle many queries and is a real databases that can handle many thousands of records.  Number is not the correct tool.  You can make something that does something like a query but it is not truly a query.
    Can you share anything about the specific application and how much information there is in each record?  How many records (rows)?

  • Creating a PDF report within a popup window

    bq. Hi, \\ Within my application i've a page which uses JasperReports to generate a simple PDF report within prerender(): \\ public void prerender() { \\ try { \\ this.planned_bar_tripsDataProvider1.refresh(); \\ if (this.planned_bar_tripsDataProvider1.cursorFirst()) { \\ getApplicationBean1().*jasperReport* \\ ("PlannedBarTripsReport", "application/pdf", \\ getSessionBean1().getPlanned_bar_tripsRowSet1(), null); \\ } \\ } catch (Exception ex) { \\ log("Exception generating report", ex);} \\ } \\ jasperReport() is taken from the Sun PDF tutorial (http://developers.sun.com/jscreator/learning/tutorials/2/reports.html) \\ Now, when this page is opened within the application (browser) window the PDF report successfully renders. \\ However, when the page is opened within a popup window, using the (onclick) Javascript function: \\ function generateReport() { \\ window.open('PlannedBarTripsReport.jsp') ; \\ window.event.returnValue = false; \\ } \\ the PDF report fails to render. The result is a brief pause followed by a blank popup. No exception. No Abobe embedded window. No clues as to what's gone wrong. \\ Any advice would be greatly appreciated. \\ Ta.

    Hi Venkatv and everyone.
    This is the link where I found about Including Dynamic Images in a Report.
    http://www.oracle.com/technetwork/testcontent/apexprnt2-otn-098981.html
    It's so easy and clear to do.
    Good Luck!!!
    Regards.
    Ayrem

  • Need advice on how to create report

    I'm not sure how to do this, so I'm asking advice from the apex gods...
    here is the issue, I have two tables that I need to combine info from. not an issue in its self. I can do that. but here is the issue. in Table A I have some data like disc_id, title, theids, etc.. Table B contains fullname, theid, emplid
    now in table A the column 'theids' is populated from apex as a multi select list. so the values in the column is something like 48;3;88
    it got these id numbers from the Table B query (lov popup) that returns theid of the person chosen.
    now I have to create a report that will be used in a excel download and what they want is one line per disc_id and they want the more useful 'emplid' in the field where 'theids' are at. that is instead of :
    disc_id Title theids
    101 Test 48;3;88
    they want:
    disc_id Title Theids
    101 test N33456,N3457,N43562
    so I'm kind of stuck, I can figure out how to write a sql using instr to get something like this:
    101 test N33456
    101 test N3457
    etc
    but that is not what they want. so I'm thinking I need to create a package to do this and return some sort of values. the problem is I can't figure out how I can substitute the 48;3;88 for N33456,N3457,N43562
    I'm still new at this pl/sql and apex stuff so sorry if this seems to have some obvious answer.

    I might be dense so forgive me on this, but I don't think that will solve it.
    your example uses field from apex, like :P3_SOME _VALUE
    this report screen has no fields. there are no :P#_ type values to pull. I'm writing a report screen using a report template.
    all the data I need for the report exists within the table. I just need to display it the way they want.
    I could do just a:
    select *
    from my_table
    and it would create the report just fine. the only issue is one of the columns would have 48:3:88 in the field. which to a person reading the report means little. so i have no apex fields to pull.
    I was trying to write a pl/sql function that would substitute those delimited values with meaningful data. but when I do I get multiple rows and I can't have that. so my choices so far I see are..
    1) create the report with a simple select leaving the data as is
    2) create report that has multiple rows of data where each instr value now has the correct names (some have 2 some have 5, big list to read of dups)
    3) create a package that populates a temporary table with the data I need then select on that table to get the report.
    right now I'm thinking #3 is the only way to get what I want. By the way your examples would be a great help in doing that I can already see that I can use some of them to create a temp table with that data.
    what I was hoping for was some option that I don't understand or missed that a more experienced person would know. but its looking grim.
    I thank you all the info you have given, its been a great deal of info that I can use at some point, but so far I don't think it will solve my issue.

  • Generating reports from PL/SQL

    I'm new to the world of BI Publisher - so far I'm impressed with what I've seen. I've managed to create a report and an RTF template and generate some nice looking PDF's :)
    What I need to do now is to have a nightly job that produces PDF shipment reports using my template for all new shipments generated during the day and I'm having a little difficulty putting it all together.
    I've looked at the BI Publisher API's that allow me to generate an XSL from my RTF template and the using the FO engine merge the XSL and XML data to produce the PDF. Then using the delivery manager API's I can send these reports out via email.
    I'm a little unsure of how to get the XML source - I've played around with the DataEngine API to generate XML from a SQL query so I think that's where I should be heading.
    Does this all sounds right ? Ideally, I want to be able to do all of this from within a scheduled PL/SQL job every night but all the interaction with the BI server seems to be via Java.
    Is there an easy(ish) way to run all of this from within PL/SQL ?
    And should I be going about this by:
    1/ generate XML data using dataengine API
    2/ create an RTF template using word and the xml data generated above
    3/ use the RTF processor to generate an XSL-FO from my RTF template
    (1-3 will only need to be done once)
    4/ Then my nightly job will use the dataengine to generate new shipment XML data
    5/ use FO processor to generate PDF's from each
    6/ use delivery manager API's to email out
    All sounds very cumbersome and intense -is there no easier way ?! :) Also, I'm thinking i should be using the bursting engine to split one query containing all the new shipment data and generate/mail a PDF for each shipment ? Is that necessary if all going to the same email address ?
    Help/guidance/suggestions greatly appreciated !
    Many thanks,
    Brent

    repost .... Has anyone successfully called BIP web services from within the database using Java stored procedures ?
    Still struggling to work out how to generate my reports from PL/SQL ! :((

  • Exception reports within SAP

    I am looking for any information on built-in exception reports within SAP, do these exist? The company I work for typically runs custom reports to identify duplicate payments, receiving errors, missed opportunities based on payment terms, etc. These reports are generated outside SAP. I have been able to use screen MB5S (GR/IR Balances) to isolate over received purchase orders, but I am interested to learn more about the tools that are built into SAP. Any help is appreciated!

    Hi.......
    Welcome to SAP Business One Forum.......
    You can not get the query for inbuilt reports.
    But for some of the reports saved in Query manager by System you get.
    But i would suggest you to create your own SQL queries.....
    More beneficial to you.......
    Regards,
    Rahul

  • XML Publisher Report with PL/SQL

    Hi
    Like to know how to develop the XML Publisher Report with PL/SQL, i did the following
    1. created a pkg like as below
    CREATE OR REPLACE PACKAGE BODY APPS.TEST_XMLTAG_PKG AS
    PROCEDURE main (errbuf OUT VARCHAR2,
    retcode OUT NUMBER
    ) IS
    BEGIN
    DECLARE
    ctx DBMS_XMLGEN.ctxHandle;
    xml CLOB;
    BEGIN
    ctx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    END;
    END;
    END TEST_XMLTAG_PKG;
    this pkg produces the output with xml tag in the view log.
    I have registered the conc program & xml rtf but it does not produce the output in PDF, , I am not able to get the xml tag when i click the Diagnostics --> View XML.
    can you please let me know the next steps involved.
    Regards
    Yram

    I think the problem is because there is no begin and end tag. save the xml from the logfile and open with xml editor or IE.. then you will see the problem.
    add Begin and end tag...then you should be fine.. i.e
    fnd_file.put_line(fnd_file.output,'<EMP_DATA>'); -- begin Tag
    tx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    fnd_file.put_line(fnd_file.output,'</EMP_DATA>'); -- End Tag
    Hope this helps..>Good Luck
    Ravi

Maybe you are looking for