Unable to setup fixed number of report columns based on a dynamic query

Hi guys, I need to find a way to replicate below output. Unfortunately it cannot be done using the column group feature due the fact it will create not so many rows as I need. In the below case it would create
only four columns. I need 10 columns. Basically for 100 m 6 columns would remain blank . 8 for 200 m .I'm using SRSS 2008R2
Query results:
Race Name Ranking
100m Andrew 1
100m Rachel 2
100m Chris  3
100m  Drew 4
200m John 1
200m  Billy 2
Report output should look like:
Race    1 2    3 4 5 6 7 8 9  10
100m  Andrew Rachel Chris Drew
200m John Billy
Any suggestions?

As I understand, you want a fixed number (10) of columns and you want them whether or not there are 10 rows returned by your dataset for a given race.
What is your dataset?
What if your dataset returns 15 races of a given type? Do you want 15 columns then?
Assuming your dataset is TSQL, you can use a matrix in your report if you tweak your dataset query. First, you need to add a "default" set of data that guarantees your 10 columns. This can be done with a set of UNION statements:
UNION
SELECT '100m' AS Race, '' AS Name, 1 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 2 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 3 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 4 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 5 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 6 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 7 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 8 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 9 AS Ranking
UNION
SELECT '100m' AS Race, '' AS Name, 10 AS Ranking
This gives you the 10 columns. In the matrix, set row group to Race and column group to Ranking. Set the intersecting detail cell to:
=Max(Fields!Name.Value)
This will give you 10 columns unless you have more than 10 rows returned for a given race.
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek.

