Dynamic SQL for creating report in portal

Has anyone had to create report in Portal using dynamic sql. That is you build up the query commands depending on the parameters entered by the user.
E.g the columns displayed will be what the users has selected in the parameter form.
Urgent reply please,
Femi

Hi,
You can use SQL based reports to do this. The report should have a bind variable. The bind variable is used for the users to enter their values and query is built using the value in the bind variable. The user should enter the value of the bind variable from the customization screen.
Here is an example
select * from scott.emp
where deptno = :vdept
Here vdept appears in the customization screen and user should enter a value for this and run the report.
Thanks,
Sharmila

Similar Messages

  • Can we use Dynamic SQL in Oracle Reports ?

    Hi ,
    Can we use Dynamic SQL in Oracle Reports ?
    If yes please give some examples .
    Thanx
    srini

    I believe the built-in package SRW.Do_Sql is what you are looking for
    Example from the document:
    /* Suppose you want to create a "table of contents" by getting the
    ** first character of a columns value, and page number on which its
    ** field fires to print. Assume that you want to put the "table of
    contents"
    ** into a table named SHIP. You could write the following construct:
    DECLARE
    PAGE_NO NUMBER;
    PAGE_FOR INDEX NUMBER;
    SORT_CHAR CHAR(1);
    CMD_LINE CHAR(200);
    BEGIN
    SORT_CHAR := :SORT_NAME ;
    IF :CALLED = Y THEN
         SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
         SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
         P_START_PAGENO);
         SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
    END IF;
    SRW.GET_PAGE_NUM(PAGE_NO);
    CMD_LINE := INSERT INTO SHIP VALUES
                          (||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
    SRW.MESSAGE(2,CMD_LINE);
    SRW.DO_SQL(CMD_LINE);
    COMMIT;
    EXCEPTION
      WHEN DUP_VAL_ON_INDEX THEN
            NULL;
      WHEN SRW.DO_SQL_FAILURE THEN
            SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
      WHEN OTHERS THEN
           COMMIT;
    END;

  • Help with Sql for Annual Report per month

    Hi, I have been given the task to create an annual report by month that would show company's profits per month and totals in the last column to show which branch had the hightest income.
    Branch||January||February||March||April||May||June....||Total||     
    ABC ||$0.00 ||$0.00 ||$0.00||$0.00||$0.00||$0.00||Total Amt||
    DEF ||$18.01 ||$3.88 ||$18.01||$4.12||$18.01||$3.97||Total Amt||
    Can anyone please help me in giving an idea of how to write sql for this report..? I am building sub-queries for everymonth by giving the dates for Jan/Feb/March..but I think this is not the right way to do this....
    SELECT
    sum(a.commission) December,
    sum(b.commission) November
    FROM
    Select
    c.account_id,
    c.officer,
    c.account_product_class_id,
    sum(c.dp_monthly_premium) Commission
    From
    contract c
    Where
    c.account_id=109 and
    c.status='APPROVED' and
    c.protection_effective between '01-DEC-2009' and '31-DEC-2009'
    Group by
    c.account_id,
    c.officer,
    c.account_product_class_id
    ) a,
    Select
    c.account_id,
    c.officer,
    c.account_product_class_id,
    sum(c.dp_monthly_premium) Commission
    From
    contract c
    Where
    c.account_id=109 and
    c.status='APPROVED' and
    c.protection_effective between '01-NOV-2009' and '30-NOV-2009'
    Group by
    c.account_id,
    c.officer,
    c.account_product_class_id
    ) b
    I always have hight hope from this forum. So please help. Thanks in advance.
    Edited by: Aditi_Seth on Jan 26, 2010 2:29 PM

    You may try a group report on one simple query like:
    Select
    c.account_id, c.officer, to_char(c.protection_effective, 'MM') month
    sum(c.dp_monthly_premium) Commission
    From
    contract c
    Where
    c.status='APPROVED' and .....
    Group by
    c.account_id
    c.officer,
    to_char(c.protection_effective, 'MM')
    break/gropu on account_id, c.officer, to_char(c.protection_effective, 'MM') and total will be automatically calculated by Reports.

  • Dynamic SQL for table creation.

    Hi Group
    I'm executing a procedure using dynamic sql to create a table on my own schema, but it returns :ORA-01031: insufficient privileges, why?, if i executing the procedure on my schema, however if gave grants being sys' GRANT CREATE ANY TABLE TO HR; the creation of the table is successful.
    CREATE OR REPLACE PROCEDURE PRC_CREA_TABLA(p_nombre_tabla VARCHAR2, p_esp_columnas VARCHAR2) AS
    BEGIN
    -- EXECUTE IMMEDIATE 'GRANT CREATE ANY TABLE TO HR';
    EXECUTE IMMEDIATE 'CREATE TABLE ' || p_nombre_tabla || ' ('
    || p_esp_columnas || ')';
    -- EXECUTE IMMEDIATE 'REVOKE CREATE ANY TABLE FROM HR';
    END;
    /Thansk a lot
    ORACLE 11.2.0.2
    ORACLE LINUX 6

    Note the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions)*", so only for issues with the SQL Developer tool. Please post these questions under the dedicated {forum:id=75} forum.
    Un saludo,
    K.

  • Steps for Creating Report  using LDB

    hellow sirs
    can u please tell Step by Step method for creating Reports using LDB method...
    if possible with screen Shots..
    thanking You
    Rahul

    Hi,
    Please refer the code below:
    Use the PNP LDB for this program,
    *: Report:  ZP_POSTCODE                                                :
    *: Date  :  2004                                                       :
    *: Description: Displays report of employees by postcode area,         :
    *:              includes current travelling allowances (i.e. parking   :
    *:              permit or transport card etc..)                        :
    *: Use:         Help encourage the use of car sharing and public       :
    *:              transport where appropriate.                           :
    REPORT  zp_postcode.
    type-pools: slis.                                      "ALV Declarations
    NODES: pernr.
    INFOTYPES: 0000, 0001, 0002, 0006, 0008, 0014, 0105, 0121.
    SELECTION-SCREEN BEGIN OF BLOCK pcode WITH FRAME TITLE text-s01.
    SELECT-OPTIONS: so_pcode FOR p0006-pstlz.
    SELECTION-SCREEN END OF BLOCK pcode.
    TYPES: BEGIN OF t_output,
      pernr       TYPE p0001-pernr,   "personnel name
      anredtxt    TYPE t522t-atext,   "title (based on p0002-anred)
      fname       TYPE p0002-vorna,   "first name
      lname       TYPE p0002-nachn,   "last name
      orgtx       TYPE t527x-orgtx,   "dept
      fte         TYPE p0008-bsgrd,   "fte
      parking(20) TYPE c,
      payslip     TYPE t526-sachn,        "payslip address
      telno       TYPE p0105-usrid_long,  "tel number(p0105-usrty = 0020)
      email       TYPE p0105-usrid_long,  "email (p0105-usrty = MAIL)
      postcode    type p0006-pstlz,
    END OF t_output.
    DATA: it_output TYPE STANDARD TABLE OF t_output INITIAL SIZE 0,
          wa_output TYPE t_output.
    *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,
          gd_count(6)    type n,
          gd_outtext(70) type c,
          gd_lines       type i.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    clear: gd_count.
    GET pernr.
    * Infotype 0121 is used to store multiple contracts for personnel.
    * Field p0121-hpern contains the personnel number for the main contract.
      PROVIDE * from p0121 between pn-begda and pn-endda.
    *   Check if main contract
        if p0121-pernr ne p0121-hpern.
          reject.
        endif.
      ENDPROVIDE.
      add 1 to gd_count.
      concatenate 'Processing personnel data'(m10) gd_count into gd_outtext
                separated by ' '.
    * Display indicator for employee count
      perform progress_indicator using gd_outtext.
    * Retrieve datd from infotypes
      rp_provide_from_last p0000 space pn-begda pn-endda.
      rp_provide_from_last p0001 space pn-begda pn-endda.
      rp_provide_from_last p0002 space pn-begda pn-endda.
      rp_provide_from_last p0006 space pn-begda pn-endda.
      rp_provide_from_last p0008 space pn-begda pn-endda.
      rp_provide_from_last p0014 space pn-begda pn-endda.
    * Check post code
      CHECK p0006-pstlz IN so_pcode.  "cp
    * Post code
      wa_output-postcode = p0006-pstlz.
    * Personnel number
      wa_output-pernr = pernr-pernr.
    * Personnel title
      SELECT SINGLE atext
        FROM t522t
        INTO wa_output-anredtxt
       WHERE sprsl EQ sy-langu AND
             anred EQ p0002-anred.
    * First name
      wa_output-fname = p0002-vorna.
    * Last name
      wa_output-lname = p0002-nachn.
    * Organizational Unit text (dept)
      SELECT SINGLE orgtx
        FROM t527x
        INTO wa_output-orgtx
       WHERE sprsl EQ sy-langu AND
             orgeh EQ p0001-orgeh AND
             endda GE sy-datum.
    * FTE
      wa_output-fte = p0008-bsgrd.
    * Parking / travel deducted?
      CASE p0014-lgart.
        WHEN '7180' OR '7181' OR '7182'.
          wa_output-parking = text-002.
        WHEN '7183'.
          wa_output-parking = text-001.
        WHEN '7171' OR '7172' or '7173' or '7174' or
             '7175' or '7176' or '7177' or '7178'.
          wa_output-parking = text-003.
      ENDCASE.
    * Payslip Address
      SELECT SINGLE sachn
        FROM t526
        INTO wa_output-payslip
       WHERE werks EQ p0001-werks AND
             sachx EQ p0001-sacha.
      PROVIDE * from p0105 between pn-begda and pn-endda.
    *   Telephone numbers
        if p0105-usrty = '0020'.
           wa_output-telno = p0105-usrid_long.
        endif.
    *   Email address
        if p0105-usrty = 'MAIL'.
           wa_output-email = p0105-usrid_long.
        endif.
      ENDPROVIDE.
      append wa_output to it_output.
      clear: wa_output.
    *END-OF-SELECTION.
    END-OF-SELECTION.
    describe table it_output lines gd_lines.
    if gd_lines gt 0.
      perform build_fieldcatalog.
      perform build_layout.
      perform display_alv_report.
    else.
      message i003(zp) with 'No records found'.
    endif.
    *&      Form  PROGRESS_INDICATOR
    *       Displays progress indicator on SAP screen
    form progress_indicator using p_text.
      call function 'SAPGUI_PROGRESS_INDICATOR'
          exporting
    *         PERCENTAGE = 0
               text       = p_text.
    endform.                    " PROGRESS_INDICATOR
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
      fieldcatalog-fieldname   = 'PERNR'.
      fieldcatalog-seltext_m   = 'Personnel No.'.
      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   = 'ANREDTXT'.
      fieldcatalog-seltext_m   = 'Title'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'FNAME'.
      fieldcatalog-seltext_m   = 'First Name'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'LNAME'.
      fieldcatalog-seltext_m   = 'Last Name'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'ORGTX'.
      fieldcatalog-seltext_m   = 'Department'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'FTE'.
      fieldcatalog-seltext_m   = 'FTE'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PARKING'.
      fieldcatalog-seltext_m   = 'Parking/Metrocard'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PAYSLIP'.
      fieldcatalog-seltext_m   = 'Payslip Add.'.
      fieldcatalog-col_pos     = 7.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'TELNO'.
      fieldcatalog-seltext_m   = 'Telephone'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EMAIL'.
      fieldcatalog-seltext_m   = 'E-mail'.
      fieldcatalog-col_pos     = 9.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'POSTCODE'.
      fieldcatalog-seltext_m   = 'Post code'.
      fieldcatalog-col_pos     = 10.
      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-zebra             = 'X'.
    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
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_output
           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

  • Should I use dynamic SQL for simple updates?

    Please tell me, out of the two options given below, which option should i use to update columns in a table and why?
    what will be the performance difference between the two approaches?
    Please note: The options given below is just for an example
    procedure proc1(var1 varchar2)
    is
    begin
    update tab1 set col1 = var1;
    commit;
    end;
    procedure proc1(var1 varchar2)
    is
    sqlstr varchar2(1000);
    begin
    sqlstr := 'update tab1 set col1 = :v1';
    execute immediate sqlstr using var1;
    commit;
    end;
    Thanks
    Arun

    Arun G Nath wrote:.
    Should I use dynamic SQL for simple updates? No way, not a chance.
    Performance is not the issue (as long as you are using bind variables).
    But with dynamic SQL, you loose compile time checking; you do not know until runtime if the SQL is valid.
    You also loose the dependency between proc1 and tab1, which can be found only if you search user_source.
    (And in either case, you probably want to remove the commit)
    Regards
    Peter

  • Exchange 2010 SP3 Create Dynamic DL for Direct Reports

    I am not sure this is possible but if there is a will there is a way I guess.
    System: Exchange 2010 SP3 on Windows Server 2008 R2
    I am trying to see if there is a way to create dynamic DLs for Manager(s) direct reports.
    Example: Manager has 5 people that report directly to them, is there a way to make an dynamic email distribution list that will poll the direct reports as people leave or hired.
    I know I can create one manually but some depts. may have high turnover rates which increase overhead so I am just trying to simplify the process. I of course googled my question but not getting the results I intended.
    Thanks. 

    hi,
    as from above  i understand you are asking about creating an custom attribute and then referencing them .. if yes please check below command
    Get-Mailbox -OrganizationalUnit Sales | Set-Mailbox CustomAttribute1 "SalesOU"Now you can create an e-mail address policy for all recipients that have the CustomAttribute1 property that equals SalesOU, as shown in this example.
    New-EmailAddressPolicy -Name "Sales" -RecipientFilter { CustomAttribute1 -eq "SalesOU"} -EnabledEmailAddressTemplates "SMTP:%s%[email protected] check this.. http://technet.microsoft.com/en-us/library/ee423541%28v=exchg.150%29.aspx
    MARK AS USEFUL/ANSWER IF IT DID
    Thanks
    Happiness Always
    Jatin

  • Problem for create report by sql query under Protal!

    I'm trying create report by sql query method, however it came out the error:
    ORA-00918: column ambiguously defined (WWV-11230)
    Failed to parse as SENTRYDB - select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' ) as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid from pnames t1, people t3, groups t4 where t3.persongroup = t4.groupid and t1.personid = t3.personid order by rowid (WWV-08300)
    Error: Unable to execute query (WWV-10201)
    The query is :
    select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' )
    as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid
    from pnames t1, people t3, groups t4
    where t3.persongroup = t4.groupid
    and t1.personid = t3.personid
    I have no problem to run that query under sqlplus!

    Hi,
    I'm cuurently using the portal inside of 9iAs 1.0.2.2.2a. What version of that Portal? By the way, how can I find out the version of Portal that I using? And also can I display image inside of report which created by Portal? I tried statement:
    select
    '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg',
    owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' stu_pic,
    from stu
    However, it doesn't work. It came out error:
    Unable to describe SQL statement. Please correct it (WWV-13010)
    Invalid SQL statement: select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-13005)
    ORA-01001: invalid cursor (WWV-11230)
    ORA-00904: invalid column name (WWV-11230)
    Failed to parse as SENTRYDB - select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-08300)
    Do you know why?

  • Dynamic publishing of crystal report in portal.

    Hi All,
    My understanding of publishing Crystal Report in portal is using the URL iview, is my understanding correct.
    I have checked this in [Integration of BOE XI3.1 into the SAP Enterprise Portal 7.x|http://wiki.sdn.sap.com/wiki/display/BOBJ/IntegrationofBOEXI3.1intotheSAPEnterprisePortal+7.x] wiki
    and my question is, when publishing the crystal report from Crystal Report Designer, it is published in BI via the bw publisher and saved under some BW role. Is it possible to display the saved report in portal with out creating the url iview as an object of pcd in portal, i mean the report which is saved under BW role needs to be displayed dynamically in portal with out iview creation. Is this possible.
    Can someone comment on this.
    Many Thanks,
    Ansar

    Hi Ansar,
    The Crystal reports can be used for publishinh good quality gralha and charts through BW. though making a URL iView is not the only option.
    Good examples of Crystal report usage have been explained in the link below:
    [Crystal Report with BW|http://www.bi-expertonline.com/article.cfm?id=3666]
    Regards,
    Shailesh

  • Dynamic Query for a report

    Hi,
    I have to generate a report which contains a query with database link. This database link is not hard coded and would be picked up from another report which contans a link to this report. So this database link value for the query could be any. Can anyone guide me hot to write a dynamic select statement so that i could append database link value at run time.
    Thanks
    Salman

    Hi,
    You can not directly use a PL/SQL query to create an Interactive Report - that is not yet available.
    What you could do is create a collection from your query and then use that for the report. Have a look at: [http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/advnc.htm#BABGHJFD].
    In there, you will see APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY - this allows you to create a collection from a string. You could add a PL/SQL process to your page that runs "On Load: Before Header" that actually creates the collection. Something like:
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS('MYCOLLECTIONNAME') THEN
      APEX_COLLECTION.DELETE_COLLECTION('MYCOLLECTIONNAME');
    END IF;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING');
    END;Your Interactive Report can then be based on:
    SELECT SEQ_ID, C001, C002, C003, ...
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MYCOLLECTIONNAME'The tricky part is the headings as these would tend to be the SEQ_ID, C001, C002, C003, etc column names from the collection itself.
    To get around this, make sure that the report's sql statement includes as many Cnnn columns as you will need for the widest of the reports. Before doing anything else, run the report once to make sure that all these columns are included in the output.
    Then, through Shared Components, Application Items, create items that will hold heading names - for example, G_HEADING1, G_HEADING2 etc - one for each possibile column.
    Now, update the process to:
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS('MYCOLLECTIONNAME') THEN
      APEX_COLLECTION.DELETE_COLLECTION('MYCOLLECTIONNAME');
    END IF;
    IF ..test1.. THEN
      APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING 1');
      :G_HEADING1 := 'ColumnHeading1Value';
      :G_HEADING2 := 'ColumnHeading2Value';
      :G_HEADING3 := NULL; -- column not used for this query, so set it to null
    ELSIF ..test2 .. THEN
      APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING 2');
      :G_HEADING1 := 'ColumnHeading1Value';
      :G_HEADING2 := 'ColumnHeading2Value';
      :G_HEADING3 := 'ColumnHeading3Value';
    ELSIF ...etc...
      .. etc ...
    END IF;
    END;Finally, on the report itself, set the column headings to *&G_HEADING1.*, *&G_HEADING2.* etc. Then, on each column, set a Condition of "Value of Item in Expression 1 is NOT NULL" and in Expression 1, enter in the application item for that column - eg, G_HEADING1
    I have done all that here: [http://apex.oracle.com/pls/otn/f?p=16338:5] - select either Departments or Employees from the list and the report will change.
    Andy

  • Dynamic SQL in a report

    Hi,
    I need to create a concurrent program (report or XML report) which will show me the output in Excel.
    I want to change the SQL of this report for every execution (like addition of column, addition/deletion of sql conditions etc)
    How to fulfill this requirement
    Regards
    Ganesh

    use xml pulisher to display report output in excel

  • Dynamic Logic for a report:  User Maintained Logic

    Hi All,
    I've come across a requirement that needs to build a report.
    However, the set of definitions defined for the report output might change over time.
    Now every time the Definitions change, the User might have to request the change in the report through a development.
    Is there a way, where the Users can maintain certain set of rules and which can be maintained easily, but also allow the report to dynamically pick up the logic that it needs to process the data to the required output layout.
    To explain a little more in detail;
    Data from ZTABLEA is reported out by issuing each line with a BucketID.
    The report will aggregate the data to each Bucket Levels in output.
    But, The Logic for issuing the ZTABLEA line with a BucketID can change over time.
    So, a ZTABLEA line which was issued a BucketID_1 initially when FIELD1 of ZTABLEA = A,
    can later be assigned to another BucketID when FIELD1 of ZTABLEA = A.
    And this assignment needs to be maintained by the Users.
    Some of these Logics can be complex in the sense that they Could span over several Fields for a condition.
    Please advice. Any and all suggestions are highly appreciated.
    Thanks,
    RK.
    Edited by: RK on Jul 17, 2008 7:16 PM

    Following in from what Kev said.
    There's dynamic SQL available  (which you should put in a TRY...CATCH....ENDTRY block), so they can effectively define a WHERE condition, which would be stored in your table.
    I'd suggest that you have a check when they save the new logic, that the where clause is valid.
    If you need some kind of other dynamic abap look at GENERATE, READ REPORT and other associated keywords in the ABAP help.
    matt

  • Edit SQL for Infoprovider report

    Hi,
    i have a small question, since i never interfaced the BO XI 3.1 with SAP BW. Can we edit the SQL for the webi report created on the SAP Infoprovider (say for example : InfoCube - cube1).
    Regards,
    Siva

    Hi Siva,
    No you can not!
    When you create a webi report based on a SAP BW cube there is no SQL generated, but an MDX statement. Currently it is not even possible to view the MDX statement on the BO side. You need to put a trace on it on the SAP BW side.
    Regards,
    Harry

  • The best practice for creating reports and dashboard

    Hello guys
    I am trying to put together a list of best practice on how to create reports and dashboards using OBIEE presentation service. I know a lot of those dos and donts are just corporate words that don't apply consistantly in real world environment, but still I'd like to know if Oracle has any officially defined best practice or not.
    the only best practice I can think of when it comes to building reports and dashboards is:
    Each subject area should contain only one star schema that holds data for a specific business information
    Is there anything else?
    Please advice
    Thanks

    Read this book to understand what a Dashboard is, what it should do and look like to be used by the end users. Very enlightentning.
    Information Dashboard Design: The Effective Visual Communication of Data by Stephen Few (There are a couple of other books by Stephen and although I haven't read them yet, I anticipate them to be equally helpful.
    This book was also helpful to me:
    http://www.amazon.com/Performance-Dashboards-Measuring-Monitoring-Managing/dp/0471724173
    I also found this book helpful in Best Practices...
    http://www.biconsultinggroup.com/knowledgebase.asp?CategoryID=337

  • SQL for a report in Reports Builder

    I have a long query that is for all the variables for a report I am building in Reports Builder. So far everything is correct except one column in behaving pretty strangely. For some reason the value in each row is showing up as the same as the value at the bottom of the column which is the column's total. All the values above that should equal the lower value when you add them together.
    What I've got is SUM statements. I figured out what I want the statement to do that's causing the problem I just can't make it do that. I want it to give me a count of how many times one value shows up when another value is equal to a certain value. Here is one line of the code that I've tried to change but SQL keeps giving me errors.
    SUM(case when contract_type = '1' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_1,
    I did change it to COUNT but then it gave me a different incorrect value.

    SELECT component_name||' ( '||component_code||' )' component_code,agency_name||' ( '||agency_num||' )' agency_num,
    COUNT(contract_num_ng) total_cnt,
    SUM(dollars_obligated) total_amt,
    COUNT(case when contract_type = '1' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 end) TOTAL_CNT_1,
    SUM(case when contract_type = '1' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_1,
    SUM(case when contract_type = '2' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_2,
    SUM(case when contract_type = '2' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_2,
    SUM(case when contract_type = '3' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_3,
    SUM(case when contract_type = '3' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_3,
    SUM(case when contract_type = 'A' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_A,
    SUM(case when contract_type = 'A' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_A,
    SUM(case when contract_type = 'B' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_B,
    SUM(case when contract_type = 'B' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_B,
    SUM(case when contract_type = 'J' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_J,
    SUM(case when contract_type = 'J' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_J,
    SUM(case when contract_type = 'K' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_K,
    SUM(case when contract_type = 'K' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_K,
    SUM(case when contract_type = 'L' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_L,
    SUM(case when contract_type = 'L' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_L,
    SUM(case when contract_type = 'M' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_M,
    SUM(case when contract_type = 'M' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_M,
    SUM(case when contract_type = 'R' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_R,
    SUM(case when contract_type = 'R' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_R,
    SUM(case when contract_type = 'S' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_S,
    SUM(case when contract_type = 'S' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_S,
    SUM(case when contract_type = 'T' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_T,
    SUM(case when contract_type = 'T' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_T,
    SUM(case when contract_type = 'U' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_U,
    SUM(case when contract_type = 'U' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_U,
    SUM(case when contract_type = 'V' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_V,
    SUM(case when contract_type = 'V' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_V,
    SUM(case when contract_type = 'Y' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_Y,
    SUM(case when contract_type = 'Y' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_Y,
    SUM(case when contract_type = 'Z' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_Z,
    SUM(case when contract_type = 'Z' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_Z
    FROM contract_actions_dw
    WHERE date_signed BETWEEN :P_DATE_SIGNED_START AND :P_DATE_SIGNED_END
    &P_CRITERIA
    GROUP BY component_name||' ( '||component_code||' )',agency_name||' ( '||agency_num||' )'

Maybe you are looking for

  • Basic behavior - compile vs. save, application freezes and other questions

    Hi all, I've just recently moved from MS SQL to Oracle and found Oracle SQL Developer the only more or less working application to access the database and write scripts. Still, there are some issues which are beyond me in this application. So what I'

  • Acrobat Pro 9 TextBox Text Sizing problems

    I have recently installed Pro9 in my computer, previously I had Ver 6. Before Adobe Acrobat Pro 9, I could insert a TextBox in any PDF file and format the text right on the spot (i.e. size, color, style). Now with the new Pro 9, I can not edit the Te

  • Very slow connecting to WRTU54G-TM... Any ideas?

    I am trying out T-Mobile's VOIP phone service which uses a Linksys WRTU54G-TM wireless router. When I attempt to connect to the WRTU54G-TM, it takes over a minute before it connects. I also have a Linksys WRT54G router which always connects in just a

  • HP w2207h

    I've had an HP w2207h for years and had to do the "OSD lock out" for it's known issues.  Because of this I have not had sound for years.  I am tired of not being able to play my games so I went to install a sound card in my desktop, I don't have an a

  • I want to keep multiple iphone backups of a single iphone

    Hello, Is there away to keep multiple backups of my iphone using itunes, not have overwrtie the last backup. Can you give your backup a name and date for example? Itunes for win 7 and iphone 5 Thanks Jeff