Nested report howto?

Hi all-
I'm trying to create a report on two tables in sort of a master/detail relationship. I have an EMPLOYEE table and a SALARY table that maintains yearly salary info for each employee (a 1:N relationship). I'd like the report to look something like this:
LastName FirstName JobTitle  FY     Salary
Smith    Bill      Sys Admin 06/07  70000
                             05/06  63000
Jones    Sara      Web Dev   06/07  55000
                             05/06  50000
                             04/05  45000
------------------------------------------I'm guessing this needs a custom report template, but I haven't been able to find an example of one in which each row runs a second query (to get the salary info for the employee in the current row). Can anyone help me get started?
Thanks!
Rob

Hi Rob,
Andy's suggestion seems to fit best for your purpose.
In my recent project I have used a different approach to include details in a report.
I have written a stored function that generates the html from a different query.
   FUNCTION get_produkte_display_f (p_auftrag_id NUMBER)
      RETURN VARCHAR2
   IS
      l_str   VARCHAR2 (32767);
   BEGIN
      l_str    := '<table class="inlineProduktTable">';
      l_str    :=
            l_str
         || '<tr><th>Division</th><th>Produkt</th><th>Anzahl</th><th>Preis</th></tr>';
      FOR cur IN (SELECT   produkt_anzahl, reihenfolge, produkt_preis,
                           ist_bundle_produkt, ebene1, PATH, bezeichnung
                      FROM tpa_umsatz u, tpa_produkt_rl_v p
                     WHERE u.auftrag_id = p_auftrag_id
                       AND u.produkt_id = p.produkt_id
                  ORDER BY TO_NUMBER (ist_bundle_produkt), reihenfolge)
      LOOP
         l_str    := l_str || '<tr>';
         l_str    :=
               l_str
            || '<td>'
            || cur.ebene1
            || '</td><td>'
            || cur.bezeichnung
            || '</td><td>'
            || cur.produkt_anzahl
            || '</td><td>'
            || NVL (TO_CHAR (cur.produkt_preis), 'n/v')
            || '</td>';
         l_str    := l_str || '</tr>';
      END LOOP;
      l_str    := l_str || '</table>';
      RETURN l_str;
   END;Just include the result of the stored function in your select list:
SELECT a.auftrag_id, erfasst_am,
       tpa_auftrag_pck.get_produkte_display_f (a.auftrag_id) produkte,
       a.vp_nr
  FROM tpa_auftrag_aktiv_v aThe result will look like this<A>.
Regards,
~Dietmar.

