Shared Components APEX Report Query and Layout

Does anyone know how to call the report query and layout from the Shared components section from a page within the application?

mtbdude40 wrote:
What I need is this:  The ability to create a PDF report with a custom header defining the data (example - select * from emp where deptno = :deptno and the header includes the department name).
I use this white paper as my source:  http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf
You need to build and use a Shared Resource -> Report Queries.
The Report Query will have two queries associated with it (see below).
one query will be for the header information, the other will be for the data.
use the "download" of the "xml data" as your source for Altova/other tools.
If you add/remove/change queries, You'll have to redo your report (from scratch) as that changes the XML Schema required. (at least, with my experience)
Once you get the hang of it, 2x queries is easy (Header, data)
I've experimented with 3x queries (header, master,details) but have been unsuccessful.  I have some ideas though ("link" master->detail info via XPath stuff within Altova) but haven't gotten around to testing it.
If you want to run the report for multiple departments....That might require some finesse.
Unfortunately, the Source of the Queries can't be a scalar SQL that returns 1 row of 1 column of data type XMLType....
MK

Similar Messages

  • Creating a print button to call a Report Query and pass filters

    If i use the REPORT QUERY option in APEX 4 to create an statement that is the same one used in an interactive report, can I create a link or button to the REPORT QUERY and pass all the session and filter information from the interactive report to the report query?
    This way I can have the interactive report screen where the user can do all sorts of modifications and such and then pass those to the REPORT QUERY so I can call that from a custom link or button.
    You may ask "why does he need another print button?"
    Answer: I am using a view that has some embedded HTML tags to format the output really nicely. The HTML download version created by the interactive reports works beautifully. The customer also wants a PDF version (meh) which does not render the HTML tags and actually echos them as part of the text. I found that I can create another view that uses the CHR function to create all the breaks and such I was doing with HTML and these do render properly in PDF. So, I figured just have 2 reports: 1 Interactive and 1 using a REPORT QUERY. I just want to call the REPORT QUERY version but use the Interactive Search form to set all the parameters.
    Or, am I over thinking this and there is an easier method?
    I made a previous post where I showed how I got the APEX printing to work and i hoped that helped someone out - fixing this issue would put the whole thing to rest.
    Thanks

    Is BI Publisher desktop (MS Word add-in) a possibility? This would allow you to use MS Word to create your output template (RTF) that would result in a properly formatted PDF. Of course, you'd have to right an updated version of the query without HTML embedded. Just thinking outside of the box.

  • XSL-FO Report Query / Named Layout - Dynamically set the output filename

    Does anyone know if it is possible to dynamically set the name of the PDF file which is created via FOP?
    Thanks
    Paul

    John
    Thanks for the quick reply, apologies, I should have been more explicit.
    I am calling apache FOP via a report query and a named column layout using xsl-fo to format the PDF report.
    The call is done via a javascript function which determines which report to print and then submits the approproate REQUEST. The request is picked up by conditional branches and calls the PRINT_REPORT
    The PRINT_REPORT names the PDF file as same as the report query name.
    BTW the long term goal is to store the resultant output as a blob back in the database but I can put that off to phase II of the project as I'm not sure that this is possible. Would be nice though!
    Thanks
    Paul

  • Passing Parameters to a report query

    I have built a report query, the query has 3 parameters.
    select * from EMP_DETAIL
    where
    emp=:EMPP
    and loc=:LOCP
    and seq=:SEQP
    When I test the query, enter the parameters manually, it renders and I get my report.
    When I add this layout to a standard on screen report region, I can not figure out how to pass the column values to those parameters.
    I'll try to explain. I have a report
    SELECT * FROM EMP
    The users can filter the report down, then when they find the emp they want, I have created a report link that is supposed to run the detail query and have the detail report come up in a PDF.
    So lets say they choose employee 0009, the columns have the :LOCP and the SEQP
    I want the report query for the PDF print to be filled in and the report rendered and printed. Like I said, I can test the report query/layout from the shared components section but I can not get the column values of say #EMP#,#LOC#,#SEQ# passed to the report.
    When I click the report, it appears to run forever. I do not know what is being passed to the report query.

    Starting to wonder if my question doesn't make sense.
    Does not seem to be something that hard.
    I have a APEX 3.0 stored report query and layout loaded via the shared components section. The stored report accepts 3 parameters.
    I have an employee report region (Select * from emp) and I have a derived link column that has a pretty picture in it. What I want to happen is when the users naturally migrate towards the bright colors on the screen in front of them and peck away at the mouse button, the values of the corresponding 3 columns are passed to the stored report and the report is ran and a PDF pops up and surprises the little buggers... sorry users that they actually managed to do something other than whine.
    Ideas, any takers?
    Maybe I will have to start a new thread with subject of
    "PLZ HELP MZ URGENT!!!!!! PLZ PLZ "
    or
    "ORACLE IS STUPIDO!!!"
    Those seems to get a lot of replies, some even helpful :)

  • Report Query wizard error (in Shared Components)

    I have been following the <a target="_window" href="http://www.oracle.com/technology/products/database/application_express/howtos/howto_master_detail_pdf.html">How-To Create a Master-Detail PDF Report</a><br>
    <br>
    I'm using Apex 3.01 and Firefox 2.0.0.7<br>
    <br>
    When I have to create a Report Query in the shared components, I get through the wizard to the Create Report Query Layout page and for some reason, the Previous and Next buttons don't work. The only button that works is the Cancel button.<br>
    It seems to happen after I've downloaded the sample XML file from that page.<br>
    I've also noticed this happens when you go in to edit an existing Report Query and take a download of the XML...<br>
    On closer inspection it seems to be the buttons that have onclick="javascript:doSubmit..." behind them that don't work. Buttons with javascript:confirmDelete seem to still be active and work ok.<br>
    <br>
    But, the problem doesn't happen in IE7.<br>
    <br>
    I found this happened on both my local installation and on my apex.oracle.com instance.<br>
    <br>
    Has anyone else had this behavior or is this some dodgy local setting I have wrong?<br>
    <br>
    Gus..<br>

    Hi,
    This is posted in the wrong forum. This forum is for Oracle Berkeley DB. Please find the correct forum and post your question there.
    Regards,
    Alex Gorrod,
    Oracle Berkeley DB

  • Query to list out shared components and page number that used them

    Hi all,
    I created report queries and report layouts under apex shared components for BIP printing purpose. To match them correctly, I always make sure query and layout files have the same name.
    But as the nubmer grew, I like to know if there is a systematic way to query out the queries and associated layout files plus the page number that have print buttons point to these shared components. Can you help ?
    Thanks
    Munshar

    Hi Munshar,
    you can use APEX Views to query this information.
    To get an overview on what Views are available go to Application Builder and choose "APEX Views" from the right sidebar.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at and http://www.wirsindapex.at

  • Bind Variables and Shared Component Report Query

    I have a query in a region report which I have replicated to a shared component report query.
    Both queries reference page items as bind variables in the where clause.
    The report region on screen shows the correct results but the report query shows "no data". This is the case when running "Test Query" and "Download XML data" from the shared component report query definition. If I hardcode the variable names I get rows returned, If I use bind variables - and specify the values for these variables I get no data. THe XML file contains the tags for each bind variable I have specified but has no data between the tags. I have Ticked the box to include application and session state but it appears that the bind variables are not being used.
    When I use my report query in the application (URL tied to a button) I get the same problem, the binds are not being passed to the report query.
    Can someone please clarify if this is a bug or not? And if not, how can I get it to work.
    I am using Apex 4.0.2
    Thanks
    Kathryn

    Hi
    To confirm, yes I selected the bind variables. I used these in the report layout, but the xml file has them as empty i.e.
    <P0_START_DATE><P0_START_DATE/> with nothing in between.
    IN the Test Query section, if I put real values in the boxes for the bind variables, I get no data found. If I hardcode the values into the query, I get the data.
    I've repeated the create report query many times and have created a report layout in RTF. I can use the layout with my region - in the print attributes and the layout works with the query but I need to create a PDF using 2 queries - ROWSET1 and ROWSET2. I can generate the XML but the values in the rows are all empty. When I use the layout with a report query instead of the region, I get no data even though I have used the same sql and have selected the bind variables. I was using variables from page items on page zero but have also tried using page items on the current page, the result is the same.
    I need to use a report query and a report layout as I need data from 2 queries in the PDF.
    I looked at your demo - what happens if you add a second sql query to the report query - is there any chance I can look at the back end (developer access?)
    Thanks for your input
    Kathryn

  • Setting a bind variable in a Shared Component Report Query

    I have defined a Shared Component Report Query in APEX using a bind variable similar to below
    Select name, id , ....
    from asset
    where id = :id
    I have also created a Report Region that displays a table where one of the columns contains a value I would like to be a link column that can launch the Report Query and pass its value to the bind parameter :id in the report query. This in turn would generate a pdf report for the details associated with that column. I am having problems setting the :id bind parameter. How do I do this?
    Can anyone help?
    Thanks

    The bind values are set from session state. So if try something like this:
    Select name, id , ....
    from asset
    where id = :P1_ID
    With P1_ID being a page item, for which you set the session state / value before generating the PDF file. So assuming you already have a page with a report and a page item, and that page item is already used in your report, then you could just create a button to download the PDF, make sure the button is a submit button, and create a branch pointing to the report query URL (or in 3.1 use the create button wizard, to do this declaratively.)
    Regards,
    Marc

  • Multiple Queries  in Shared Components Report Queries

    Hey all,
    I am creating a report query which has multiple queries and I am running into to some issues with the builder.
    1.Whenever I try to edit a query it always sends me to the same query. (I can see that it is passing a different ID in the url, but the query never changes)
    - Ex: I create a report query and add two queries, SELECT 1 FROM DUAL and SELECT 2 FROM DUAL. no matter which querry i try to edit it always shows SELECT 1 FROM DUAL.
    2. There is no way to delete individual queries.
    - does anyone know a workaround to delete a query? (rather than just deleeting the entire report query)
    Cheers,
    Tyson Jouglet

    This was a bug that has been fixed in APEX version 3.2.1
    (its always helpful to list the version you are using along with your question)
    If you are using this with a BI publisher report layout, you will also get problems with earlier versions as the rowsets don't always get returned in the correct order.
    See this thread for more details....
    Bi Publisher result set question
    I ended up deleting my whole query and spending a long, careful afternoon adding the 33 queries I had in order one by one having made SURE they were all EXACTLY what I wanted using SQL Developer.
    Gus..
    You can reward this reply by marking it as either Helpful or Correct
    ;-)

  • Report Queries and Report Layout

    Hello,
    I currently have several report queries with existing report layouts done in xsl.fo. I will be upgrading to Apex 4.0 in the next couple of months and I wanted to make sure that my reports will still work. I have an account on the Oracle hosted site and created a report query with an xsl.fo file.
    I understand that it requires the fop.war file to run on the server for it to work, but I have used the oracle hosted site before and was able to create report queries and custom report layouts.
    I am using an xsl fo editor called javaforless, which creates the .fo file and then I make adjustments to the file, before I create the report query and then load the file when I am creating the query.
    The report works correctly if I use the generic layout, but I have many reports with custom layouts that will be going to Apex 4.0 and I want to ensure that they will still work. Please look at the error below and give me some insight to why this is happening:
    Error opening document. This file cannot be opened because it has no page.Thanks,
    Mary

    Is there a bug on the Oracle hosted site for reports.
    I was able to run a report query with a cutsom report file (xsl.fo) on the hosted site. The file didn't throw any errors, though I don't understand why it doesn't. I had to create a blank field to have a border, which creates my lines in apex. code below:
    <fo:table-cell   number-columns-spanned="1">
          <fo:block   border-color="#404040" border-style="solid" border-width="medium"   margin-left="0.0cm" margin-right="0.0cm"  margin-top="0.0cm"  font-size="10pt"  font-family="SansSerif"  color="#000000"  text-align="left"></fo:block>
            </fo:table-cell>My original code uses the fo:leader, which works fine in Apex 3.2 but will throw errors if I use it in 4.0.2 and not open the file.
    <fo:table-row  background-color="#ffffff" height="0.89cm">
            <fo:table-cell   number-columns-spanned="2">
          <fo:block margin-left="0.0cm" margin-right="0.0cm"  margin-top="0.27cm" ><fo:leader leader-pattern="rule" color="#000000"  rule-thickness="2.0pt" rule-style="solid" leader-length="100%"/></fo:block>
            </fo:table-cell>
        </fo:table-row>Can someone please let me know why the fo:leader syntax is erroring on the Hosted Site.
    Thanks,
    Mary

  • APEX 4.0 Report Query column limitation, 43 column maximum for the result!

    Hi there,
    I'm trying to generate report from Apex 4.0.1, but I got stucked with column limitation when I'm executing the report query.
    Case:
    Environment: oracle 11g, apex 4.0.1, oracle BI 11, windows xp
    Table: My test table is quite simple, by creating a sample table with 44 columns, the column name is random, i.e. column1..column44, column data type is varchar2 (20)
    report query:my report query is also simple, by "select * from testtable"
    Data: no data in my sample table
    Error: then I'll get the error: "HelpORA-06502: PL/SQL: numeric or value error: character string buffer too small"
    solution: If I shrink the table column from 44 to 43, then the report can be generated to xls, pdf, etc.
    Question: Is there any column limitation for Apex report query? I know there's a 32k row size limitation for varchar, but since there's no single data in my table, it shouldn't be the case.
    Does anybody get this issue before? Thanks for any generous input!! :)
    Horatio

    hi marko,
    Thanks for the reply, but i can't find the 45 column limitation from report query and report printing. any clue for this call?
    Regards
    Horatio

  • How to change report query dynamically in Oracle APEX?

    Hi,
    I want to dynamically change the where condition in APEX report query. Can anyone help me solve my this problem?
    (Just want to change the query which we change in Oracle Reports using lexical parameter to change &Where, &Order by etc. dynamically!!)
    Thanks, Praful

    Hi
    I've been using flexible queries in APEX for a few years now, and your question just added a whole new dimension to the flexible and powerful nature or writing reports in APEX.
    While APEX Interactive reporting has almost completely removed the need the equivalent of Lexicals in Oracle Reports, I thought it might be fun to try and use lexicals in an APEX report.
    Before we start I should summarise the powerful capability of APEX reporting to have oprtional parameters (lots and lots of them if this is needed).
    For each parameter, you simply add a page item which will hold the value of the parameter.
    The item/parameter can be populated by typing in the value, defining an LOV, using a date-picker etc.
    To make the parameter optional simply use an OR in the where clause.
    So for a apge item P200_PARAM1.....include
    WHERE (:P200_PARAM1 IS NULL
    OR COLUMN1 = :P200_PARAM1)
    This way you can either leave the page item null or type in / select a value from a LOV.
    There is a small quirk in APEX LOV's which sometimes returns a value of '%' or '%null%' - depending on the version - when no value is selected.
    See Patrick Wolf's solution for this at Re: Null value handling in LOVs
    I include this Application Process in all my APEX applications ;)
    Now let's look at using the equivalent of Oracle Reports Lexicals......
    First-off - this is based on the APEX SQL report - NOT Interactive Report.
    It relies on the fact that you can let the query be parsed only at runtime.
    1. Define an SQL report entering the 'core' of your query.
    With a query like SELECT ENAME, JOB FROM EMP
    Select 'Generic Columns' option in the 'Column Headings' section
    Finish the report creation
    2. Define a page item - say P200_LEXICAL - type text on the page
    3. Edit the report and update the SQL query to include your lexical page item
    SELECT ENAME, JOB FROM EMP &P200_LEXICAL. (REMEMBER THE '.' AT THE END)
    Ensure that the option "Use Generic Column Names (parse query at runtime only)" is selected at the bottom of the query
    4. Add a button to the page -using 'Create a button displayed among this region's items' the will submit the page.
    5. Run the page - you will see all the employee names and job desdriptions
    6. Enter a where clause into the 'Lexical' textbox - say "WHERE ENAME LIKE 'K%'" and click the 'Go' button
    Voila! your where clause is magically applied.
    Try any variant you like adding an ORDER BY clause etc...... this is FUN!
    7. Clear the value of the LEXICAL and click go.
    Edit the report and move the &P200_LEXICAL. into the selected columns (or add another one)
    SELECT ENAME, JOB &P200_LEXICAL. FROM EMP
    8. Run the page
    Enter ",SAL" in the textbox and "Go"
    We can add as many columns as we like (subject to the "Maximum number of generic report columns:" set below the SQL query in the report edit section)
    Now because we have all the flexibility in APEX of setting page items using SQL or PLSQL you can set the value of the lexical programatically, or just pre-set a few values in an LOV - the options are limitless.
    While I've never had the need to use lexicals - you can see that APEX provides the most Flexible Lexicals in town.
    Eat your heart out "Oracle Reports"!!!
    Have fun
    Mike

  • Query of the complicated rdf-report in apex-report

    I try to migrate rather complicated rdf report into Apex. I have sucesfully converted the reports file xx.rdf into:
    1. xx.xdo file
    2. xx.rtf word file
    3. xx.xml data file
    4. xx_S.pls and xx_B.pls as package files in database
    The converted xx.rtf file is OK with all fields and images in right places In the Word I get a beautiful xx.pdf report when I start the preview using converted xx.xml file as the data file. -- The problem is just the package file with its several functions. The xml file has also many levels of data formed by tags like <list_g> etc.. Many of Word fields are CF fields from reports (xx.rdf) which now are as package functions with the same names.
    Is there any direct way to generate the Apex report query whic form the xml data file? It seems impossible to start create an Apex query from the package functions and trying to embed on it all the same fields as in xml file. Is it possible to somehow use xx.xdo file and bi publisher as help.
    Thank you very much.

    Okay, there is some confusion there.. You said: "In our case the customer is not willing to invest into Oracle Reports", Yet you are converting an Oracle Report file for their application, is this NOT their report file?
    Then you said " Also the customer is not very eager to use its BI Publisher for Apex reports " But APEX WILL be using BI Publisher for the PDF generation of the report, do they understand having Bi Publisher running the report that APEX can get the PDF from Bi Publsiher?
    Sounds like the customer is rather snarky on their requirements..
    Thank you,
    Tony Miller
    Webster, TX

  • Printable Report Query Problem

    I am attempting to develop a printable report query. I have created a report query under shared components that consists of 12 separate queries that gather data that all relates to a single page item. The intent is to create a printed PDF document for the user on demand that will display all this information about the page item that they have selected.
    The report query gathers the information and generates an XML file in the following format.
    <DOCUMENT>
        <ROWSET1>
            <ROWSET1_ROW>
                             *Data from query 1*
            </ROWSET1_ROW>
        </ROWSET1> 
        <ROWSET2>
            <ROWSET2_ROW>
                              *Data from query 2*
            </ROWSET2_ROW>
            <ROWSET2_ROW>
                              * Data from query 2*
            </ROWSET2_ROW>
       </ROWSET2>
       <ROWSET3>
           <ROWSET3_ROW>
                              * Data from query 3*
           </ROWSET3_ROW>
           <ROWSET3_ROW>
                              * Data from query 3*
           </ROWSET3_ROW>
       </ROWSET3>
    </DOCUMENT>I then took this XML file and developed an RTF template using BI Publisher desktop and imported it as a Report Layout.
    I then connected this RTF layout to the report query and ran it. I did not get the all the data to print.
    I found the reason it did not work was that the XML file that is generated from the report query is not static. The next XML file that was generated from the report query looked like this:
    <DOCUMENT>
        <ROWSET1>
            <ROWSET1_ROW>
                               * Data from query 3*
            </ROWSET1_ROW>
            <ROWSET1_ROW>
                               * Data from query 3*
            </ROWSET1_ROW>
        </ROWSET1> 
        <ROWSET2>
            <ROWSET2_ROW>
                               * Data from query 7*
            </ROWSET2_ROW>
            <ROWSET2_ROW>
                               * Data from query 7*
            </ROWSET2_ROW>
            <ROWSET2_ROW>
                               * Data from query 7*
            </ROWSET2_ROW>
       </ROWSET2>
       <ROWSET3>
           <ROWSET3_ROW>
                               * Data from query 1*
           </ROWSET3_ROW>
       </ROWSET3>
    </DOCUMENT>So I cannot develop an RTF template to display the data if I do not know where that data will appear in the generated XML.....
    Questions (I will offer several POINTS to anyone who can answer any of these questions!!!!)
    I am using APEX version 3.1
    *1. Why does the report query seem to randomly renumber and reorder the XML data it produces?*
    *2. Is there any way to make the report query output the XML data in the same order that the individual queries are ordered every time?*
    *3. Is there any way to specifically name the rowsets or rowset rows that is supported by APEX?*
    *4. Are there any other methods that I can explore to produce this report?*
    *5. Is this a problem because I am on an old release? Is this not a problem on 4.1?*
    Edited by: bhenderson on Feb 1, 2012 8:22 AM

    Thanks for your response.
    There are 12 separate queries in the report query. Each one is in a separate box on the report queries screen.
    I don't know how to post an image here, but I will try to describe it:
    The first query selects several fields relating to :P5_WIP_ENTITY_ID, which is a Work order. This query is header information about the job and should only return one row.
    The other queries get other information relating to :P5_WIP_ENTITY_ID, like part numbers that may have been issued to that job, purchases made for that job and so on. These queries may return more than one row or may not return anything.
    I have created the queries in the order that I want them to display on the form, however, when the XML is generated, ROWSET1 may have the data from the Header Query one time, then the next time it may have data from the purchase query. In other words, it does not display the data in the order that the queries appear on the report query page, and it seems to reorder the output at random.
    I have looked everywhere I could think of, but there doesn't seem to be any way of connecting or relating the separate queries. I also tried doing separate queries in one box and joining them, but there is a limit of 60 data items you can select from one query box.
    Edited by: bhenderson on Feb 3, 2012 10:01 AM

  • Dynamic Reports. Runtime parameter passing to Report Query.

    Hi everyone,
    I have developed a report using apex shared components (report query and report layout) along with BI Publisher for report printing in pdf format. the Report template is built using Template Builder for Word. I have configured my Apex4.1 env with BI Publisher 11.
    This report is working fine for hardecode ID ( like REQUEST_ID=10 ).
    to make report dynamic i have made following additions in the report
    I have added
    where clause in report query as WHERE REQUEST_ID = :REQUEST_ID (:REQUEST_ID is the text field in my page).
    Added a text field names :REQUEST_ID to get user input at run time.
    Create a button and add Repot Query URL in its properties.
    When i run the report with some valid value in :REQUEST_ID text field  i did not get expected result infect there is no record getting displayed in the PDF file.
    i think this is not the write way to do this but interestingly im not getting any error.
    please can someone guide me that how can i get this functionality in apex this way or the other ?
    Best Regards.

    Hi,
    the online help will help you on how to build a parameter list at all. For your desired functionality, all you need to do is to have the user pressing a button after he selected the parameters he want to assign values to and then create the parameter list in a PSLQL program unit in Forms.
    Frank

