Bug in Classic Report based on Function?

As a simple example, suppose I want a classic report in which I can change the sort field by selecting from the item P1_SORTFIELD. In Apex 4.2 I was able to implement the report using the PL/SQL function
return 'select ENAME, SAL from EMP order by ' || :P1_SORTFIELD;
I cannot do this in Apex 5 on my apex.oracle.com workspace. I either get an "SQL command not property ended" runtime error if I use generic column names, or "not all variables bound" parse error if I don't.
My real application uses generic column names, so I am most interested in a solution to that.  For example, I tried creating a report having the source
return 'select ENAME from EMP order by ENAME';
If I run it using generic column names I still get the "SQL Command not properly ended" runtime error.
Is this a bug??
Ed Sciore

Ed Sciore wrote:
As a simple example, suppose I want a classic report in which I can change the sort field by selecting from the item P1_SORTFIELD. In Apex 4.2 I was able to implement the report using the PL/SQL function
return 'select ENAME, SAL from EMP order by ' || :P1_SORTFIELD;
I cannot do this in Apex 5 on my apex.oracle.com workspace. I either get an "SQL command not property ended" runtime error if I use generic column names, or "not all variables bound" parse error if I don't.
My real application uses generic column names, so I am most interested in a solution to that.  For example, I tried creating a report having the source
return 'select ENAME from EMP order by ENAME';
If I run it using generic column names I still get the "SQL Command not properly ended" runtime error.
I cannot reproduce the same error messages in my workspace on apex.oracle.com.
The basic problem here is that the function body will not return a syntactically correct SQL query if the session state value of P1_SORTFIELD is not a valid sort expression for the query. This will always be the case when the region source is validated in the App Builder, and also if P1_SORTFIELD is null at runtime. The solution is to ensure that the function body always returns a valid query irrespective of the value of P1_SORTFIELD:
return 'select ENAME, SAL from EMP' || nullif(' order by ' || :p1_sortfield, ' order by ');
Here is another weird thing. I looked at my Apex 4.2 application that got transferred over to Apex 5. The region that does the dynamic sorting still works. But now I just created a new region on that page that has the same source, and as far as I can tell, exactly the same properties. And this region gives me the runtime error. The URL is apex.oracle.com/pls/apex/f?p=80034:33 if that helps.
Given that I can't reproduce your results based on the information provided, I think we'd need access to the app in your workspace in debug mode to investigate this fully.