Similar Messages

  • Nested Report Problem

    Hello Gurus,
    I have created a Classic Nested Report following Dietmar's example from:
    Nested report howto?
    I followed the steps to create the nested report:
    Step 1 - created the package
    create or replace package UNFUND_PCK as
       FUNCTION get_unfund_inline_f (p_dfcyseqno NUMBER)
          RETURN CLOB;
    end;
    --------------------------------package body--------------------------------------
    create or replace package body "UNFUND_PCK" is
    function GET_UNFUND_INLINE_F(P_DFCYSEQNO IN NUMBER
    ) return CLOB
    as
    l_str   VARCHAR2 (32767);
    l_cnt   NUMBER   := 0;
    begin
    -- null;
    /* insert function code */
      l_str    := '<table class="inlineTable">';
          l_str    :=
                l_str
             || '<tr><th class="colFundType">Funding Type</th><th class="colRequireType">Requirement Type</th><th class="colFY">Fiscal Year</th>'
             || '<th class="colCost">Cost</th></tr>';
          FOR cur IN (SELECT fundg_type_c, fundg_rqrmt_type_c, fundg_fy, fundg_cost
                         FROM dfcy_catg_fundg
                         WHERE dfcy_seqno = p_dfcyseqno)
          LOOP
             l_str    := l_str || '<tr>';
             l_str    :=
                   l_str
                || '<td class="colFundType">'
                || cur.fundg_type_c
                || '</td><td class="colRequireType">'
                || cur.fundg_rqrmt_type_c
                || '</td><td class="colFY">'
                || cur.fundg_fy
                || '</td><td class="colCost">'
                || cur.fundg_cost
                || '</td>';
             l_str    := l_str || '</tr>';
             l_cnt    := l_cnt + 1;
          END LOOP;
          l_str    := l_str || '</table>';
          IF l_cnt = 0
          THEN
             RETURN '';
          ELSE
             RETURN l_str;
          END IF;
    end GET_UNFUND_INLINE_F;
    end "UNFUND_PCK";Step 2 - Created the Styles placed this in the HTML Header Head.
    <style type="text/css">
    <!--
    .inlineTable{border:1px solid #cfe0f1;border-collapse:collapse;width:100%;}
    .inlineTable th{color:#336699;border:1px solid #cfe0f1;padding:2px;}
    .inlineTable td{border:1px solid #cfe0f1;border-left:none;border-top:none;padding:2px;}
    /* additional formatting for the specific columns*/
    .inlineTable.colFundType{width:100px; text-align:center;}
    .inlineTable.colcolRequireType{width:100px; text-align:right;}
    .inlineTable.colFY{width:50px;}
    .inlineTable.colCost{width:100px; text-align:right;}
    -->
    </style>Step 3- Created a New Page of Report, Classic Report (SQL qry)
    select      V.DFCY_SEQNO,
          V.DFCY_NAME,
          V.DFCY_SMY_NARR,
          V.DFCY_STATUS,
          V.DFCY_CATG_C,
              UNFUND_PCK.GET_UNFUND_INLINE_F(V.DFCY_SEQNO) UNFUNDED_DFCY
    from      V_DFCY_BASE V
    where   V.DFCY_CATG_C = 1My results comback with HTML tags everywhere:
    528 Funding dfcy funding dfcy added 5/27/10 updated on 6/10/10 closed/accepted risk 1 <table class="inlineTable"><tr><th class="colFundType">Funding Type</th><th class="colRequireType">Requirement Type</th><th class="colFY">Fiscal Year</th><th class="colCost">Cost</th></tr><tr><td class="colFundType">3</td><td class="colRequireType">2</td><td class="colFY">2013</td><td class="colCost">999</td></tr><tr><td class="colFundType">2</td><td class="colRequireType">2</td><td class="colFY">2012</td><td class="colCost">8888888888</td></tr></table>
    I am using Application Default for the page, No Template for the Region, standard report and using Theme 9. Please tell me what I am doing wrong so I can get the correct format.
    Thank You,
    Mary

    Thank you for the quick response..That was correct, I didn't even think to look at the column type. One more question, is it possible to display the nested table below a row instead of to the right of the main table?
    Like this
    INV # | name | status | category|
    15 | abc | closed| apples |
    Detail
    FType | RType | FY | Cost |
    Proc | Reset | 2013 | $1250.00
    ABC | Redo | 2011 | $18888.00
    INV # | name | status | category|
    18 | book | open | bannas |
    Thanks,
    Mary

  • How to suppress the report based on outer dimension in nested report

    Hi Experts,
    We have a report with nesting of two dimensions in rows. They are Program dimension and Account Dimension.
    We need to supress the report based on the program dimension members. i.e whenever there are no values against all the accounts for a particular program that particular program should get supressed.
    In the screenshot attached I am looking to supress the rows 37,38 and 39 as the data against this program is empty.
    However I dont want to supress the rows 31 and 33 as there is a capital data against this program in row number 32. So we have to supress the rows based on absence of data at program level.
    We are using SP14 on BPC 10.
    I remember that such functionality could be acheived in BPC 7.5 by flagging the required dimension to have suppress in Expansion Range. So I guess, similar functionality would be there in BPC 10 as well.
    I have evaluated the option of VBA macro to hide the required rows, but was wondering if we can achieve the same using EPM functionality as we used to do in BPC7.5.
    Thanks in advance for your suggestions!!
    Regards,
    Shiva

    Hi Shiva,
    First you have to check the option Keep Blocks:
    This option will show the whole block even if only one line contain some not zero/empty cells in the row.
    Second, when you select option Filter on All Columns/Rows you have to select OR as operator between columns:
    In this case the test for >0 (or for <0) will be applied to each column and the result will be OR'ed with other columns. True will be even if one column contains not zero and not empty cell.
    You logic to check individual column require to hardcode the members - not good!
    Vadim
    P.S. If you select AND for Filter on All Columns/Rows - then only lines with all cells with non zero / non empty will be shown as in your example!

  • Nesting reports/report within report/Recursive reports!

    Guys,
    This one's really annoying - Can I or can i not nest one report within another?? I have got a really complex report which I want to embed into another and don't want to go through the hassle of rebuilding it in the parent!! Here's what I am trying to do -
    I am trying to create a recursive report. I have got a database which has a
    table called Outlet and it has several directly or indirectly related child
    tables. I have created a report to show these details for a single Outlet.
    Now the issue I have is one Outlet can have several child outlets. Basically a
    one to many relationship on the same table. I want to display the exact same
    details which I displayed for the parent outlet - for each of the child outlet
    for the parent.
    And each of the child outlet in turn can have more child outlets. So
    essentially I want to recurse into the same data model and layout model twice.
    So conceptually I want to create a reusable report which I can call from
    another report but this report must be displayed in a frame of the parent
    report.
    Any suggestions as to how I can do this without physically creat9ing three
    levels of datamodel and layout model?
    I am running the parent from command line and need the output in a single RDF file?
    Many thanks,
    Amit

    Create a report that shows all the details you want, then group it by ModelName. In the section expert, hide the detail line. When you preview the report you will only see the group name, and when you click it a new report will open showing the details for that group.

  • Request for Report Howto

    I'm triying to create a page that contains a report a button and some multiselect list.
    The idea, it's to have the button and the multiselect list in one region and the report in another. When you navigate to the page with them, the report shouldn’t be displayed, but after you select values in the multiselect list and hit the button it should appear. If I navigate to another tab and then navigate to this page the report shouldn’t appear until after I select values and hit the button.
    So far I haven't been able to find a how to do this. I would like to know how this can be accomplished. I have tried, using the value of session and modified it using the button or have a hidden field that the button modifies it but, If I do that the values of the multiselect weren’t modified.

    i just noticed that %null% thing, too, so i'll log that in a bit. thanks. about the condition you're using for your region, i'd go a different route if i were you. it sounds as if you've allowed your multiselect lists to show null values. if you do that and do not specify a "Null return value" for the LOVs, it'll return that %null% string for which you're checking. it's up to you if you want to use our default null string in your condition, but i wouldn't recommend it. we talked about this %null% stuff at...
    PL/SQL returing SQL and null entry in select LOV
    ...so take a look there and decide if you still want to use it. more importantly, though, the first time your users access your report page, those %null% values for your p1_multiselect1 and p1_multiselect2 items won't be set. therefore, checking for %null% in that case does you no good. just keep that mind as you set up your page. assuming you do, in fact, wish to show a null value in your multiselect items, here's my suggestion:
    -in each of your multiselect items, enter a "Null return value" like "novalue"
    -also in your multiselect items, enter something like "Select a value from the list below" in the "Null display value" fields
    -also in your multiselect items, enter that "novalue" string into the "Default value" fields
    -have your report region render with a condition type of "PL/SQL Expression" and have "Expression1" be something like instr(:P1_MULTISELECT1||:P1_MULTISELECT2,'novalue') = 0
    hope this helps,
    raj

  • Nested Reports

    I have created a set of reports
    I have create a report which lists the set of reports (a menu) which is available to a user via a table. What I want to be able to do is let user click on a button on the report menu and bring up that report to run.
    I have created the button and part of the code behind the button but do not know how to trigger the correct report this is what I have so far. so how do I pass it what report_name the user clicked on?
    Procedure U_RunReportButtonAction is
    begin
    SWR.RUN_REPORT
    (REPORT_NAME.rdf);
    Return(TRUE);
    EXCEPTION
    When SRW.RUN_REPORT_FAILURE THEN
    SRW.MESSAGE(100, 'Error Executing ' &#0124; &#0124; report_name&#0124; &#0124; 'Report');
    RAISE SRW.PROGRAM_ABORT;
    end;

    OK, the easiest way is to look at the
    online help, it should descripe the use of
    the bulit-in package srw.run_report.
    The package takes a text string with
    the report name (no .rdf, it goes for the .rep directly) and parameter list, the batch=yes is mandatory
    To run a report:
    SRW.RUN_REPORT('report_name, batch=yes')
    /Andreas
    null

  • Regarding nested report

    Suppose v have called a new reort progarm from report1 program i.e thru SUBMIT command....and in the new report program i.e called report is having a CALL TRANSACTION statement....so wat happens?

    Hi
    If report program A calls Report Program B through SUBMIT and Report B itself calls Report A through Call transaction then I think it will not go for an indefinite iterations.
    Reason: Call transaction actually calls a screen and all we know that SAP can create a maximum of Six (6) screens. So the process will run for maximum of Six screen generation. Then it will give a session error i,e. Maximum Session is reached.
    Regs
    Somnath Paul

  • Nested Report

    Hi to all
    Yesterday I done five reports with Oracle Report Builder 9i. Now I'd like to create a file, as the destination output, with the five reports inside.
    How can I do it?
    Thanks a lot
    Best Regards

    Hi GLuca
    If you generate the output in PDF format, you simply cannot append the five .pdf files and expect the file to open correctly in Acrobat. The same with RTF file too.
    Each of these files have a definite file format. You have to confirm to the file format standards set by its proposers. When you append one file to another, you are disturbing the file format.
    You may search the Internet for some file appenders. There are free tools out there that allow you to append .pdf files, .rtf files. Remember that these usually do not come with support or have very limited support.
    If you want to keep things simple, combine all your five reports onto a single report. Say, part 1 and 2 goes into Header section, 3 and 4 into Main and 5 into Trailer section. Create as many layouts as required. When you generate the output of this report, you'll have all the five parts in one document.
    Regards
    Sripathy

  • Reporting on a Multi-Select list field X:Y:Z

    I'm sure someone must have come across this problem but I can't find a reference to it on the forum.
    PROBLEM
    I have a data entry form with multi-select lists. Users choose a number of display values and the return values are stored in the field in the format
    20:30:50
    When I create an SQL report on a row, there is no option to Display the column as a "multi-select list" like there is with a standard List of Values.
    How do I report the display lookup values rather than the return code?
    Is it possible to display the selected values in a report for example
    red
    orange JOHN 10-JAN-07
    green
    red
    orange MARY 12-FEB-07
    orange
    green MARK 13-JUL-07
    regards
    Paul P

    Paul,
    I have several examples on this topic:
    http://htmldb.oracle.com/pls/otn/f?p=31517:87
    http://htmldb.oracle.com/pls/otn/f?p=31517:84
    http://htmldb.oracle.com/pls/otn/f?p=31517:75
    Basically, you will need to create a table out of your colon separated values and then
    join this table with other tables to be able to display it however you want.
    What just comes to my mind is that Dietmar presented a nice workarround for a similar
    problem here:
    Nested report howto?
    Denes Kubicek

  • How to develp a subreport in the same page of the main report and processed when is called

    SSRS 2012
    Hi guys,
    I am developing a report that includes a subreport.
    therefore The report is made up by 2 sections:
    1) Show a grid (several rows - may be 100 or more - and some columns). It represent high level info  (Each row represent a specific item)
    2) The user click on a Row/column (eg: Item1, to see details that must be shown as graph.
    Here the problem: Searching info about SSRS reporting for subreports, drilldown, nested report and so on, no ones accomplish the requirements for the following reasons:
    1) Subreports: NOT open in the same page. The user must <go back> to see detail for other items, such as Item 2....
    2) Nested and DrillDown: Process data as the Main report (they are hidden and displayed after user action). In my case this leads to performance problem, because: if the main report has 200 objects (it means 200 graphs processed and hidden at the same time
    for the main reports).
    3) DrillThrough and Subreport: The detail data are processed only when the user select the interested item in the main report. Here the problem: the report is shown externally.
    Please, it there any possibility to have a subreport (or anything else) to be executed in the same report as the main report and processed only when the user make action?
    Thanks for your help.

    Hi Fasttrack2,
    According to your description, there is a main report with more than 100 rows of summary information, when users click the item of the row, the report need to jump to detail information shows as graph. The problem you are facing is that you are not sure
    subreport, drilldown or drillthrough report should be used? You hope to set display detail information in the main report and keep high performance of report.
    In Reporting Services, each subreport instance is a separate query execution and a separate report processing task. Subreports are recommended when there are just a few subreport instances. We should not use subreports inside a group when there are many
    group instances, instead, consider using drillthrough reports. Drilldown reports process all data even when the data is first hidden. In order to improve the performance of the report, we can split drilldown reports into parameterized drillthrough reports,
    because Drillthrough reports do not run until a user clicks the drillthrough link in the main report.
    In this case, we can consider using drilldown or drillthrough report. In drilldown report, when we click a plus or minus button to expand or collapse a section of a report, the detail data will be displayed in place. By using drillthrough report, when we
    click the link in the main report, the detail data will be displayed, we can come back to the main report by click return button in the drillthrough report.
    Reference:
    Troubleshooting Reports: Report Performance
    Drillthrough, Drilldown, Subreports, and Nested Data Regions
    If you have any more questions, please feel free to ask.
    Best Regards,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Multiple queries in a single report?

    I'm having some issues with the ColdFusion Report Builder...
    I have a database table called "Items" that includes fields
    for Reviewer and Status. I want to create a report that will list a
    reviewer, then express the number of items where the Status is
    "open" as a total or record count. I want to do the same for total
    items, and then express the number of "open" items as a percentage.
    For example:
    REVIEWER, OPEN ITEMS, TOTAL ITEMS, PERCENT OPEN
    John Doe, 10, 20, 50%
    Jane Smith, 15, 60, 25%
    ...and so on.
    So far I've only been able to get my report to display the
    recordcount of the entire query. In order troubleshoot the problem
    I created a regular cfm page to do the same thing. Here's what I
    did:
    <cfquery name="getreviewers"
    datasource="#APPLICATION.datasource#">
    SELECT DISTINCT Reviewer
    FROM Items
    ORDER BY Reviewer
    </cfquery>
    <cfoutput query="getreviewers">
    <cfquery name="getopenitems"
    datasource="#APPLICATION.datasource#">
    SELECT Status
    FROM Items
    WHERE Status='open'
    AND Reviewer = '#Reviewer#'
    </cfquery>
    <cfset open = getopenitems.recordcount>
    <cfquery name="getallitems"
    datasource="#APPLICATION.datasource#">
    SELECT Status
    FROM Items
    WHERE Reviewer = '#Reviewer#'
    </cfquery>
    <cfset all = getallitems.recordcount>
    <cfset percent = (open / all) * 100>
    #getreviewers.DR_Item_Reviewer#, #open#, #all#,
    #Round(percent)#%
    </cfoutput>
    That worked great, but as you can see I had to nest a couple
    of queries inside a <cfoutput>. I don't know how to
    incorporate this into the report builder, as it seems you can only
    specify a single query. Another thing that occurs to me is perhaps
    I'm going about this the wrong way. Is there perhaps a function
    that will display things the way I want them without fussing with
    multiple queries? Any help would be greatly appreciated. Thanks in
    advance.

    It seems like you are trying to do a subreport. You can nest
    reports within the report feature...just check out the subreport
    feature under the help section. If that doesn't help let me
    know.

  • Displaying Answers Date Prompts in Title of Report

    I come from a BO background and we are now implementing OBIEE into our environment. My question revolves around the display of dashboard prompt values in the Answers report title.
    I have a Dashboard Prompt built that uses the expression 'DateColumn' between - user inputs their two values using the Calendar control.
    Is there anyway with this scenario to display what the user chooses in the Answers report title? In the Answers criteria I have set the criteria for the 'DateColumn' to be prompted.
    I see you can assign some of the Dashboard prompts to variables, however, you can't do it when you using the Between logic or the Greater than logic.
    I look forward to any input and thank you so much in advance!

    I presume you are aware of the filters view that shows you all the filters applied to the report, but you want the parameters in the title and no where else.
    The other option is not simple. You could make your Dashboard prompts as equalities, and then you could save the parameters to Presentation Variables and pass the parameters to a nested report inside a narrative iframe where you construct the real query. An excellent example of this is Venkatakrishnan's blog in the URL below:
    http://oraclebizint.wordpress.com/2008/02/19/oracle-bi-ee-101332-passing-operators-in-dashboard-prompts-go-url-and-presentation-variables/
    You may check out the section "Oracle BI Presentation Services Go URL to Issue SQL and Pass Filters" in the Presentation Services Administration Guide for more information.
    http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/b31766.pdf
    HTH,
    Nilanshu

  • More than 1 record by line in reports

    Hello everybody.
    Can anybody tell me How I can display more than 1 record in same line of a report?
    Thanks in advanced.
    Regards everybody.

    Selzeus,
    Is this what you are searching for:
    http://daust.blogspot.com/2007/03/apex-nested-reports.html
    Denes Kubicek

  • Problems converting report to CM 12

    All the reports and forms are working properly except one for the CORRESPONDENCE LOGS. Like others, it envolves retrieval arguments to help filter the data included in the report (such as date intervals). It works fine in Infomaker. But in CM12, I get this error: "The report must include well-formed data package only". I made sure to CAST the dates but doesn't do it. Can't find any clue anywhere. I have tried to change the SQL but doesn't work either and the query is as simple as can be. Is there any hint you could suggest?
    We use Sybase, no nested reports involved.
    Edited by: user8864582 on 9-Aug-2010 12:56 PM

    It's possible that you are getting this error due to characters you are using in the query. I had this problem recently in 12.1 where the Advanced Print Window crashed because it saw a ">" as a XML tag. So once we changed the where clause to switcht he sign to "<" it worked fine in CM. BTW if also worked fine in Infomaker.
    Example original was:
    Where sysdate-field_date <31
    Changed to
    Where 31> sysdate-field_date

  • Nested table export ot CSV

    I have produced a master-detail report using a nested HTML table as described in this blog
    http://daust.blogspot.com/2007/03/apex-nested-reports.html
    This works just fine when viewing the report but I want to be able to export it to a CSV (or Excel) file as well and what is happening is that the multiple rows in the nested table are just being concatenated into one big string in the cell in Excel. Is there a way I can preserve the line breaks in the exported file? I've already tried concatenating the nested table columns to give one item for each row in the cursor with a br tagged on at the end of the row. Again, this works fine for viewing the report but I still get one big string in the export containing the value for each row.
    Regards,
    Steve

    Cause: While exporting a bitmap index or posttable action on
    an inner nested table, the name of the outer table could not
    be located, using the NTAB$ table.
    Action: Verify the table is properly defined.