Maybe you are looking for

  • Wicd fails to connect with a WEP key

    I'm trying to connect to my wireless network after the recent update to net-tools. I sorted through most of my issues with the hostname command (I think) by installing inetutils and the recent update to wicd. Now, after trying to reconnect, my /var/l

  • How to find what parts I have in my laptop

    So my hard drive crashed right after the warranty expired and I didn't make a recovery disk...So I installed a new disk and installed windows 7 back on but I can't seem to find the wifi card that the laptop came with.  Also just installing the driver

  • Order Related Billing-Change Billing Quantity

    Hi I am Creating Order Related billing. Order Qty:-10.After entering Order No in VF01 it goes to Billing Screen & Doesn't alow to change Quanity. I want to make Billing Quantity as 1 instead of 12. Regards, Amol

  • Best way to install Ubuntu on a MACBOOK PRO?

    Hey!!! can anyone help to install Ubuntu on my macbook pro?  I've read about to do that, but ...im not really sure which is the best way..u know? basically cause i dont wanna mess up with my mac :/ THANKS 4 ANY HELP! 

  • Internal Zone Configuration

    After installing a zone for the first time on a baseline system, I run the 'zlogin -C my-zone' command. I get the typical '[Connected to zone 'my-zone' console]' response, but when I boot the zone using the 'zoneadm -z my-zone boot' command, I do not