Similar Messages

  • How to (un)hide report columns based on checkboxes?

    Hello,
    I have a simple report that selects 4 columns from a table.
    I would like to create 2 check boxes (at the report level, not at the row level) corresponding to 2 of the 4 report columns: When they are checked, the corresponding columns are visible. When they are unchecked, the corresponding columns are NOT visible.
    Two questions:
    1.
    This would require submitting the page automatically upon (un)checking either check box. How do I do that?
    2.
    I have attempted to use the Conditional Display properties of the report columns with hard coded values, but they don't seem to work whether the Show property of the columns is on or off. Any idea why and how to get around it? (I am using 3.2. Could this be a bug that has been fixed in 4?)
    Thanks!
    Gabor

    Hi,
    I can not find post where I have explain how sample works.But here it goes:
    You need load jQuery in page template or page HTML header if you are not using Apex 4.
    Create new blank page. In my case new page id is 70.
    Create HTML region to new page called Columns. Use wizard defaults
    Create hidden item Px_REPORT_REGION_NAME. Use wizard defaults.
    In my case hidden item name is P70_REPORT_REGION_NAME .
    Create computation before header for hidden item. Computation Type "Static Assigment".
    In computation write name you like use to your report. My case I did write "Employee report".
    Create SQL Report. In region title place your hidden item like
    &P70_REPORT_REGION_NAME.In my case I did use query
    SELECT *
    FROM empCreate check box. In my case it is called P70_SHOW_HIDE.
    Use from LOV query
    SELECT heading,
      display_sequence
    FROM APEX_APPLICATION_PAGE_RPT_COLS
    WHERE application_id = :APP_ID
    AND page_id          = :APP_PAGE_ID
    AND column_is_hidden = 'No'
    AND region_name        = '&'||'P70_REPORT_REGION_NAME'||'.' -- Change P70_REPORT_REGION_NAME to your hidden item name
    ORDER BY 2Place to report region footer
    <script type="text/javascript">
    function hideCol(pThis){
       var lRepId = '#report_data_#REGION_ID#';
       var lCol   = pThis.value;
       if(pThis.checked){
         $(lRepId + ' td:nth-child(' + lCol + ')').show();
         $(lRepId + ' th:nth-child(' + lCol + ')').show();
       }else{
         $(lRepId + ' th:nth-child(' + lCol + ')').hide();
         $(lRepId + ' td:nth-child(' + lCol + ')').hide();
    </script>Edit checkbox item and place to HTML Form Element Attributes
    CHECKED onclick="hideCol(this);"Your report template most inner table tag must have id attribute
    id="report_data_#REGION_ID#"Then you have result like this
    https://apex.oracle.com/pls/otn/f?p=40323:70
    Regards,
    Jari
    Edited by: jarola on Oct 27, 2010 11:13 PM
    Note about Apex 4 and jQuery added

  • Urgent - Report Column based on LOV - Value not found in LOV

    Hi All,
    Recently, we have upgraded to HTMLDB 2.0 from HTMLDB 1.5.
    I have a SQL report. One of the columns is based upon LOV - Display as Text (Based on LOV, does not save state).
    For the "Ids" of the report, it should display the corresponding "Names" from the LOV.
    But, for the cases, where no record exist in LOV for some Id, then it is directly showing the Id instead of "-" (which i have specified in Display Null Text) in the report column attributes.
    Before upgrade, it was working fine.
    Any idea where is the issue.
    Please help.
    Thanks in advance,
    Monika

    Hi,
    Can anybody help me in sorting out this issue please.
    For your reference, i have made a test case on
    http://apex.oracle.com/pls/otn/f?p=20451:4:3519837362944582:::::
    Here, there are 2 tables
    1. MY_EMP_COUNTRY(emoid, empname, cntry_id)
    2. MY_COUNTRY_LOOKUP(id, name,active)
    LOV is created on table 2
    select name d, id r
    from my_country_lookup
    where active = 'Y'
    And, on the page a SQL report is created
    select empname, cntry_id
    from my_emp_country
    where, cntry_id is based upon the LOV.
    Since, in lookup table, cntry_id = 4 is set inactive, it is not picked up by the LOV and hence on the report instead of showing the NULL text it is showing the cntry_id (4).
    The attributes of report column cntry id -
    Named LOV = CNTRY_LOV
    Display Null = YES
    NULL text = -
    Display Extra Value = YES
    Am I missing anything.
    thanks,
    Monika

  • Number in report column

    How can i add % sign in the report number column? like 12%,15%
    Thanks
    KP

    Change your report select query..
    select to_char(num_col)||'%' percentage from tblCheers,
    Hari

  • Bug: Report Column based on LOV character string buffer too small error

    When using a column type of "Display as Text (based on LOV, does not save state)" with a result set that is rather large causes a character or string buffer too small oracle error.
    See the below page for an example.
    The example page below has a single report off a table called "HUGE_TABLE" which has two columns: display and code
    Code contains a number between 0 and 100000.
    Display contains the number in code appended to a block of text.
    When I display the report with no Display As Text (based on LOV does not save state) it displays fine.
    If I make the "Code" column display as text based on LOV and make the LOV
    "SELECT display, code FROM huge_table"
    I get the error you see on the page.
    http://apex.oracle.com/pls/otn/f?p=32149:1
    Thanks.

    Thanks for your help Scott.
    So from what I've gathered from my own tests and the discussions you linked me to the LOVs based on SQL queries are being converted into "static LOV" strings before being used.
    As such they are limited to the PL/SQL VARCHAR2 max size of 32767
    Which means given the static reduction of the string 'STATIC:' that we have 32760 characters left.
    Which is where your SUM( LENGTH( display ) + LENGTH( return ) + 2 ) comes in.
    In short, if:
    sum( length( display ) + length( return ) + 2 ) + 7 > 32767
    would evaluate to true then you have a problem. :)
    I'll use this to track down my problems and switch them over to inline queries.
    Thanks.
    Cheers,
    Joe

  • Manipulating report column based on another column value?

    Here is what I am trying to do.
    1.     I have a report region which has 2 columns.
    2.     Both the columns are setup as links to navigate to a different page. I am using <img src="#IMAGE_PREFIX#e2.gif" alt="Edit"> for link text report item attribute.
    3.     The value can be either in column 1 or 2 but not in both the columns at the same time.
    4.     If the value is existing in column1, the column 2 should display as null, which I have trouble with. I can see the images even though the value is null.
    Appreciate if you can let me know how to achieve this?
    Edited by: user552288 on Jul 15, 2009 7:45 AM

    Could you please post the current query which you are using?
    Instead of using the image display attribute in the report attributes column, can you include that part of the query.
    Something like:
    select
    (case when col1!=NULL then <img src="#IMAGE_PREFIX#e2.gif" alt="Edit">) else 'NULL' as Column1,
    (case when col2!=NULL then <img src="#IMAGE_PREFIX#e2.gif" alt="Edit"> ) else 'NULL' as Column2
    from table

  • How to display special characters in APEX Classic Report column

    Ref: Thread: How to display newline characters as new lines
    Version: APEX 3.2
    Hi,
    I have created an classic SQL Report with one of the columns being a decode that gives a value 'Post'(the value should be highlighted in Red) on one condition and 'Pre' on another. I have followed the advice given in the page (URL provided above) , i.e. I have changed Strip HTML to 'No', changed Display as to 'Display as text (escape special characters, does not save state)'. I have also passed this value back to the same page to be stored in a page item each time a link (another column in report) in report is clicked. I have tried passing it as #DEADLINE# and \#DEADLINE#\. The issue I face is, instead of the value being highlighted in Red, it gets passed back as a string holding the value 'Post'. Is there any way I can get this to display as it should without the Strip HTML being changed to 'Yes'.
    Thanks very much.
    Rohi
    Edited by: Rohi on 18-Jul-2012 04:21

    876651 wrote:
    Hi,
    Thanks for your response.
    I am trying to display a page item that is derived from a report column based on a click on the URL link (*view >*>)
    This page item (here, it is Manager_ID) should ideally be highlighted when a particular condition is satisfied (achieved using a DECODE in the report).
    But it is not displayed like it should be.
    I do not want the value to be displayed along with the html tags as a string.
    I want the html tags to take effect and highlight the value within it.
    Initially, I had set Strip HTML to Yes and the value was returned without any highlighting .
    So I changed it to 'No' and and it contained the html tags.
    I am not sure what setting in APEX Report Attributes can help me achieve that effect I want.None of the report settings are relevant. They affect the rendering of the report and none of the columns you were changing the properties of were actually rendered.
    You can't pass HTML and CSS around in URL parameters.
    I suggest you pass *2* values in the column link: the MGR ID and a simple class or colour value computed by the DECODE in the report. I've suppressed the first version of the report and created a new one that does this:
    decode(dept.deptno, '30', 'c00', '000') highlight The link column now passes the MGR ID and the HIGHLIGHT colour (red when the condition is satisfied and black when it is not).
    I created another hidden and protected page item <tt>P0_HIGHLIGHT</tt> as the target for the highlight value, and used the Pre/Post Element Text properties of the <tt>P0_G_MGR</tt> to wrap it in a <tt>span</tt> whose colour is changed using the <tt>P0_HIGHLIGHT</tt> value as a subtitution string:
    <span style="color: #&P0_HIGHLIGHT.;">Having done that, I still don't really get the requirement here. I'm sure that given the full picture I'd be using a completely different approach...

  • Dynamic LOV based on report column

    HI,
    I've a standard report with Two columns. Column1 is standard Report Column and Column 2 is a LOV based on an SQL Query.
    Now I need to filter the LOV (add a where clause) based on the value in the column1.
    For example, consider Column1 as "country" and column2 as "state". so the in column2(LOV), user should see only the list of states belongs to the corresponding country(Column1)
    Please note that the report is based on an SQL query
    Any clue on how to do this.
    I'm using APEX4.1.
    Thanks in advance
    Prasanth

    I think you are looking for this https://forums.oracle.com/forums/search.jspa?threadID=&q=tabular+form+cascade&objID=f137&dateRange=all&userID=&numResults=15&rankBy=10001
    please search the forum before posting a question
    Thanks

  • Reference report column from another page?

    I have a work order report with column link. Upon clicking link, control goes from page 2 to page 3 where I want to show details about components in work order. How do I reference the work order ID (report column on page2) from the query in page 3? I know I can reference page items, but how do you do you pass a value of a report column on the previous page?
    Thanks.
    Paul

    Hi Paul,
    Typically I would create an Item on the page being called (Page 3 in your case) to receive a value being passed via your Link; this item could be hidden or read-only. You might want to name yours; P3_WORK_ORDER_ID or something to reflect the Primary Key (PK) of your Work Order.
    On the Link Column on Page 2; I assume that your Target Page is 3.
    Down in the Link Column section under Name and Value ;
    Name might read P3_WORK_ORDER_ID
    Value might read *#WORK_ORDER_ID* this would reference the work order id column on the Page 2 report.
    Now on your Page 3 report; your SQL would need within its Where clause something like this:
    my_table.work_order_id = :P3_WORK_ORDER_ID
    Jeff

  • Dynamic query to produce crosstab/pivot report

    Hello,
    I've not been able to find any examples similar to my situation but perhaps I'm using the wrong search phrases...
    I'm basically trying to create a cross-tab type report based on a dynamic query (since I do not know how many accounts a person has):
    select '  SELECT x.name, x.type, ' from dual
    union
    select ' max(decode(x.account,'''||m.account||''',x.amount,null)) as "'||substr(s.proj||' '||m.account,1,30)||'",'
      from db1.manager m, db1.person p, pi.charges c, db1.status s
    where m.manager_id = p.id
       and M.ACCOUNT_ID = C.ACCT_ID
       and M.ACCOUNT_STRING = S.project
       and C.JNL = (select max(id) from db1.journ j where j.TYPE ='M')
       and p.username = :username
       and nvl(M.END_DATE, sysdate +1) >= sysdate
    group by m.account, s.proj
    union
    select 'sum(x.amount) grand_total from (select m.account, c.name, c.type, c.amount '
              ||'from db1.manager m, db1.person p, pi.charges c '
              ||'where m.manager_id = p.id '
              ||'and p.username = :P68_PRINC '
              ||'and c.acct_id = m.account_id '
              ||'and c.jnl = (select max(id) '
              ||'from db1.journ j where j.TYPE =''M'')) x '
              ||' group by type, name' from dualThe output from this query for the particular manager I selected is:
    SELECT x.name, x.type,
    max(decode(x.account,'12012',x.amount,null)) as "Internal 12012",
    max(decode(x.account,'17929',x.amount,null)) as "Staged 17929",
    max(decode(x.account,'18054',x.amount,null)) as "Help Software 18054",
    max(decode(x.account,'3428',x.amount,null)) as "Mow 3428",
    max(decode(x.account,'3428',x.amount,null)) as "Mow 3428_1",
    max(decode(x.account,'3508',x.amount,null)) as "Stampede 3508",
    max(decode(x.account,'9102',x.amount,null)) as "Open Collaborative 9102",
    sum(x.amount) grand_total
    from (select m.account, c.name, c.type, c.amount
    from db1.manager m, db1.person p, pi.charges c
    where m.manager_id = p.id
        and p.username = :P68_PRINC
        and c.acct_id = m.account_id
        and c.jnl = (select max(id)
       from db1.journ j where j.TYPE ='M')) x
      group by type, nameThis query generates another query that ultimately produces the report below (please pardon the alignment) that I want to see on a report page.
    NAME     TYPE     Internal 12012     Staged 17929     Help Software 18054     Mow 3428     Mow 3428_1     Stampede 3508     Open Collaborative 9102     GRAND_TOTAL
    #EXAM1221     M                                                                            22                                                                                             22
    #EXAM1222     M                          14.83             14.77                     12.56                          2.22                                                          44.38
    #EXAM1223     M                          6.73                 6.7                             5.7                                  1                                                          20.13
    THOEORY       M                          106.5                                                                                                                                      106.5Should I be using the report type that is based on a 'PL/SQL function body returning SQL query' for this type of report??? If so, how does that get set up?
    Thanks in advance!
    ~Jake

    This solution works in that it generates the proper query. I can copy the query (from debug mode) and paste it in TOAD and it works perfectly. However, in the report page it tells me: "report error:ORA-01403: no data found".
    I found this thread: report error: ORA-01403: no data found when SUM columns
    I did have a couple other regions on the page (previous attempts) that were hidden so I deleted them completely. Still no luck.
    I am also summing up several columns...if that has anything to do with it.
    Does anyone have any suggestions?
    Thanks again!!!
    ~Jake
    Edited by: jhammer on Jul 27, 2010 11:02 AM

  • Interactive report based on dynamic query

    Hello
    I am using Apex 4.1 and have a requirement to create an interactive report based on a dynamic query. This option is available in Classic report but in Interactive this feature is not there. Tried using collections or just a view (thought of changing the view definition during "On load", but structure of the report is already defined based on the definition of the view at design time).
    Is there any way of achieving this?
    Appreciate any help!
    Thanks
    aks

    Try looking at this: http://rakeshjsr.blogspot.com/2010/10/oracle-apex-interactive-report-based-on.html
    Thank you,
    Tony Miller
    Dallas, TX

  • The number of display columns in the report reached the limit. Help!!!

    Hello Everyone,
    This might be dumb question. But why do get this error with a IR report? and what is the solution for this. Please help me with this.
    Error
    The number of display columns in the report reached the limit. Please click Select Columns under Actions menu to minimize the report display column list.
    Oh.. And also i have a blob column.. if the format is not given, then the table is fine.. but happen to get this error only when the blob download format is given.
    Thanks and regards
    John
    Edited by: JB on Mar 30, 2012 11:08 AM

    Hi,
    i have set up a small test case on apex.oracle.com and I receive the same error if I use download format.
    I have a table
    test_blob (id number, name varchar2(10), blobcont blob)
    If I create IR like
      select
        id,
        name,
        blobcont
      from test_bloband then I define download format I hit the error.
    If you want this to work you have to change your query to
      select
        id,
        name,
        dbms_lob.getlength(blobcont) blobcont
      from test_blobAnd then again define download format for blob on blobcont column.
    Regards,
    Aljaz

  • The number of display columns in the report reached the limit" Interactive Report

    I get the error message of "The number of display columns in the report reached the limit" when trying to display less than 100 (100 is limit) columns when an aggregate has been created.   This does not happen when an aggregate has not been added to the IR report.  It seems to happen because I have a control break on as well.  When I turn off the control break it works but is not the result that we want.  Interesting enough, if I filter the results down to 500 rows it works just fine.  Does oracle treat aggregates as columns!?  This is a really odd issue that I really need to clear up.
    Oracle 11g
    apex 4.1.0.33
    Thanks in advance,
    Shawn.

    Hi,
    i have set up a small test case on apex.oracle.com and I receive the same error if I use download format.
    I have a table
    test_blob (id number, name varchar2(10), blobcont blob)
    If I create IR like
      select
        id,
        name,
        blobcont
      from test_bloband then I define download format I hit the error.
    If you want this to work you have to change your query to
      select
        id,
        name,
        dbms_lob.getlength(blobcont) blobcont
      from test_blobAnd then again define download format for blob on blobcont column.
    Regards,
    Aljaz

  • Maximum number of generic report columns

    Clicking the "Use Generic Column Names (parse query at runtime only)" radiobutton makes the "Maximum number of generic report columns" a editable field with a default of 60.
    This seems to be a new feature in 2.0, right?
    So, is 60 columns not the hard maximum number of columns in a report anymore? What is the new limit? What if I type 200 in that text box?
    Thanks

    and then use the column names as headings. We will
    improve the usability of the report attributes page
    in the next version of HTML DB and let users edit all
    column attributes.While we are on the subject...
    Re-ordering columns on the report attributes page is a huge pain. Doing them one at a time and page refreshing after each up/down arrow is very very slow.
    Why dont you guys use some of the nifty drag-n-drop features from the Query Builder to do this re-ordering? That would be spiffy.
    Another option is to just add a editable text field on each row to represent the column sequence #. I could just re-order a bunch of columns by changing this sequence number and click Save and the page refreshes and re-orders the list by this sequence number. Of course, there would need to be some Javascript to ensure that I dont give the same sequence number to more than 1 row.
    [Netflix uses both the techniques above to let customers reorder movies in their queue]
    Thanks,
    Vikas

  • HT4061 How do I unlock my iPad? Unable to get serial number since I can't open iPad to get serial number to get help fixing problem.

    How do I unlock my iPad? Unable to get serial number since I can't open iPad to get serial number to get help fixing problem.

    What do you need the serial number for to unlock the iPad? If the iPad is locked because you forgot the Passcode, you have to restore the device.
    What are you trying to unlock?
    Your serial number is written on the back of the iPad and on the box that the iPad came in.

Maybe you are looking for