Maybe you are looking for

  • How to create simple XML database in oracle 11g

    Hi, what are the steps to followed to create a simeple custormer XML database. Like storing .xml file into XMLType, writing simple xml schema.....like that how to register the .xsd how to insert the xml data how to querying the the data base with xqu

  • Reading Data from SQL Server 2000 Linked Servers

    Hello, I have a colleague who wants to read data from a OO4O driver Linked Server my FRENCH_FRANCE.US7ASCII Oracle 8i database. He's got some troubles to read data with "é", "à", and so on. They always replaced by "?" Since I have ask him to use SQL

  • OrgChart - Group setting not respected when default hierarchy clicked

    Does anyone else get this problem in OrgChart (staged)? If a group is defined and set to u201CGroupu201D via the settings panel by the end user, then clicking the default root icon then the resulting hierarchy starts at the default root but without m

  • When to restore controlfile, rman is complaining database not mounted?

    to restore controlfile, shouldn`t the database be in NOMOUNT status? if yes, then why rman is complaining ORA-01507? where I went wrong? Please advise. C:\Documents and Settings\PhoenixBai>rman target / nocatalog Recovery Manager: Release 10.2.0.1.0

  • Panic.log - What is this?

    I was looking at my Console logs and found this panic.log shown below. I had walked away from my iBook G4 running 10.3.9 and when I came back everything was dark: not sleeping and not "display off" I pressed the power switch and it rebooted OK. I wen