Implementing Interactive Reports Sorts in Report Query

My users love how the Interactive Reports work, especially being able to choose their sort fields. I have an Report Query that can use multiple sorts and many sort fields (chose from APEX page). Is it possible to implement this type of thing in the Report Query (without using decodes or dynamic SQL).
I looked at the code being executed by Interactive Reports and can see the order by changing
select
null as apxws_row_pk,
"CODE",
"CITY_NAME",
"STATE_CODE",
"PK_ID",
count(*) over () as apxws_row_cnt
from (
select * from (
select "PK_ID",
"CODE",
"CITY_NAME",
"STATE_CODE"
from "#OWNER#"."ZIP"
) r
) r where rownum <= to_number(:APXWS_MAX_ROW_CNT)
order by "CODE"

Ben, Not sure I follow.
I'm passing in the column names of the order by's from my APEX page to the DB function. Right now I'm doing a huge case statement for each one.
FUNCTION get_student_demographic (l_user in varchar2,
l_owner in varchar2,
l_report_order1 in varchar2,
l_report_order2 in varchar2,
l_report_order3 in varchar2,
l_report_order4 in varchar2,
SELECT (CASE l_report_order1
WHEN '%null%' THEN ''
WHEN 'LAST_NAME' THEN A.LAST_NAME
WHEN 'FIRST_NAME' THEN A.FIRST_NAME
..... many more
ELSE ''
END ) report_order1,

Similar Messages

  • APEX report sorting makes report slow

    Hi,
    I have some reports in APEX that are fast (3 sec) when I have no sorting enabled and they turn slow (20 sec) when I enable column sorting.
    The reports are based on data running over a DB-link, all tables come from the same DB-link. When I launch the queries (with filled in parameters) in SQL+ then it takes no more then 5 sec (with or without sorting). The result is about 1000 to 2000 records (only showing 25 in the report with pagination).
    How can I make the report fast (less then 5 sec) with sorting enabled?
    Is there any known bug in APEX that is the source of my problem?
    Thanks in advance.

    Good point, but I already have recreated the report (delete and recreate) with no result. Cause I know that sometimes the reports run slow, cause they are somehow confused with the sorting, and in most cases it helps to recreate the report (which resets the report ID, so that it's like clearing the user preferences).
    First I thougt it had to do something with the user preferences, but I think that it is something different.
    I really don't know how to explain the time difference between SQL+ and APEX.

  • ORA-06502 on  'SQL query' report with sort in 'Report Attributes'

    Hi All,
    We get the next error if we set sorting on a column in a 'Report' based on a 'SQL query'. Removing the sort, error disappeares:
    failed to parse SQL query:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    Any suggestions?
    Erik

    Erik,
    Thanks, this explains it. By specifying the request as part of your URL you run into the recently uncovered issue. The request you're setting is REMFROMLIST and ADD2LIST. You probably either have links that include those requests or you have branches where you specify them. Either way, in order to get reports sorting to work, you'll have to make sure that the request strings are not part of your URL. This is a work-around and the upcoming HTML DB patch release will solve this issue.
    One way of avoiding this is to have computations on the previous pages that set a napplication level or page level item to the REMFROMLIST and ADD2LIST values and then you can use those items for your conditions that are currently evaluating those strings.
    Hope this helps and sorry for the inconvenience,
    Marc

  • SAP CRM 7.0 - Interactive reporting tool enhancing reports with new fields

    Hi Everyone,
    I am a BW Professional, currently working on evaluating the true benefits of implementing Interactive Reporting tool for our company. As I understand the Interactive reporting tool restricts us to report on individual reporting areas like Activities, Leads, Opportunties etc.
    But according to our business it is very important for us to be able to report on cross reporting areas real time i.e. activities & leads together or activties, leads & opportunties together etc.
    I learned about the enhancement work bench in interactive reporting tool where we can add SAP fields to individual reporting areas, so I thought of adding leads & opportunties to activities. This is where the fun part starts.
    Here I learned that all activty ID, Lead ID and Oppo ID are all fed from one single field from SAP CRM i.e. OBJECT_ID, which means the system is dividing this data into individual reporting areas based on type of data i.e. leads or oppor's etc. and may be based on some key like account etc. So here is a technical question, for me to add a new field to a reporting area I have to give a field name but we already have OBJECT_ID from where I am pulling activties data, so if I want to include leads also in activties then I will have to add some logic manually to get that and can't use enhancement workbench because it is for missing fields from SAP CRM whereas in my case I already have OBJECT_ID from where I am getting Activity data.
    Sorry if I am driving you guys crazy but I am just trying to think loud to make myself clear with concepts.
    Also I have seen that a reporting area in Interactive reporting tool is based on a BW query, but I am not sure why not all the fields in BW query are available for reporting in Interactive reporting tool?
    Any help or commets will be greatly appreciated.
    Thanks & Regards,
    SRV

    Hello,
    checking with the config wizard is always a good idea since it's the only supported way to configure this scenario
    The secret is that you apparently did not activate the report areas. It is a bit missleading that the queries are checked before the report areas are checked, therefore you see the errors concerning the queries first. Below those errors you should find some lines like
        Report areas: delivered 15, active <?>
        CRM interactive reports: delivered 20, active <?>
        Activation of report areas checked
    The last line offers some documentation and the actual link to activate the report areas.
    Best regards

  • Null Index Error When Sorting Standard Report Column

    I have a page in one of my application that contains three reports in three seperate regions within the page. You only see one report at a time, however, and control which one you see based on a sidebar table containing links that call javascript functions to toggle the hiding/showing of each region.
    The problem stems from trying to use the standard column sort on any of the columns. When I click the column header in any of the the reports, the page submits the request to sort the column (for example: request="fsp_sort_6", etc...), and then the page refreshes with all three reports displayed. The report for which you actually 'clicked' a column header will be sorted. However the other two will display with an error (code ORA-06502) saying that the report cannot parse the query because of a null key index value in one of the corresponding tables being queried.
    The weird thing is - this only happens on other computers - not when I'm on my workstation developing in my apex workspace/schema. I've even given each of the three reports a seperate static ID attribute so that I can identify each using those unique IDs.
    I have to say - I am stumped. Any help would be much appreciated. If you need more details, feel free to respond to this thread.
    Thanks!

    What version of APEX are you using? This was supposed to be fixed in 3.1 however it isn't because we still experience it sometimes, we just have never been able to re-create it in order to raise an SR. Getting to the bottom of this would be fantastic for us as it's the one thing which makes me extremely nervous of implementing new applications which are production-critical. The only workarounds are to flush the SGA or edit the report in production so the query is different (usually just fetch back null somewhere and then hide the column). This clearly isn't acceptable however without a reproducable test case there isn't much which can be done! :(

  • Two problmes between  Crystal Reports 2008 and Bex Query

    Hi Gurus.
    I have two problems with Crystal Reports 2008 when It obtains data from a Bex Query (SAP MDX query connection).
    1)     I have defined some Parameters Fields using the follow options:
    Type: String
    List of Values: Dynamic
    Value Options Level1:
                         Show on (Viewer) Panel :Editable
                          Prompt text: <text>
                          Sort Order: Ascending by value
                          Prompt With description Only : False
                          Optional Prompt: True
                          Allow multiple values: True
                          Allow discrete values: True
                          Allow range values: False
    When I execute the report with the client of Crystal Reports 2008 (the developer tool), in the initial screen shows a list box where I can select the values from the left box and add it to the left box (as a usually filter). When the number of options (LOV) is more than  the maximum of the system, I have a input box bellow the list box, where I can insert any value (manually) and a button to insert it into the left box. When I publish the Report in the infoview, this filter is modified and the input box where I can introduce manually values is not showed and I can insert only the values showed in the list box, it causes that I can`t select a lot of values that is in the master data of SAP BW, because they arenu2019t listed in the list box.
    There is any option to ability this option in the infoview.
    2)     My Bex query, have a date filter with variable in the restricted key figures, when I execute a Crystal Reports, the infoview (and the Crystal Reports 2008 designer) ask me 2 times the same date, first only the date and second the date and the rest of parameters (introduced in the report of Crystal Reports).
    Why I need insert the date 2 times? How can I modify the Crystal Report for ask me only one time all the parameters?.
    Thanks.

    Hi Abhilash.
    Thank you for your information.
    1) Yes, the parameters are created in the Crystal Reports designer. I have created the parameters in the Crystal Report because I use the same Bex Query to create some Crystal Report, in other case, I will need create some Bex Query.
    2)The Bex query has the date filters and I have created some filters in Crystal Reports designer, the date filter from the Bex query is created automatically in the Crystal Report Designer but I don't use it, I haven't created it anytime. I use my filters only in the record selection. The date filters from the Bex query is showed as Static, and I can`t delete it, if I modify the parameter to dynamic or static with values, at first step ask me again static without values and the second step of the report execution ask me the parameter as I have defined in Crystal Reports Designer, my parameters fields are dynamic. A lot of reports have subreport, but I have created one of them without subreport (to trial) and the Crystal Reports ask me the date filters at first execution, and when I insert the date filters, in the second step, ask me the date filters again and my parameters fields again.
    Thank you again.

  • Sort in Report not working correctly

    I have a report with many sorts selected as an option within the reports attributes. However, some of the columns does not seem to be sorting at all when Selected (Others do as expected)
    For example one column is a VARCHAR2
    examples of values within this column would be
    (FY08Q1, FY09Q4, FY08Q2)
    with the sort ticked in the report attributes i would expected it to perform the following
    FY08Q1
    FY08Q2
    FY09Q4
    which it does in the SQL Command - just not in the report in the Application.
    Anyone know as to a reason why it may be doing so?
    cheers
    s

    Hi
    I just created a test table, called datetest, with one column, called quarter. I inserted your data in the following order:
    FY08Q1
    FY09Q4
    FY08Q2
    I tested in SQLPlus that it returned ordered data ok with Select quarter from datetest order by 1, this worked.
    I then created a simple report based upon the query used in the previous paragraph and the report ordered the data correctly, i.e:
    FY08Q1
    FY08Q2
    FY09Q4
    Can you post your query as I can't work out what is wrong here?
    Thanks
    Karen

  • Sorting in report 10g?

    Hello Experts,
    Could you please help me? Is there a way to sort Oracle report by formula column? We selecting some columns in the report and one of the columns is a complicated select from different tables returning value. We want to sort the report by this column. How to do that?
    Thanks for your help.
    Yash

    Hello,
    You can move the formula column at the top of the query and the select its Break Order property(more on this in Reports Builder Help Contents).
    Regards,
    Alex
    If someone's answer is helpful or correct please mark it accordingly.

  • Interactive VS. Classic Report

    Hi all,
    I have created both interactive report and classic report on the same table just for testing.
    http://apex.oracle.com/pls/apex/f?p=53917:1
    You can see that the interactive report has link to single row view. How can I make my classic report to have this kind of link also?
    Can you edit my apps please >
    At:
    Check this: http://apex.oracle.com/pls/apex/
    Workspace: APEX40WS
    Username: USER
    Password: apex_demo
    Application: Application: 53917 - TEST02
    Thanks
    Edited by: KinsaKaUy? on 15-Aug-2011 03:17

    KinsaKaUy? wrote:
    Hi all,
    I have created both interactive report and classic report on the same table just for testing.
    http://apex.oracle.com/pls/apex/f?p=53917:1
    You can see that the interactive report has edit link. How can I make my classic report to have edit link also?It's not necessarily an edit link. In that case it's simply a single row view.
    Take a look at creating a page/region using the Form > Form on a Table with Report wizard, selecting "Classic" for the Implementation option.
    To add links to existing standard reports, use Column Links.
    Can you edit my apps please > Please explain exactly how that will help you?
    If someone else does the work on apex.oracle.com, how are you going to know how to reproduce it in your own environment?

  • Sorting the report by clicking the column header

    Hello,
    Currently working on a requirement where i need to sort the report by clicking the column header. Can anyone please help me on this.
    Suppose i have 3 colums deptno,dname,sal fields in my report. if i click deptno column header,  report has to sort by deptno.Like that i need for other columns also.
    Any help is really appreciated
    Thanks
    Ram

    Hello,
    You can sort the fields using method suggested by Cauvery. However if you would like to have Ascending/ Descending sort order control at column header, then would require to implement few additional steps.
    First do the sorting of field using the way suggested by Cauvery. Once sorting is done, right  click on the column name and  select the option ' Bind Sort Control'. You will see the sorted field in the window. select the field and click ok.
    Now you would get 2 arrows on column. If you click upper arrow, fields would be sorted in Ascending Order and if you click on down arrow, it would  be in Descending order.
    Regards,
    Chinmay Athavale

  • How to handle interactive list in alv reports

    hi experts.
    how to handle interactive list in alv reports.
    regards.
    subhasis

    HI Subhasis,
    below is the sample code for handling an interactive ALV report, hope this helps you ..
    REPORT  ZTEST_ALV123.                           
    TYPE-POOLS:SLIS.
    DATA :   IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
              IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
    DATA: BEGIN OF ITAB OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           POSNR LIKE VBAP-POSNR,
           END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0,
           VBELN LIKE LIKP-VBELN,
           POSNR LIKE LIPS-POSNR,
           VGBEL LIKE LIPS-VGBEL,
           VGPOS LIKE LIPS-VGPOS,
           END OF ITAB1.
    DATA: IT_LIPS LIKE ITAB1 OCCURS 0 WITH HEADER LINE.
    SELECT  VBELN
            POSNR
            FROM VBAP
            INTO TABLE ITAB.
    IF SY-SUBRC = 0.
      SORT ITAB BY VBELN .
      SELECT VBELN
       POSNR
       VGBEL
       VGPOS
       INTO TABLE ITAB1
       FROM LIPS
       FOR ALL ENTRIES IN ITAB
       WHERE VGBEL = ITAB-VBELN
         AND    VGPOS = ITAB-POSNR.
    ENDIF.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS  = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS  = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        I_CALLBACK_PF_STATUS_SET = 'PFSTATUS'
        I_CALLBACK_USER_COMMAND  = 'HANDLE_USER_COMMAND'
        IT_FIELDCAT              = IT_FIELDCAT
      TABLES
        T_OUTTAB                 = ITAB
      EXCEPTIONS
        PROGRAM_ERROR            = 1
        OTHERS                   = 2.
    IF SY-SUBRC  = 0.
    ENDIF.
    *&      Form  POPUP
          text
         -->P_EXTAB    text
    FORM POPUP USING P_EXTAB TYPE SLIS_T_EXTAB.
    "here double click on PFSTATUS and create the status, "activate, before that set PICK for choose(F2).
    *- Pf status
      SET PF-STATUS 'PFSTATUS'.
    ENDFORM.                 " POPUP
    *&      Form  HANDLE_USER_COMMAND
          text
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    FORM HANDLE_USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                                   RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          IF RS_SELFIELD-FIELDNAME = 'VBELN'.
            READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
            LOOP AT ITAB1 WHERE VGBEL = ITAB-VBELN
                              AND VGPOS = ITAB-POSNR.
              MOVE-CORRESPONDING ITAB1 TO IT_LIPS.
              APPEND IT_LIPS.
            ENDLOOP.
            PERFORM INTERACTIVE_REPORT.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "HANDLE_USER_COMMAND
    *&      Form  interactive_report
          text
    FORM INTERACTIVE_REPORT .
      X_FIELDCAT-FIELDNAME = 'VBELN'.
      X_FIELDCAT-SELTEXT_L = 'VBELN'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 1.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'POSNR'.
      X_FIELDCAT-SELTEXT_L = 'ITEM'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 2.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'VGBEL'.
      X_FIELDCAT-SELTEXT_M = 'SO #'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 3.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-FIELDNAME = 'VGPOS'.
      X_FIELDCAT-SELTEXT_M = 'SO ITEM'.
      X_FIELDCAT-TABNAME = 'IT_LIPS'.
      X_FIELDCAT-COL_POS  = 4.
      APPEND X_FIELDCAT TO IT_FIELDCAT1.
      CLEAR X_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = SY-REPID
          IT_FIELDCAT        = IT_FIELDCAT1
        TABLES
          T_OUTTAB           = IT_LIPS
        EXCEPTIONS
          PROGRAM_ERROR      = 1
          OTHERS             = 2.
      IF SY-SUBRC  = 0.
      ENDIF.
    ENDFORM.                    " interactive_report
    Regards,
    Ranjita
    null

  • Can we sort saved report list by name

    Hi,
    I have interactive reports and users can open this interactive report and according to their different requirements they can save this report(as a public) with different names.
    Ex: interactive reports
    Reports(lov) :1.Primary report
    2.xxx test
    3.yyyy
    4.abcd test
    5.zzzz test
    Can we sort saved report list by name?
    Could you please guide me to achieve this requirement.
    Thanks in advance.
    Regards
    Narender B

    Narender wrote:
    Hi,
    I have interactive reports and users can open this interactive report and according to their different requirements they can save this report(as a public) with different names.
    Ex: interactive reports
    Reports(lov) :1.Primary report
    2.xxx test
    3.yyyy
    4.abcd test
    5.zzzz test
    Can we sort saved report list by name?
    Could you please guide me to achieve this requirement.It's a lot easier to do so if the following information is provided (as has been repeatedly pointed out to you):
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    Sorting of the saved report list by report name was introduced in APEX 4.1.

  • Classic Report Sort problem

    I have a classic report that retrieves data based on the value in an item. When the page first opens the report retrieves properly. However, the strange thing is when I try to sort the rows by pressing the column header, I receive "No Data Found".
    The report is just very basic. Selecting a few columns from a table where ID = :P3_ID.
    If I change the where clause to be WHERE ID like '%' || :P3_ID, when it initially retrieves, I receive the data for the value in P3_ID. However, when I sort the report by a column header, it retrieves everything. It is as if P3_ID has been set to NULL or a blank eventhough it displays the proper ID.
    Any ideas?
    Thanks,

    Hi Brian,
    see the following thread Interactive Reports: problem with textfield as parameter for an explanation
    Patrick
    *** New *** Oracle APEX Essentials *** http://essentials.oracleapex.info/
    My Blog, APEX Builder Plugin, ApexLib Framework: http://www.oracleapex.info/

  • Styling report rows using the query result

    Hello, is it possible to style a row in a report using the values returned by the underlying sql query?
    For example, if my query returns a column called ROW_CLASS I would like to use the placeholder #ROW_CLASS# to style the row, e.g. specifying the row class.
    Apparently such row attributes are not available to the apex developer. For each single column value I can set the "Tabular Form Attributes" and "Column Formatting", but I cannot set anything on the whole row.
    In other words I can style the TDs but not the TRs.
    I think this is clearly a "missing feature" that should be there, single the APEX engine that turns the query result into the HTML that displays the table can already access the column values via their placeholders. It would be sufficient to add some "row attributes" or "row class" field in the report.
    It could be used for lots of useful things, in my particular case, highlighting rows that contain errors.
    Also there is no way to perform that operation in CSS (e.g. get the TRs which contain at least one TD of class "ROWERROR"). I know it could be done in JS, but that's very messy for such a simple declarative problem.

    GChierico wrote:
    Hello, is it possible to style a row in a report using the values returned by the underlying sql query? Yes, for standard reports, using custom report templates: +{thread:id=2493917}+
    Interactive reports require the use of Dynamic Actions/jQuery.

  • Implement simulation function by BO reports.

    Hi,experts.
    We want to display BO reports over SAP Enterprise Portal,
    and implement simulation function by BO reports.
    Simulation Function I mean is that
    graph and table are displayed on the same screen,
    and synchronizes graph and data of table when data of table is changed by manual operation.
    For this,what components or products do we need ?
    Can we implement simulation function by Web Intelligence or Cryatal Report as well as Xcelsius ?
    And is it possible this only BO integration Kit for SAP ?
    thanks,
    Shingo

    Hi,Ingo
    Thank you for your help.
    We think about the following scenario.
    ①create BI Query with ERP data.
    ②Based on this Query, create BO report and Xcelsius for analyze and simulation.
    ③Refer and Simulation them through SAP Enterprise Portal.
    To achieve this scenario, we will prerare these products and components.
    Business Objects
         ・BusinessObjects Enterprise XI R2
         ・InfoView / Web Intelligence
         ・Crystal Reports XI R2
         ・Query as Web Service
         ・Live Office
         ・Crystal Xcelsius
            ・BO Integration Kit for SAP
    SAP
         ・NetWeaver 2004s SP13 (NW04s)
         ・BI 7.0
         ・Business Content 7.03
         ・SAP Enterprise Portal
    If simulation function can achive by Crestal Report or Web Intelligence,
    we don't need Xcelsius.
    Thanks,
    Shingo

Maybe you are looking for

  • String parsing method

    Hi, Lets suppose I have the following string inputs: 12345600 43121000 12093230 12340000 I need to write a methode that the input convert to the following output: 12.34.56 43.12.10 12.09.32.30 12.34 So if you have two (four) succesive zeros at the en

  • Track nokia gps enabled phone from pc

    hey, im starting this post to get info for me and for others because i believe that this is such an important feature in our nokia phones that we must maximise. my question is, are there any programs where users can track there gps enabled phones fro

  • Difference Between SAP ERP Financial & SAP Business One ERP?

    Hi Everyone I am very new in the world of SAP, I just want to know what is the difference between SAP ERP Financial and SAP Business One??? Thanks in advance Cheers

  • Edit with Fireworks

    There is no "edit in fireworks" command on this context menu even though I have Fireworks installed. I only have "edit with . . ." and it makes me choose the external program .exe file every time I need to edit an image. How can I define an editor? I

  • Need to create a slideshow that plays on DVD...

    I need to create a slideshow with about 100 images with music background. I need this to be on a DVD that can be played in any dvd player. iDvd is crap because of the backgrounds and stuff. Not sure how or if iMovie will work for this. I know I can c