Logic to select Report name based on User's input.

Hi Guru's
Good Morning!
I have a requirement to create a XMLPUBLISHER Report Whihc is Called as ITEM COUNT SUMMARY + ITEM COUNT DETAIL REPORT Following below
are my ParameterS
0.REPORT NAME
1.ORG
2.ORG COUNTRY
3.ITEM SELECTION
4.ORDER TYPE
5.STATUS
6.RECEIPT DATE FROM
7.RECEIPT DATE TO
8.TRANSIT DAYS
REPORT NAME: PARAMETER WILL LET THE USER to select the requrired Reports to be run.
ORG: is the Names of the SHIP FROM ORG
ORG COUNTRY: is a Dependent Parameter based on the ORG (i.e When a SHIP FROM ORG is Selected the ORG CHOICE Should have the CHoices for the selected ORG and when Nothing Selected from that ORG it should run for every ORG COUNTRY in that SHIP FROM ORG Currently we have two ORG COUNTRY PER SHIP FROM ORG say(USA, CANADA)
ITEM SELECTION: We need to Run this Report based on Item Selection ( The Logic should handle a total item selection whihc are comma seperated for upto 29
items)
ORDER TYPE : Types of Order Again this can be a List of Comma Seperated Values for order Types
STATUS: STatus should be Comma Seperated (ENTERED,WAVED,NOTWAVED,SHIPPED)
TRANSIT DAYS: Transit Days
RECEIPT DATE FROM: This is the Starting DATe range for the REport to be run
RECEIPT DATE TO: This is the END DATe range for the REport to be run.
The ITEM COUNT SUMMARY Report should allow the users to run the report 3 ways
1.ITEM COUNT RUN BY ORDER TYPE ( for all the STATUS)
2.ITME COUNT RUN BY STATUS ( FOR all the ORDER TYPES)
3.ITEM COUNT RUN BY TRANSIT DAYS
And My approach is I have three Queries Created for the above and in the DATA DEFINITION File
I have them Listed my DATA DEFININTION ( Sorry as my Query's GO More than 70+ LINES for Each Query I thought I will just paste the Order How i have arranged my queries in the Tempalte)
<?xml version = '1.0' encoding = 'UTF-8'?>
<dataTemplate name="TPC_ITEM_COUNT_SUMMARY" description = "TPC_ITEM_COUNT_SUMMARY" version="1.0">
<properties>
     <property name="xml_tag_case" value="upper"/>
</properties>
<!-- parameters for the Report -->
     <parameters>
     <parameter name="report_name" dataType="varchar2"/>
     <parameter name="item_selection"          dataType="varchar2"/>
     <parameter name="order_type"               dataType="varchar2"/>
     <parameter name="pstatus"               dataType="varchar2"/>
     <parameter name="org_name"               dataType="varchar2"/>
     <parameter name="org_choice"               dataType="number"/>
     <parameter name="first_receipt_date"     dataType="date"/>
     <parameter name="last_receipt_date"     dataType="date"/>
     <parameter name="from_date"               dataType="date"/>
     <parameter name="to_date"                    dataType="date"/>
     <parameter name="transit_days"          dataType="number"/>
     </parameters>
<dataQuery>
<sqlStatement name= "HDR">
<![CDATA[
SELECT UPPER('The ABC Corporation, Ltd.')     AS "COMPANY"
               ,'Item Count Summary - '||INITCAP(:report_selection)||' for Company '||:org_name AS "REPORT"
               ,'Order Types - '||UPPER(:order_type) AS "ORDER_TYPE"
               , SYSDATE AS "RUN_DATE"
     ,'Receipt Date'||' '||TO_CHAR(NVL(TO_DATE(:first_receipt_date,'DD-MON-YYYY'),SYSDATE),'YYYYMMDD')                     ||' '||'thru'||' '||TO_CHAR(NVL(TO_DATE(:last_receipt_date,'DD-MON-YYYY'),SYSDATE),'YYYYMMDD') AS "RANGE"
FROM DUAL;
]]>               
</sqlStatement>
<sqlStatement name= "BY_STATUS">
     <![CDATA[
Query for ITEM COUNT SUMMARY by STATUS
]]>
</sqlStatement>
<sqlStatement name= "BY_ORDERTYPE">
     <![CDATA[
Query for ITEM COUNT SUMMARY by ORDERTYPE
]]>
</sqlStatement>
<sqlStatement name= "BY_TRANSITDAYS">
     <![CDATA[
Query for ITEM COUNT SUMMARY by TRANSITDAYS
]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_HDR" source="HDR">
          <element name="COMPANY" value="COMPANY" />
          <element name="REPORT" value="REPORT" />
          <element name="ORDER_TYPE" value="ORDER_TYPE" />
          <element name="RANGE" value="RANGE" />
</group>
<group name="G_BY_STATUS" source="BY_STATUS">                
          <element name="RCPT_DT" value="RCPT_DT"/>
<element name="ITEM"     value="ITEM" />
          <element name="ITEM_DESCRIPTION" value="ITEM_DESCRIPTION" />
          <element name="ENTERED"     value="ENTERED" />
<element name="WAVED"     value="WAVED" />
<element name="NOTWAVED"     value="NOTWAVED" />
<element name="SHIPPED"     value="SHIPPED"/>
</group>
          <group name="G_BY_ORDERTYPE" source="BY_ORDERTYPE">                                         
<element name="ITEM"          value="ITEM" />
          <element name="ITEM_DESCRIPTION" value="ITEM_DESCRIPTION" />
          <element name="RCPT_DT"     value="RCPT_DT"/>
          <element name="ORDER_TYPE"     value="ORDER_TYPE" />
<element name="QUANTITY" value="QUANTITY" />
          </group>
</dataStructure>
</dataTemplate>
Now My Problem is How Do i Get a Logic to Let the Report Name Selection To be REferenced in the Data Definition file..
I would like to request you to Please help me out in arriving at a Solution for Implementing the Logic
When the USer selects ITEM COUNT SUMMARY BY ORDER TYPE I want "BY_ORDERTYPE" to be Executed and so on..
Is there a Way That I can Write in my Data definition file as
DECODE(:REPORT_NAME ,'ITEM COUNT SUMMARY BY ORDERTYPE', Run query for BY_ORDERTYPE,
,'ITEM COUNT SUMMARY BY STATUS', Run query for BY_STATUS,
,'ITEM COUNT SUMMARY BY TRANSIT DAYS', Run query for BY_TRANSITDAYS,run query for DETAIL REPORT);
Also My Item Description Contains Special Characters like Registered Symbol, Copyright Symbol How would I force my XML Parser to Still consider them as TEXT's
May I Directly Specify <?xdofx:DECODE :REPORT_NAME = 'ITEM COUNT SUMMARY BY ORDERTYPE' THEN BY_ORDERTYPE ?> in the DATA DEFINITION file , I think this is only allowed in RTF please Help,
Thanks
vasanthanand

Thanks for the Reply sir,
When you say Write the Code, you are referring to the Package is that correct,unfortunately I am not implementing this via PL/SQL Package.
you mentioned that I can Implement the Logic in the Data definition file( which is a XML file), how and Where I have print use that IF construct (or) Can you Please Print the Code snippet in the Model XML template that i have pasted in my Post.
May i know what is this
ln_req_id := fnd_request.submit_request -- for XML1 For...
Sorry about my ignorance...

Similar Messages

  • Find Report Name based on Report ID

    How do I find out the report name based on the report id ('D12C939B-4309-4364-A025-BFDB5203EE0B')?

    Hi Sudhir,
    Based on my research, I find that the general properties of all the items (including Date Sources, Datasets and reports) on the report server will be stored in the Catalog table in ReportServer database. So that the report name (correspond to Name column)
    and report id (correspond to ItemID column) also be stored in the table. If we want to select the report name based on the report id, we can use the query below:
    use ReportServer
    select Name
    from dbo.Catalog
    where dbo.Catalog.ItemID='D12C939B-4309-4364-A025-BFDB5203EE0B'
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Searching PRODUCT column based upon user's input

    I have table in Oracle with one column PRODUCT. Column PRODUCT have following values -
    Account Management
    Active Directory
    NT Account
    Application Security
    Beehive Conference
    WebSite Account
    HP Laptop
    I am designing application where I need to search in column PRODUCT based upon user's input. Lets say user wants search on 'Laptop Account Broken'.
    I want to search for all rows in PRODUCT column which contains any of words in user's input. So based upon user's input I want output like below.
    Expected Output
    Account Management
    NT Account
    WebSite Account
    HP Laptop
    I need your help to write me SQL for my desired output. please help -

    You can use Regexp_like instead of Instr ;)
    PRAZY@11gR2> exec :user_input:='Laptop Account Broken';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    PRAZY@11gR2>
    With TableA As (
    select 'Account Management' Product from dual union all
    select 'Active Directory' from dual union all
    select 'NT Account' from dual union all
    select 'Application Security' from dual union all
    select 'Beehive Conference' from dual union all
    select 'WebSite Account' from dual union all
    select 'HP Laptop' from dual
    --End of sample data
    ,Temp as
    (select regexp_substr(:user_input,'[^ ]+',1,level) str from dual
    connect by level <= length(regexp_replace(:user_input,'[^ ]+'))+1)
    select product from tableA,temp where
    regexp_like(product,str)
    PRAZY@11gR2> /
    PRODUCT
    HP Laptop
    Account Management
    NT Account
    WebSite Account
    Elapsed: 00:00:00.00or...
    PRAZY@11gR2> exec :user_input:='Laptop Account Broken';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    With TableA As (
    select 'Account Management' Product from dual union all
    select 'Active Directory' from dual union all
    select 'NT Account' from dual union all
    select 'Application Security' from dual union all
    select 'Beehive Conference' from dual union all
    select 'WebSite Account' from dual union all
    select 'HP Laptop' from dual
    --End of sample data
    select distinct Product from tableA where
    regexp_like(product,regexp_substr(:user_input,'[^ ]+',1,level))
    connect by level <= length(regexp_replace(:user_input,'[^ ]+'))+1
    PRODUCT
    Account Management
    NT Account
    WebSite Account
    HP Laptop
    Elapsed: 00:00:00.06Cheers!

  • Filtering report data based on user login and Parameter fields

    Post Author: mronquillo
    CA Forum: General
    Hi,I am running a report that filters data based on the user login. To do this, I created a formula called @user that compares the login name (using the CurrentCEUserName field) and returns the user's name. If the user login is not a login specified in the if statements, it returns the parameter field "user_name":For example: if CurrentCEUserName = "loginname1" then "User's Name 1"else if CurrentCEUserName = "loginname2" then "User's Name 2" else if CurrentCEUserName = "loginname3" then "User's Name 3"  else if CurrentCEUserName = "loginname4" then "User's Name 4".. .else {?user_name}   In select expert, I have a condition which filters data based on the string returned from that formula:{Table.Name} = {@user}  This works fine and when the users run the report they only their own data. However, they are still prompted to choose a parameter field regardless if of the value returned by the @user formula. Oddly enough, regardless of what parameter field they choose, they will still only see their own data (i.e. if John chooses "Bob" from the parameter list, he will still only see John's data.)If I remove the "else {?user_name}" line from the @user formula, then the users are not prompted anymore. However, if they are not a "valid" user - that is, if any of the if statements in the formula are not true for their login name - then they will see no data. What I want to do is make the report ONLY prompt the user to choose a parameter field if their login name is not "valid". That is, if the @user formula is able to return a string value for their login name, then they will jump right into the report without being prompted to choose a parameter - otherwise, the user will be prompted to choose a name from the parameter list. I thought my formula would allow this (hence the "else" clause), but it seems that if a parameter field is present in any formula, then the report automatically prompts the user to choose a parameter. Is what I am trying to accomplish possible in CR (I'm using CR v10.0) or is there a better way to do what I am trying to do?Thanks in advance.

    Post Author: sharonmtowler
    CA Forum: General
    try, or something like that
    (if CurrentCEUserName ={?user_name} then true else ({Table.Name} = {@user}) )

  • Sql to tell report names based on view/table name

    Hello, we recently upgraded to release 12 and planning to implement sub ledger accounting and we are in the process of identifying our customizations written on top of distribution tables so that we can tweak them to go after SLA tables. Majority of our custom objects are discoverer reports. And most of these discoverer reports are based on custom folders which are based on custom views. By running a sql we were able to identify the names of all of our custom views which go after the distribution tables. Now we want to identify which of our discoverer reports are based on these views via custom folders of our custom business areas. Our custom folders might have been named exactly same as custom view or they may have different name and the folder may actually have a sql in which they are referring these custom views.
    Would it be possible for someone to provide a sql select statement which takes database table / view name and returns the name of discoverer workbooks referring this table/view? Thanks in advance for help.
    Regards,
    Anjan Avula.

    Nancy I claimed that problem is because of developing reports in plus based on some hits I found on internet. http://www.orafaq.com/forum/t/66265/0/
    And hits I found in metalink.
    Bug # 6665629
    However according to engineer with Oracle support it is a bug. The problem with updating that table is more related to workbooks that were created in older versions or upgraded to 10.1.2.2 but have not been opened and resaved. Bug 4901641 is present in 10.1.2.2 admin and it can result in Discoverer Admin not updating the EUL5_ELEM_XREFS. Admin version 10.1.2.3 is expected to resolve this with an easy workaround is to export the older workbooks and re-import them into your eul. The import process will update the EUL5_ELEM_XREFS table and will save customer from saving and opening every workbook.
    So, may be you have 10.1.2.3 in your environment and never experienced this issue or may be your reports were never upgraded from previous versions to 10.1.2.2. In our environment we have upgraded our reports to this version from previous versions and may be what oracle engineer told is true. I need to work with our admin to get this looked at and get it fixed.

  • Display interactive report rows based on user role.

    Hello,
    Can anyone please help me out with this issue. i have an interactive report and now i want to make this report as conditional based on user role. Like i want to dispaly all the report rows for an Admin user role and for a developer I want the report to display only his/her rows. Can anyone please help me how can I resolve this issue.
    Do I need to have two separate reports for each role or can we make achieve this with only one report.
    thanks,
    Orton

    Here is a possible answer.. Build your Interactive report off of a collection. And when you build the collection you can build an if statement to either build your select with or without the filtering of user_id..
    See this blog entry for how to build a interactive report from a collection: http://www.oracleapplicationexpress.com/tutorials/71-oracle-apex-interactive-report-based-on-plsql-function
    Thank you,
    Tony Miller
    Webster, TX

  • To select columns based on user's input

    hi all..
    i am beginner in oracle forms 6i..
    i want to select columns in my query according to user's input?
    how can i do it in my oracle forms 6i?
    i am using a graph in my oracle form and i want to plot graph according to user input?
    in my graph i have to show sum of only those colums which are selected by user at run time?
    how is it possible?please tell me the method in detail?

    Thanks for the Reply sir,
    When you say Write the Code, you are referring to the Package is that correct,unfortunately I am not implementing this via PL/SQL Package.
    you mentioned that I can Implement the Logic in the Data definition file( which is a XML file), how and Where I have print use that IF construct (or) Can you Please Print the Code snippet in the Model XML template that i have pasted in my Post.
    May i know what is this
    ln_req_id := fnd_request.submit_request -- for XML1 For...
    Sorry about my ignorance...

  • How to change Rendering Extension in sql server Reporting Services based on User Permissions

    Hi,
    I want to provide SQL server reporting services rendering extension based on user Access.
    For Example
    User1 can have options of Rendering to EXCEL and PDF
    User2 can have a option of CSV
    i read one article which is useful for report basis rendering extension changes. but i want to give user basis rendering options.
    http://www.mssqltips.com/sqlservertip/3569/how-to-change-rendering-extensions-in-sql-server-reporting-services/?utm_source=dailynewsletter&utm_medium=email&utm_content=headline&utm_campaign=20150406
    Thanks in advance.
    GVRSPK VENI

    You can use a data driven subscription for that
    Maintain a table with rendering extension information for various users ie their AD user login. Then setup a data driven subscription based on table values
    You will be creating a dataset with query for retrieving userid as well as rendering extensions and then just set the value as Get value from database for  render Format and To properties 
    For more details refer
    http://beyondrelational.com/modules/2/blogs/101/posts/13460/ssrs-60-steps-to-implement-a-data-driven-subscription.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to get field values in ALV based on user provided input

    Hi,
    In my ALV grid, I have 2 fields:
    1. Material ID
    2. Material Description
    When user provides input to Material ID field, the material Description field should get populated immediately.
    Note: Curretly I am able to do it based on the sy-ucomm = 'Enter', i.e. when the user presses "Enter" outside the ALV grid, I retrieve Description from Mat Table and populate this in Mat_Desc in ALV grid.
    I want to do the same operation whenever tab is pressed (not when user presses enter outside the ALV grid).
    Please provide your inputs for this.
    Thanks & regards,
    Ravish

    Hi Ravish,
    Check <b>BCALV_TEST_GRID_F4_HELP</b> program for F4 help on ALV Grid.
    Thanks
    Venkat.O

  • Dynamic change in the query name based on user input

    Hi Gurus,
    In a scenario, country appears as a user input variable.When the user specifies his country, the same query displays <b>Business trends</b>' data pertaining to his own country and rest of the world(international) in two tables.The reports are developed using Web application designer.
    Can the name(description) of the query be changed  so that the user input value for country gets dynamically reflected in the query name like <b>Business trends:Selected country vs International</b>?
    Regards,
    Balaji

    Hi Bala,
      ya this can be done by text variables. create a text variable( replacement path on the country infoobject) by going to the query properties on the description.
    if the user enters country value then it will be displaed on the description of the query .
    assign points if useful .
    regards
    santosh

  • How to get Logo in report dynamically Based on user login?

    requirement is like this:
    same report format will be used by 3 different users, but the different logo should appear based on their login..

    place all 3 images in the template, then wrap an if statement around each. something like:
    <?if:userLogin='User 1'?>image goes here<?end if?>
    if that doesn't work try sticking each in a table with no border and doing the same with the if statements

  • Hide or show column from a report region based on user logged in

    Hi,
    I have this criteria, where I need to display a column on a report page but depends on the users logged in ( APP_User).
    On the field(column page) there is the Conditional Display option
    Conditional Display
    Condition Type: I choose the option where "item value in Expression 1 = expression 1
    *Expression 1*
    App_USER
    *Expression 2*
    I need to add 4 user names here that they allowed to view that column
    My question is how to list the names in expression 2 field, it worked when I added one name, but when I listed 4 names separated by comma, it didn't work.
    I appreciate any help or any solutions from you.
    Thank you.
    Sofia

    If you use "Text in Expression 1 is contained in the Value of Expression 2" then you can provide a comma-separated list. The only thing to watch out for is if you have a user "Bob" and a user "Bob Smith" then you will get a match on "Bob Smith" for the user "Bob"

  • Report that Forces a User to Input a Date Range

    Greetings,
    I am generating a work times report and would like to force the user to select a date range when the report first opens. This would pull only the data for the specified range from my database.
    I prefer drop down lists or calendars, but am wondering if this is possible.
    I guess one other important element is that I would like to "dumb down" the interface, so the user of the report does not have access to all of the features of the program.  Basically I only want them to have read privileges.
    I'm new to CR, so would appreciate any guidance.
    Thanks
    Peter

    Here is what the Help system has to say about the read only feature:
    You can make a report, section, area, or object read-only so it can't be formatted.
    When you set this option, choices in the Format Editor become inactive.
    The formatting options that are usually available on the toolbars or shortcut menus are also suppressed for the report or object.
    Note:    This feature is for your convenience in protecting report formatting; it is not intended to be used as report security.
    Also, if you want the user to be prompted for parameter values each time they open the report, take the check mark out of the
    "Save Data with Report" option.
    Jason

  • APEX4: How to create a report whose data is based on user input date fields

    Using Apex 4 I've to create a report that allows the user to input two date and shows a report between the date range.
    How can I do this?
    Thank you.

    This has nothing to do with apex 4.0. If you create a report using this query:
    SELECT *
      FROM emp
    WHERE hiredate BETWEEN NVL (TO_DATE (:p1_date_from, 'mm/dd/yyyy'), hiredate)
                        AND NVL (TO_DATE (:p1_date_to, 'mm/dd/yyyy'), hiredate)and create two date picker items with names P1_DATE_FROM and P1_DATE_TO (take care of using the right date format), your report will show all records by default and those that match after you fill in the date items.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Output different data based on user select

    Hi everyone,
    Quick question, I would like to output different report columns based on user select, eg., users would be presented with two choices in a radiobutton list, eg., 1 and 2.
    I have query results that contain columns A, B, C, D, E, F, G.
    If user selects 1 then the output should be columns A, B, C, D, E.
    If user selects 2 then the output should be columns A, B, C, F, G.
    I am sure this is possible and easy? If so, what topic should I be reading/searching internet on?
    Please advise.
    Thanks!

    I would say that this is most often something that your user interface should be dealing with (i.e. which columns should be shown).
    There is no way to do that in SQL.
    In PL/SQL it is a simple situation of creating two cursors and simply deciding which one to open.
    <pre>declare
    l_cur sys_refcursor;
    begin
    if :user_selection = 1 then
    open l_cur for select A, B, C, D, E from tbl;
    else
    open l_cur for select A, B, C, F, G from tbl;
    end if;
    -- use the cursor
    close l_cur; -- or return to user interface
    end;
    /</pre>
    Hope this helps.

Maybe you are looking for