Similar Messages

  • Refresh classic report based on select list value selected

    hello,
    can anyone please help me out with this issue. I have a parameterized classic report based on a select list and I want to refresh this report whenever the select list value is changed. I am using oracle apex version 3.2. i just want to have a javascript function onchange event for the select list which refreshes my report whenever a value is selected.
    My select list item is p1_datastore
    select distinct datastore d,datastore r from my_table1 order by 1;
    My classic report query is
    select * from my_table2 where datastore = :p1_datastore order by last_updated_dt desc;
    ****************************************************thanks,
    orton

    can anyone please help me out with this issue.
    thanks,
    orton

  • Show / Hide DOWMLOAD link in classical report based on user rights

    Hi,
    using apex 4.1.
    How i can display or hide download link in classical report based on user rights .
    The User who has download rights ,can download the data from classical report Otherwise it should hide.
    I have passed the code in authorization scheme in shared component as named "VIEW"
    DECLARE
    VNAME VARCHAR2(1000);
    BEGIN
    SELECT PAGE_NAME INTO VNAME FROM APEX_APPLICATION_PAGES WHERE PAGE_ID = :APP_PAGE_ID AND APPLICATION_ID = :APP_ID;
    return GET_ADMIN_STATUS_VIEW_NEW(:APP_USER,VNAME);
    END;How i can call "VIEW'' name in download link.

    Right click on the export link, select copy url. Create a button with redirect to URL. Use that URL (or at least everything with and after f?p). Bind rights to the button.
    Or create a second identical report with different rights, give one export enabled and one disabled. The first is better, the second is easier :)
    Edited by: Joni Vandenberghe on 8-feb-2013 5:08

  • Highlight  a row in classic report based on condition

    HI all Gurus
    Using Apex 4.1.1 oracle 11g linux oc4j
    I want to highlight a row where #column_value#='Y' to grey  keep others as normal report settings.
    I have a simple sql query
    SELECT PK_ID,
      FIRST_NAME,
      LAST_NAME,
      INITIAL_REG_DATE,
      MAIL_DATE,
      BEGIN_DATE,
      END_DATE,
      END_DATE-BEGIN_DATE as "#days",
      BEGIN_STATUS,
      END_STATUS, 
      COMMENTS,
      DELETE_FLAG,
    case when  DELETE_FLAG='Y' then 'GREY' else '#f0f0f0' end  DELETE_FLAG ,
    INITIAL_REG_DATE+(END_DATE-BEGIN_DATE) "New Reg end date"
    FROM SOR_TRACKING_DEL
    where pk2_id =:P216_Detail
    order by mail_Date desc
    I created a Dynamic action
    which will fir on on load , BIND on this classic report
    $("input[name=f29]").each(function(){ 
    var lThis=$(this); 
    if(lThis.is("Y")){ 
      lThis.parents("tr:eq(0)").children("td").css({"background-color":"GREY"}); 
    } else { 
      lThis.parents("tr:eq(0)").children("td").css({"background-color":"#f0f0f0"}); 
    But this is not changing color as expected..
    Kindly help me !
    Thanks

    Scott and Tom
    Thanks you guys for looking into this.
    Pls ignore my improper explanation and my inexperience with jquery.
    I read some blog and was trying to do same on classic report but all blogs I found so far referred either interactive report or tabular report none of them mentioned classic report.
    I guess using array for classic report wont be a good idea to start with. :/
    I am not sure if this is right syntax and logic to highlight the row
    $(function(){
    var DELETE_FLAG = $(this);
        if DELETE_FLAG.is("Y"))
      DELETE_FLAG.parents("tr").children("td").css({"background-color":"GREY"});
    I also created app here
    http://apex.oracle.com/pls/apex/f?p=35155
    workspace sors
    user tester/testing
    application 35155
    Thanks again.

  • How to color single column cells with different colors in classic report based different conditions

    Hi ,
      Am working on Oracle Apex 4.2 version. Am trying to generate a  classic report with different cell colors based on the conditions.
      I tried the solution provided in the below link.
      https://forums.oracle.com/message/9518723#9518723.
      I tried the same query given in that link.
       SELECT e.*,
      CASE
        WHEN sal < 1000
        THEN 'red'
        WHEN sal BETWEEN 1000 AND 2000
        THEN 'yellow'
        WHEN sal > 2000
        THEN 'green'
      END the_color
    FROM emp e
      And, I hidded the column 'the_color' in Report Attributes,
              the Column Template1 has the code , <td #ALIGNMENT# headers="#COLUMN_HEADER_NAME#">#COLUMN_VALUE#</td>.
    After this, what are the steps did I miss here. Because am not getting the report which I need.
    Kindly do provide solution.
    Thanks,
    yashu.

    SAL column values should visible with different color based on the conditions. Same way i did in my report it was working for me. Please refer the below links for more information,
    https://forums.oracle.com/thread/1047891
    http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:351800346145832
    Thanks
    Lakshmi

  • Classical Report Expand-Collapse functionality

    Hi All!
    I am doing a program that displays a classical report as an output.  It has buttons on the top of the output (using Menu Painter) and it has "Expand" and "Collapse" buttons.  I do not know how to implement this expand and collapse functionality.  Please help.
    The output of the report looks like this:
    Plant: <data>
    <data>
    <data>
    Plant: <data>
    <data>
    <data>
    When I click on "Expand" button, the output will look like the one above.  When I click on "Collapse" button, the output will look like this:
    Plant: <data>
    Plant: <data>
    Please help me achieve this functionality.
    Thank you!

    Hi,
    Try this sample code....
    DATA : BEGIN OF itab OCCURS 0,
           state   TYPE char20,
           city    TYPE char18,
           flag,
           END   OF itab.
    DATA   disptab LIKE itab OCCURS 0.
    DATA   sel_lin TYPE char20.
    START-OF-SELECTION.
      itab-state = 'Tamil Nadu'.
      itab-city  = 'Chennai'.
      APPEND itab.
      itab-state = 'Tamil Nadu'.
      itab-city  = 'Coimbatore'.
      APPEND itab.
      itab-state = 'West Bengal'.
      itab-city  = 'Kolkata'.
      APPEND itab.
      itab-state = 'West Bengal'.
      itab-city  = 'Durgapur'.
      APPEND itab.
    END-OF-SELECTION.
      LOOP AT itab.
        AT NEW state.
          WRITE /3 itab-state COLOR 4 HOTSPOT.
        ENDAT.
      ENDLOOP.
    AT LINE-SELECTION.
      MOVE sy-lisel+2(20) TO sel_lin.
      LOOP AT itab.
        AT NEW state.
          WRITE /3 itab-state COLOR 4 HOTSPOT.
        ENDAT.
        IF itab-flag <> 'X'.
          IF itab-state = sel_lin.
            itab-flag = 'X'.
          ENDIF.
        ELSE.
          IF itab-state = sel_lin.
            itab-flag = ' '.
          ENDIF.
        ENDIF.
        IF itab-flag = 'X'.
          WRITE /5 itab-city  COLOR 2.
        ENDIF.
        MODIFY itab.
        CLEAR itab.
      ENDLOOP.
    Cheers,
    jose.

  • We work with SRM 5 Ext' Classic & report based on organization plan

    Hello expert,
    We work with SRM 5 Extended Classic scenario and BW for reports.
    We have a lot of purchasing types and we need a good report that can give as a clear picture of the purchasing process according to the organization units (departments). We have one purchase organization and a lot of purchase groups,  and the way that the system is built doesnu2019t support this requirement. We need a report that is based on the organization plan.
    For example:
    We need the option to extract all HR unit purchase documents or all direct supply goods that are purchased by the supply chain department. The report also needs to give a clear picture of the purchase operations and costs of every unit.
    Thanks,
    Gil

    Closed but Unanswered

  • Report based on function returning query

    Hi all,
    I created a function FCT_1 in a package PKG, here is an exemple :
    function FCT_1(te in number) return varchar2
    is
    q varchar2(4000);
    begin
    if te = '1' then
    q := 'Select * from Clientele';
    else
    q := 'Select * from Compagnie';
    end if;
    return q;
    end;
    And I call this function the region source of my report like this :
    Declare
    q varchar2(4000);
    Begin
    q:=PKG.FCT_1(:P2_Nb); -- P2_Nb = 1 or 2
    return q ;
    end;
    But I got this error :
    report error:
    ORA-01403: no data found
    I need your help.
    Benn

    I got it,
    I just use the Use Generic Column Names (parse query at runtime only) option.
    I don't know why do I have to do it.
    Thanks
    Benn

  • Radio group in classic report based on another column on the same row.

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Application Express 4.1.0.00.32
    How can I have a radio group column based on an LOV utilizing another column on the same row of the report?
    For example: what if I had a survey application and depending on the likert scale that was assigned to the question there would be different possible answer choices:
    Question 1 on row 1 of the report: The class instructor was friendly?
    Likert scale choice is Agreement.
    Choices on Radio Group: Strongly Agree, Agree, Undecided, Strongly Disagree
    Question 2 on row 2 of the report: The class offered good materials?
    Likert scale choice is Quality.
    Choices on Radio Group: Excellent, Below Average, Average, Above Average, Excellent
    The radio group can change per row depending on the Likert scale assigned to the question which is assigned to a different column on the row.
    Can LOV utilize the column? :
    SELECT scale_text
    FROM scale_choices
    WHERE scale_category_choice_id = 2 <<= this would be the Likert scale identifier
    ORDER
    BY display_order

    Here is the answer:
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
    p_idx IN NUMBER,
    p_value IN VARCHAR2 DEFAULT NULL,
    p_query IN VARCHAR2,
    p_attributes IN VARCHAR2 DEFAULT NULL,
    p_show_null IN VARCHAR2 DEFAULT 'YES',
    p_null_value IN VARCHAR2 DEFAULT '%NULL%',
    p_null_text IN VARCHAR2 DEFAULT '%',
    p_item_id IN VARCHAR2 DEFAULT NULL,
    p_item_label IN VARCHAR2 DEFAULT NULL,
    p_show_extra IN VARCHAR2 DEFAULT 'YES')
    RETURN VARCHAR2;

  • Custom report based on function returning cursor

    Hi,
    I'm trying to create a generic function that will be the basis of a custom report in Grid Control.
    The idea is to pass in a database link name, then the function builds a cursor to select using that name, and returns the result to Grid control to render.
    At the moment all I get is an empty table.
    My function is defined as follows:
    create or replace function list_databases(p_dblink varchar2) return sys_refcursor
    is
    db_name varchar2(40);
    c_cursor sys_refcursor;
    v_query varchar2(100);
    begin
    v_query := 'select name from rc_database@'||p_dblink;
    open c_cursor for v_query;
    return c_cursor;
    end;
    The custom report contains a 'Table from SQL' type, with the following sql statement:
    select sysman.list_databases('rmancat_test') from dual
    I've tried playing around with the ??EMIP_BIND_RESULTS_CURSOR?? bind variable but it only seems to work if I write the pl/sql block in the custom report, rather than going for a generic function.
    Any ideas are most welcome.
    Chris

    Why not use a simple procedure to achieve the same thing?

  • Classical Report on clicking button on ALV Report

    I have a requirement where I have to display a classical report based on the user-click on a "custom button" on my ALV. I am unable to display the classical report. Please help with code example..

    Hi,
    See the example.Change the code according to your requirement.
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.
    endform.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
          Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
          Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    Pls. reward if useful...

  • APEX BUG in export report region  to CSV

    Upgraded to APEX 4.1 but I have the same problem !!!!
    any help ????
    regards
    saverio
    ==============================================
    Hy all,
    I have a Classic report based on a PLSQL function returning SQL query. (APEX 4.0)
    The query is like this (it is just an example; at the bottom of the post I attach my real query)
    select * from (select c1,c2,c3
    from table1
    where c1 in (select c from table2 where ct2 = :P0_ITEM1)
    where instr(upper(c2),upper(nvl(:P5_REPORT_SEARCH,"c2"))) > 0
    where P0_ITEM1 is an item in page 0 and P5_REPORT_SEARCH is an item in my page (where I have the report) used to "filter" the rows.
    The report is OK; it is correctly displayed and the number of rows are correct (filtered by the where clause)
    but when i try to export it to CSV i get a wong number of rows.
    It seems that the where conditions (both) are NOT applied and in the CSV file I get all the rows of my table1.
    The report have 2 break colum (c1 and C2).
    Any idea of what is wrong ?
    regards
    saverio
    =============================
    My real query is that:
    declare
    q varchar2(4000);
    w varchar2(4000);
    w2 varchar2(4000);
    begin
    q:=' select * from (select "COSTIFISSI_COMMESSE"."ANNO" as "ANNO",';
    q:=q||' "COMMESSE"."CODICE" as "CODICE",';
    q:=q||' "CLIENTI"."DESCRIZIONE" as "NOME_CLI",';
    q:=q||' "COMMESSE"."CODICE_COMFME" as "CODICE_COMFME",';
    q:=q||' "COSTIFISSI_COMMESSE"."CODICE_COMF" as "CODICE_COMF",';
    q:=q||' "COSTIFISSI_COMMESSE"."M01" as "M01",';
    q:=q||' "COSTIFISSI_COMMESSE"."M02" as "M02",';
    q:=q||' "COSTIFISSI_COMMESSE"."M03" as "M03",';
    q:=q||' "COSTIFISSI_COMMESSE"."M04" as "M04",';
    q:=q||' "COSTIFISSI_COMMESSE"."M05" as "M05",';
    q:=q||' "COSTIFISSI_COMMESSE"."M06" as "M06", "COSTIFISSI_COMMESSE"."M07" as "M07",';
    q:=q||' "COSTIFISSI_COMMESSE"."M08" as "M08", "COSTIFISSI_COMMESSE"."M09" as "M09",';
    q:=q||' "COSTIFISSI_COMMESSE"."M10" as "M10", "COSTIFISSI_COMMESSE"."M11" as "M11",';
    q:=q||' "COSTIFISSI_COMMESSE"."M12" as "M12", "COMMESSE"."AREA" as "AREA", ';
    q:=q||' nvl(m01,0)+nvl(m02,0)+nvl(m03,0)+nvl(m04,0)+nvl(m05,0)+nvl(m06,0)+nvl(m07,0)+nvl(m08,0)+nvl(m09,0)+nvl(m10,0)+nvl(m11,0)+nvl(m12,0) as Tot_Anno';
    q:=q||' from "CLIENTI" "CLIENTI", "COMMESSE" "COMMESSE", "COSTIFISSI_COMMESSE" "COSTIFISSI_COMMESSE" ';
    w:=' where "COSTIFISSI_COMMESSE"."CODICE_COMR"="COMMESSE"."CODICE" and     "COMMESSE"."COD_CLIENTE"="CLIENTI"."CODICE_SIAL"';
    if :P0_RUOLO ='SM' then
    w:=w||' and codice in (select codice from commesse where sm in (select matricola from lavoratori where upper(uid_ldap)= '''||upper(:APP_USER) ||''' ))' ;
    elsif :P0_RUOLO ='AREA' then
    w:=w||' and codice in (select codice from commesse where area = '''||:P0_AREA||''' )';
    elsif :P0_RUOLO ='ADM' then
    null;
    end if;
    w:=w||')';
    w2:=' where ( ';
    w2:=w2||' instr(upper("AREA"),upper(nvl(:P5_REPORT_SEARCH,"AREA"))) > 0 or ';
    w2:=w2||' instr(upper("CODICE"),upper(nvl(:P5_REPORT_SEARCH,"CODICE"))) > 0 or ';
    w2:=w2||' instr(upper("NOME_CLI"),upper(nvl(:P5_REPORT_SEARCH,"NOME_CLI"))) > 0 or ';
    w2:=w2||' instr(upper("CODICE_COMFME"),upper(nvl(:P5_REPORT_SEARCH,"CODICE_COMFME"))) > 0';
    w2:=w2||' )';
    q:=q||w||w2;
    return q;
    end;
    Edited by: tirone on 9-giu-2011 23.44
    Edited by: tirone on 29-giu-2011 9.15
    Edited by: tirone on 27-ott-2011 5.15
    Edited by: tirone on 2-nov-2011 6.53

    thanks for your answer,
    but my problem is that I get (only in the CSV file) a superior number of lines to how much I expected me, NOTsuperior.
    Aniway i set the maximum row count in report attributes to 50000, but the problem is not solved.
    regards
    saverio

  • How to Link column header only in classic Report in APEX 4.1

    Hello Everybody,
    Probably there is a simpler way to do this, but I am not sure. I want a link on column header in Report on a specific column. The link will take me to new region or a page.
    How to achieve this in APEX 4.1
    Theme : Blue 2
    Database 11g
    I see there is a column link opiton, but that creates link for every row in that column on a specific icon, I just want link on a title of the column in Classic Report.
    For Example,
    if there are two columns Name and Client ID, which has 10 records to display on a classic report. I wan the link on Client ID on header only not on the records.
    Can anybody provide some simple solution for this.
    Thanks,
    --CP
    Edited by: cpora007 on Jun 22, 2012 10:38 AM

    Hello,
    I didn't understand, what do you mean by default it is going to sort popup. I have a classic report based on SQL, which generates a report with static header, there is no sort or any other link on that.
    I added a link in column header name with an anchor. It works and takes to the new page.
    But it is not a proper solution. A solution based on Jquery dynamic action is preferable. Also the preferred option is that the link opens a hidden region of the same page at the same location of the report and the report gets hidden. after the procession on the form region and submitting the update/ insert process. the report region shows up with the change data.
    Moving on to new page is 2nd option, if the first do not work.
    In the JavaScript, put: apex.submit("GO_TO_MY_OTHER_PAGE");
    On the page, create a Branch to the Second page. Set the condition to Request=Expression 1. Set the request to "GO_TO_MY_OTHER_PAGE"
    On which page I need to create a branch?, Is it on the report page or the form page.
    Thanks a lot for the response. I appreciate your kind efforts in this regard.
    --CP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need a Little Help embedding a Hyper Link in Report  based on Dynamic SQL

    I am trying to have a column in my report link to a document on my network when the column in the report is clicked. I have a table that contains a row for each document I want to link to. The URL to the document is stored in a column named NDDL.DOC_LINK. I would like the text "Linked" to appear as the value in the report column and to be a hyper link to the document.
    The report is a "Classic Report" based on PLSQL retuning a SQL stament. I am on Apex version 4.2.1.00.08
    I have been fighting with the '''''' stuff and can not get it worked out. have pasted the line in question but I can not get it to display correctly so I am hoping someone can help out.
      q := q || '  NDDL.DOC_TITLE as FILE_NAME, ';
      q := q || '  NDDL.DOC_DESC, ';
      q := q || '  ''<a href="http:'' || NDDL.DOC_LINK || ''target="_blank"> </a>'' as LINKED , ';
      q := q || '  NDDL.MOD_DATE, '; 
    ...The # in the line above should be:
    {code}
    http:'' || NDDL.DOC_LINK || ''target="
    Thanks!
    Edited by: Sky13 on Mar 7, 2013 12:45 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I anwered your email. The PL/SQL block is like this:
    /* Formatted on 2013/03/07 23:05 (Formatter Plus v4.8.8) */
    DECLARE
       q   VARCHAR2 (4000);
    BEGIN
       q := 'select * from ( ';
       q := q || 'select ';
       q := q || '  NDDC.NDDC_UID, ';
       q := q || '  NDDC.NDND_UID, ';
       q := q || '  NDDC.LSVL_DOC_CAT_UID, ';
       q := q || '  NDDC.DATE_POSTED, ';
       q := q || '  NDDC.CREATE_DATE, ';
       q := q || '  NDDC.CREATE_BY, ';
       q := q || '  NDDC.MOD_DATE, ';
       q := q || '  NDDC.MOD_BY, ';
       q := q || '  NDDC.MIME_TYPE, ';
       q := q || '  NDDC.FILE_NAME, ';
       q := q || '  NDDC.CHARACTER_SET, ';
       q := q || '  NDDC.BLOB_MOD_DATE, ';
       q := q || '  NULL as DOC_DESC, ';
       q := q || '  NULL as DOC_LINK, ';
       IF :p24_doc_contains IS NOT NULL
       THEN
          q := q || '  score(1) as SCORE ';
       ELSE
          q := q || ' NULL as SCORE ';
       END IF;
       q := q || 'from ';
       q := q || '  NDDC_NODE_DOC NDDC ';
       q := q || 'where ( ';
       q :=
             q
          || ' INSTR(UPPER(CREATE_BY),UPPER(NVL(:P24_SEARCH,CREATE_BY))) > 0  or ';
       q := q || ' INSTR(UPPER(MOD_BY),UPPER(NVL(:P24_SEARCH,MOD_BY))) > 0  or ';
       q :=
             q
          || ' INSTR(UPPER(MIME_TYPE),UPPER(NVL(:P24_SEARCH,MIME_TYPE))) > 0  or ';
       q := q || ' INSTR(UPPER(FILE_NAME),UPPER(NVL(:P24_SEARCH,FILE_NAME))) > 0 ';
       q := q || ') ';
       IF :p24_doc_contains IS NOT NULL
       THEN
          q := q || '  and CONTAINS(document, :P24_DOC_CONTAINS,1) > 0 ';
       END IF;
       q := q || 'union all ';
       q := q || 'select ';
       q := q || '  NULL as NDDC_UID, ';
       q := q || '  NDDL.NDND_UID, ';
       q := q || '  NDDL.LSVL_DOC_CAT_UID, ';
       q := q || '  NDDL.DATE_POSTED, ';
       q := q || '  NDDL.CREATE_DATE, ';
       q := q || '  NDDL.CREATE_BY, ';
       q := q || '  NDDL.MOD_DATE, ';
       q := q || '  NDDL.MOD_BY, ';
       q := q || '  NULL as MIME_TYPE, ';
       q := q || '  NDDL.DOC_TITLE as FILE_NAME, ';
       q := q || '  NULL as CHARACTER_SET, ';
       q := q || '  NDDL.MOD_DATE as BLOB_MD_DATE, ';
       q := q || '  NDDL.DOC_DESC, ';
       q :=
             q
          || '  ''<a href="http:'''
          || '||nddl.doc_link||'''
          || '-.htm" target="_blank"> </a>'' as DOC_LINK , ';
       q := q || '  NULL as SCORE ';
       q := q || 'from ';
       q := q || '  NDDL_NODE_DOC_LINK NDDL ';
       q := q || 'where ';
       q :=
          q
          || '  ( INSTR(UPPER(CREATE_BY),UPPER(NVL(:P24_SEARCH,CREATE_BY))) > 0 ';
       q := q || '  or INSTR(UPPER(MOD_BY),UPPER(NVL(:P24_SEARCH,MOD_BY))) > 0 ';
       q :=
             q
          || '  or INSTR(UPPER(DOC_TITLE),UPPER(NVL(:P24_SEARCH,DOC_TITLE))) > 0 ';
       q :=
             q
          || '  or INSTR(UPPER(DOC_DESC),UPPER(NVL(:P24_SEARCH,DOC_DESC))) > 0 ) ';
       q := q || '  ) ';
       --htp.p(q);
       DBMS_OUTPUT.put_line (q);
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • What is this message in report based on "return SQL"

    After changing some parameter value in one report based on "function return SQL body"", we get:
    Invalid set of rows requested, the source data of the report has been modified.
    reset pagination
    We get this notice without error....just link "reset pagination" (*http://server:port/pls/htmldb/f?p=100:203:2666560392386347:NO::RP) which leads to error:
    Error      No checksum was provided to show processing for a page that requires a checksum when one or more request, clear cache, or argument values are passed as parameters.
    Any help ?
    THX!
    Message was edited by:
    Funky

    Found out...
    Originaly one search field was POPUP LOV type. Later we change them to "Text Field", bud LOV definition remains ...regardles it points to LOV which was not in use now.
    When remove LOV reference and delete the definition ...all works like a charm...

Maybe you are looking for

  • Windows XP system does not Sync

    I have two Windows systems - a Vista and and XP Pro system and two iPhones. The Vista system has upgraded to iTunes 7.6 and all works fine. On the XP system, after the upgrade to iTunes 7.6 my wife's iPhone is not recognized by iTunes. Nothing in the

  • Bug (reported to Apple) - Slide to unlock occasionally fails!

    Hello folks, Below is a copy of my bug report, I just missed an urgent call (with no call back number)... so I was prompted to finally report this problem! Has anyone experienced this (I noticed some similar reports but none that exactly match my des

  • Setting for iPad video

    I use many diffent video formats (5D, GoPro, 7D, etc) and need a setting to Convert to 1280x720 to import via my camera connection kit from an SD card so I can edit on iMovie. I don't want to use AppleTV setting since it's smaller than 720p, and I ca

  • JR1 TXJCD not picking up Plant

    I have a sales order with a incoterm of Origin but the JR1 is till using the TXJCD from the customer shipto and not the plant. Any help will be rewarded. Thanks Richard

  • Query fails in SAP

    hello i have a query that runs file in SQL but when i copy it to SAp, it runs once, then gets an internal error[131-183] when I want to execute it again. can anyone please advice thanks janice WITH Invoices AS  --Get invoices per item (SELECT I1.[Ite