Parameter selection question

I want to make a report that gives the user the option to do one of following:
(1) Select Top 5 Used Profile IDs
(2) Select Top 5 Random Profile IDs
(3) Choose Up to 5 Desired Profile IDs
How can I make a parameter that once selected will either, with option 1 or 2 pass the selected IDs from a SQL Command, or with option 3 to select the profile IDs themselves?  Is this possible?
I am using CR 11.5 and this will be implemented with the Viewer through a front-end application.

hi Wesley,
you'd really need to post this question to a forum particular to your database. Commands are written in your db syntax.
mostly you'd need to know if your database actually supports a row level random function for the option number (2). some db's don't...i.e. they support a query level random function where the random number is a single number per query versus a different number for each row. if that's the case you'll need to look for a workaround particular to your db.
for the other options look into seeing whether or not your database supports a CASE statement for the ORDER BY clause and the WHERE clause as you'd need to either use the WHERE clause for picking 5 user entered profile ID's or the ORDER BY clause to get the Top 5 Used Profile ID's.
so given your db and version this type of command is possible.
-jamie

Similar Messages

  • How to setup Multiple report layouts based on parameter selection

    I'm trying to create a report that will be based on the parameter values a user select. There will be 3 different layouts for the report.
    Customer
    Salesperson
    Category
    If the user selects one of the three a different layout will be displayed.
    This is probably a simple solution but my Reports 6i skills are a little rusty.
    Your advise would be appreciated.

    Ok so you have a parameter form, and some parameters. In the data model, you can put your 3 queries. In the layout, as Ino said, put all 3 frames that you could possibly have.
    The way I would use to choose which query to use is below. Others may have other methods, but I like this.
    Ok lets say you have query A,B,C for simplicity. You have one parameter (P_PARAM1) on the form, and the user can choose A,B or C. Based on the parameter, you choose which query to use.
    In query A, you would add this line to the where statement:
    and :P_PARAM1 = 'A' You add the same lines to queries B and C, but change the letter obviously. So if the user enters A, it will only run query A because that was the parameter selected.
    Now for the layout, click on the frame that corresponds with group/query A. You would click F11 or launch the PL/SQL editor, and add the following format trigger (or something similar).
    function F_GRP_A return boolean is
    begin
      IF :P_PARAM1 = 'A' then
        return (TRUE);
      ELSE
        return (FALSE);
      END IF;
    end;Ok - then add that same logic to Frame B and C, and based on the parameter it will hide or show the frame.
    Hope that helps - thats a basic way to do what you're looking for!

  • How to set the parameter selection *optional* for each subreport?

    Hi,
    I am using Crystal Reprots 11.
    I create 10 subreports, and each subreport contains a Parameters Field.
    The 10 subreports are put in 10 footer sections in increasing order, i.e. subreport1, subreport2, subreport3, ..., subreport10.
    When I use "Print Preview" to take a look at the whole report, CR prompts a "Edit Values" window for selecting parameter values for all 10 subreports.
    For example, if I only select parameter values for subreport1 and click "OK", 9 error messages on the "Edit Values" window come out above the selection list box of every other subreports (i.e. subreport2 ~ subreport10) showing that: 'The value is not valid'.
    Sometimes, I just want to review some specific subreports but not all.
    How should I do to set the parameter selection optional (not mandatory) for each subreport?
    Thank you in adavance.
    Edited by: Holdup on Feb 17, 2012 3:44 PM

    Hi,
    Here's how you can make the prompts optional (Assuming you're using CR 2008 or higher):
    1) Go into each subreport
    2) You should see the parameter in the Field Explorer. Right-click the name and select Edit > Look for an option called 'Optional Prompt'. Set it to true
    3) If you have a record selection in the subreport, then you need to modify the selection formula to something like this:
    if not(hasvalue({?Parameter_Name})) then True else = {?Parameter_Name}
    Hope this helps!
    -Abhilash

  • SSRS 2008 - hide chart lines based on parameter selected

    How to control visibility of chart lines based on Params selected by user?
    By default, my report display last 3 years worth of data (including current) with Month on the x axis and Counts on the y axis. I have two Boolean parameters:
    TwoYrs? T/F
    ThreeYrs? T/F
    if False is selected for TwoYr and ThreeYr parameters then I want to hide chart lines corresponding to last year and the year before.
    What I've tried: Created 3 Series groups with filters. eg. YearSeries1 to return only current year data and applying an expression to display it if params TwoYrs and ThreeYrs = False. and so on for YearSeries2 to return current + last
    years data if param TwoYrs is True and ThreeYrs = False.  But I don't see where to add expression to control the display of the individual series groups.  I am open to any way of doing this, but this seemed most logical.

    Hi Ok-Hee,
    In your Source Query just need to filter the series data based on the Parameters.
    I have written sample query below:-
    select * from
    select 1 monthnumber , 'Jan' MonthName, 2013 year,100 amount
    union
    select 1 monthnumber , 'Jan' MonthName, 2014 year ,200 amount
    union
    select 1 monthnumber , 'Jan' MonthName, 2015 year , 300 amount
    union
    select 2 monthnumber , 'Feb' MonthName, 2013 year, 300 amount
    union
    select 2 monthnumber , 'Feb' MonthName, 2014 year, 350 amount
    union
    select 2 monthnumber , 'Feb' MonthName, 2015 year,200 amount
    union
    select 3 monthnumber , 'Mar' MonthName, 2013 year, 380 amount
    union
    select 3 monthnumber , 'Mar' MonthName, 2014 year, 100 amount
    union
    select 3 monthnumber , 'Mar' MonthName, 2015 year, 500 amount
    )t
    where year in (
    select distinct FilterYear from
    select case when @TwoYrs=1 then year(getdate())-1 else year(getdate()) end FilterYear
    union
    select case when @TwoYrs=1 and @ThreeYrs =1 then year(getdate())-2 else year(getdate()) end FilterYear
    union
    select year(getdate()) FilterYear
    ) t
    I have created one post in my blog , you can check the result.
    https://msbitips.wordpress.com/2015/03/12/ssrs-2008-hide-chart-lines-based-on-parameter-selected/
    Thanks
    Prasad

  • Dynamic parameter selection from infoview not storing the sql password

    We are having the problem of dynamic parameter selection from infoview not storing the sql password as it does for the actual report. We are using Crystal Reports XI Release 2 version 11.5.3.438 (Not sure of SP level, asked in separate thread).
    To be more specific.
    We have created a report that dynamically populates the parameters of the report by pulling the records from the Informix sql database and allowing selection from there.
    In the Central Management Console for the report object we have set as follows:
    Process - Database:
    Use original database logon information from the report - the sql username and pw etc
    Use same database logon as when report is run
    Process - Parameters
    In selecting a default selection there is the option to put in the sql password, however, this does not stick and clears after update.
    As such the end result is that every time this report is run from infoview and a user chooses a parameter (there are 5), crystal goes through some timeout for about a minute or so and then requests the sql password, if a user then selects the next parameter, the same timeout and password dialog appears.
    We need the crystal report to handle to the sql password for fetching the parameters as well as for the database section of running the report, however, the parameters insists on the end user always putting the password in.
    This is 100% replicatable on our system.
    Any way that we can fix this?
    Will an update fix this issue? If so could you please advise which one?
    Thanks

    Hi,
    I am having the exact same problem. Any help?
    And what does "Use same database logon as when report is run" mean? For me that would be that no prompt is needed for getting values in a dynamic parameter...
    Regards
    Magnus

  • Parameter Selection Dialog Prompt Issue

    When using the CR2008 and do a export in C#, the Parameter Selection Dialog Prompt is not prompted.
    How can I show the Parameter Prompt DIalog when in export in C#??

    HI,
    First of all, upgrade the reports to CR2008. For this open the reports in designer, re map/upgrade the fields/tables using set Datasource location option, preview the report(to make sure we are getting proper data) and then save them. Once the report works ok in development environment move them to the production machine.
    Through code you can use the ReportDocumentObject.SetParameterValues(name of parameter, value) and pass the parameter value to the report.
    Also please remember that we need to pass the parameter before exporting a report.
    CR9 is a very old product and CR2008 have got a lot of new features added in them, most of them were for users benefits. Please visit [this|Articles] for more information on different products.
    [Samples|https://www.sdn.sap.com/irj/boc/samples] may be helpful too.
    Regards,
    AG.

  • Exclude records in a parameter selection

    Post Author: bilbo
    CA Forum: General
    Hi,
    Is it possible to exclude records from a parameter selection field? Part of my record selection is: "NOT ({TABLE1.FIELD1} IN {?Exclude})" but my Exclude parameter obviously returns every record. Users need this to exclude multiple selections. Can I limit what is returned by adding a WHERE clause like "NOT ({TABLE1.FIELD1} IN {?Exclude}) WHERE {TABLE1.FIELD2} = 'Car parts' Obviously not what I've just put as this don't work!?!
    I don't really want to manually set the default selections as there is a huge number to contend with.
    Any help or pointers greatly appreciated!
    Bill

    Post Author: SKodidine
    CA Forum: General
    Your NOT condition seems to be fine (at least in CR XI).  You said it is 'part' of the select.  Could it be that the rest of the selection criteria be causing issues?  Also, is your parameter set up to accept multiple values?

  • Lock in parameter/select-options field

    Hi,
    How can we block another user from executing report with the same value of parameter/select-option field entered on screen by user?
    for example:
    Report ZZZ, parameter field sales org = A, run by user 1.
    Another user, say B, attempts to run the report by entering the same sales org = A. In these second execution of the report, I need to display error message saying that user A is running the report then report cant be run by user B.
    Do i need to put lock object for these?
    thanks alots
    Alia

    No, there is no mechanism to restrict in that way.
      but you can create a Z-table with one column (vkorg)
    now make a little change in the report..
    1.check if any entry of vkorg is there in that z-table.
    if not proceed, else error msg.
    2.craete an entry of that vkog in that z-table.
    3.Normal processing of this report.
    4.at end delete that entry of vkorg from z-table.
    thus you can achieve mutual exclusion.
    cheers.
    Message was edited by: Anid

  • Newbie question - parameter selection -- update the table - basic flow?

    Greetings
    Newbie here trying to work my way through a 'simple' example for a demo.
    I'm currently using a workspace on the Apex web site and have uploaded a table with seven (7) columns of which the first three (3) make up the primary key. This is a copy of an actual Production table so I can't change the PK setup.
    What I'm trying to develop as a demonstration of OAE is a Page 1 parameter form that allows the user to input any portion of any or all of the PK values, press the GO button and have Page 2 be a multi-row form showing the results based on the values input on Page 1 and having the user be able to update any of the remaining non-PK columns. After pressing an 'Apply Changes' button to perform the update the user will press a 'New Query' button and go back to Page 1 with the original values cleared out.
    It sounds pretty straight forward but I know the 3-column PK creates some headaches.
    What I'd like is some guidance on what types of pages I need to create and how to clear out the parameter values.
    I was able to create a page with the parameters on it and get them assigned to the session variables but was not able to create the 2nd page that would even just report on the data based on the input parameters.
    I don't need the user to be able to add or delete rows, just update existing ones to correct data values.
    I'm continuing to go through the documentation and manuals but a little nudge in the right direction would certainly help.
    Many thanks for sharing your experiences.
    -gary

    Hi Ben and any others who elect to reply:
    Thanks to your guidance I've made some good progress. I have been able to create a parameter form that will accept part or all of my three (3) PK columns and put those in session variables. a 'GO' button is pressed and the 2nd page comes up which is based on a SQL query using the session variables from the first page and displays multiple rows of data. It even shows the correct data!
    I also modified the non-PK column attributes to make them updatable, at least I can over-type what shows up.
    The issue I'm struggling with now is how to get the COMMIT to happen to the database. I have an 'APPLY CHANGES' button on my report page and I thought I was relating that to a simple 'COMMIT' PL/SQL page process, but nothing gets committed.
    Do I need to code a manual version of a multiple row update (MRU)?
    If so, how do I do that?
    If not, what basic piece of understanding am I missing?
    Many thanks for your help.
    -gary

  • Formatting the Multi-Valued Parameter Selection in report builder 3.0

    Hi All,
    I have a field from a data set and i assigned it to a parameter that selects multiple values.
    But i want to format(i need only substring of that field value) the data set field value for the user to select those values.
    I build a report dataset model for my report. so I am getting the field values that are present in my database.
    So, how can i change those values before assigning them to the parameter?
    Regards,
    Ganga

    Hi Ganga,
    Based on your description, you want
    a parameter get values from a query but you need only substring of the field value. Right?
    In SQL Server Reporting Service, you could add a
    Calculated Field in the data set. Using expression to substring the field from query. Then we can use this calculated field in parameter.
    We have tested this scenario in our environment. Please refer to steps below:
    Right-click the data set in the Report Data window and select Add Calculated Fields.
    Click “Add” button to add a calculated field(Named “SubString”). Use text functions like Left() and Right() to substring data filed. Type in the expression like:=Left(Fields!CalendarYear.Value,1)+Right(Fields!CalendarYear.Value,2).
    The result is like below:
    If you have any more questions, please feel free to ask.
    Regards,
    Shrek Li

  • How to populate the parameter selection with a formula

    Post Author: jhartney
    CA Forum: Formula
    Confused or maybe just way to much coffee but I need some help here.
    I want to create a dynamic multiple select parameter field pulled from the database.  The fields in the DB are FIRSTNAME and LASTNAME and I want to concat those to look like "LASTNAME, FIRSTNAME" and populate the parameter list.  The selection from that list will later be passed to the record selection to match in a different database table/field FULLNAME.
    JON

    Post Author: jhartney
    CA Forum: Formula
    Answered my own Q,
    I created a SQL command and used that to populate the parameter field.

  • Dynamic Parameter List questions: Length and Custom Values

    I've got a Crystal Report that I want to use Dynamic Values for.
    Right now... this report is simply a "SELECT stuff  FROM table" SQL query... with a parameter that the report uses to filter.
    I use a "Select DISTINCT value from table" to generate a list of values. I put those values into a txt. I then import the text into a static list. This creates a parameter list that is 11 "pages" long on the parameter screen. I also have "custom" values allowed. This is to allow for "new" values and also allow not needing to browse 11 pages for one or two known values.
    If I turn the parameter into a Dynamic List based on the same Select statement it stops at 5 pages, obviously cutting off half of the possible values.
    Dynamic List also removes the ability to do Custom Values. The filter option wouldn't be a bad alternative BUT it don't work for pages 6+ that aren't there.
    How can I remove the 5 page limit (or whatever it is) for Dynamic values?
    Thanks
    Chris
    Edited by: WernerCD on Aug 4, 2010 4:14 PM

    There is a limit of 1000 records in dynamic parameters. You can change this by adding a registry value:
    registry key : HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV
    and then add a key called MaxRowsetRecords and give it a value.
    if you have Crystal 2008 then the above registry folder will say Suite 12.0.

  • How to fill empty parameter (selection-option)

    Hi!
    On selection screen I have two parameters (s_egrid and s_empid). If user enter something in first (but not in second) one, second one should be filled from database.
    The problem is that I don't know how to fill the empty parameter.
    Let's say that i have an internal table i_zemployee with list of all necessary employee Id's (stored in field empid)
    if I Ioop like this
    loop at i_zemployee into wa_zemployee.
        insert wa_zemployee-empid into s_empid.
      endloop.
    ... I did something stupid but i hope that you understand what i need:
    s_emipd[1] = 'u1'.
    s_emipd[2] = 'u7'.
    s_emipd[3] = 'u9'.
    ... like array of user id's.
    and this s_empid I need in my next SELECT statement like
    SELECT * FROM ...
        WHERE empid in s_empid.
    if someone knows the solution thanks in advance!
    T.

    HI try something like this...
    tables: mara, makt.
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab.
    data : begin of btab occurs 0,
    maktx like makt-maktx,
    end of btab.
    ata mak like makt-maktx.
    DATA : return like ddshretval occurs 0 with header line.
      data: begin of dynpfields occurs 3.
              include structure dynpread.
      data: end of dynpfields.
    select-options: p_matnr for mara-matnr.
    select matnr from mara into table itab where matnr IN p_matnr.
    loop at itab.
    write: / itab-matnr.
    endloop.
    Initialization.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
    REFRESH ITAB.
    SELECT matnr FROM mara INTO TABLE ITAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'MATNR '
    dynprofield = 'P_MATNR '
    dynpprog = sy-REPID
    dynpnr = sy-dynnr
    value_org = 'S'
    TABLES
    value_tab = ITAB
    return_tab = return.
    select single maktx from makt into  mak where matnr = return-fieldval.
    p_matnr = return-fieldval.
    refresh return.
    clear return.
    move 'P_MAKTX' to dynpfields-fieldname.
    move mak to dynpfields-fieldvalue.
    append dynpfields.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname                     = 'SY-REPID'
        dynumb                     = '1000'
      tables
        dynpfields                 = dynpfields
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    refresh return.
    clear return.
    validate according to ur requirement.
    Regards
    Syed A

  • Need help with Default Parameter selection

    Hi there ,
    I'm using SSRS 2012 and I've 2 level cascading parameter (section depends on division parameter).
    Division 10 has 2 sections which are 10 and 11.
    Division 20 has 2 section which are 20 and 21.
    Division 30 has 1 section which is 31.
    Division 60 has 2 sections which are 60 and 61.
    I want to set default values to min - max values of Section parameter depends on current values of division parameter.
    In the picture below is the correct result.
    Problem will occur when changing Division.To from 20 to 60.
    I expect the Section.To must changed to max value of it(61) instead the current value(21) like picture below.
    I've checked the query operation using SQL Profiler that tell me the Min - Max dataset of Section parameter NOT BEING FIRED when I change
    Division.To selection.
    FYI.
    I'm using 2 datasets separate for available,default values in each parameter.
    i.e. Section.To parameter  
    1. available values
    SELECT DISTINCT(SectionCode)
    FROM Section
    WHERE DivisionCode BETWEEN @DivFrom and @DivTo
    2. default values
    SELECT MAX(SectionCode) Max
    FROM Section
    WHERE DivisionCode BETWEEN @DivFrom and @DivTo
    Can you give me some advice how to fix this problem ?
    Thank you in advance.
    SweNz

    Hi,
    I had used one sample table to populate your data on top of it i had created report with parameters and got the result as u expected (Hope). Check the below contents to simulate the requirement.
    =====================================================
    CREATE TABLE div_sec
    division int,
    section int,
    range int
    INSERT INTO div_sec (division,section,[range]) values ()
    INSERT INTO div_sec (division,section,[range]) values (10,10,0)
    INSERT INTO div_sec (division,section,[range]) values (10,11,1)
    INSERT INTO div_sec (division,section,[range]) values (20,20,0)
    INSERT INTO div_sec (division,section,[range]) values (20,21,1)
    INSERT INTO div_sec (division,section,[range]) values (30,31,0)
    INSERT INTO div_sec (division,section,[range]) values (30,31,1)
    INSERT INTO div_sec (division,section,[range]) values (60,60,0)
    INSERT INTO div_sec (division,section,[range]) values (60,61,1)
    SELECT * FROM div_sec
    --Created 3 Datasets with the below queries
    --ds_Div
    SELECT distinct division FROM div_sec
    --ds_Sec_Min
    SELECT division, section
    FROM div_sec
    WHERE (range = 0) AND division = @div
    --here for @div assign the value from @DivFrom Parameter
    --ds_Sec_Max
    SELECT division, section
    FROM div_sec
    WHERE (range = 1) AND division = @div
    --here for @div assign the value from @DivTo Parameter
    --Create the 4 parameters
    --DivFrom
    --in available value select the ds_Div dataset
    --DivTo
    --in available value select the ds_Div dataset
    --SecFrom
    --in available and default value select the ds_Sec_Min dataset
    --SecTo
    --in available and default value select the ds_Sec_Max dataset
    =====================================================
    Sridhar

  • Parameter & Select Option

    Hi Experts,
    I've defined one parameter for company code(BUKRS) &  one select option for valuation class (BWKEY) in my selection screen.
    If I select any comp code in the parmeter, then in F4 help for valuation class should show only valuation class assigned to that comp code.
    It can derived from table T001k .
    Could anybody help in this issue?
    Points for Sure.
    Thanks,
    Ponraj.s.

    Hi,
    Check the below code.
    tables: t001k.
    For Identification Number
    DATA: BEGIN OF it_bwkey OCCURS 0,
            bwkey LIKE t001k-bwkey,
          END OF it_bwkey.
    data: v_bukrs(4).
    For Run date
    DATA: BEGIN OF it_bukrs OCCURS 0,
            bukrs LIKE t001k-bukrs,
          END OF it_bukrs.
    DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS:    p_bukrs(4) TYPE c.
    SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK main.
    Validation Section
    INITIALIZATION.
      SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'BUKRS'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'P_BUKRS'
          value_org       = 'S'
        TABLES
          value_tab       = it_bukrs
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.
      TABLES: t130r.
      DATA: BEGIN OF dynpfields OCCURS 0. "Hilfsstruktur zum auslesen des
              INCLUDE STRUCTURE dynpread. "Feldwertes vom Dynpro bei >F4<
      DATA: END OF   dynpfields.
      DATA : sy_repid LIKE sy-repid,
             sy_dynnr LIKE sy-dynnr.
      CLEAR dynpfields.
      REFRESH dynpfields.
      dynpfields-fieldname = 'P_BUKRS'.
      APPEND dynpfields.
      Lesen des akt. Wertes von Dynpro
      sy_repid = sy-repid.
      sy_dynnr = sy-dynnr.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = sy_repid
          dynumb     = sy_dynnr
        TABLES
          dynpfields = dynpfields
        EXCEPTIONS
          OTHERS     = 01.
      IF sy-subrc = 0.
        READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
        IF sy-subrc = 0.
          v_bukrs = dynpfields-fieldvalue.
        ENDIF.
      ENDIF.
      SELECT bwkey FROM t001k
      INTO TABLE it_bwkey
      WHERE bukrs = v_bukrs.
      DELETE ADJACENT DUPLICATES FROM it_bwkey.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'BWKEY'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'S_BWKEY'
          value_org       = 'S'
        TABLES
          value_tab       = it_bwkey
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Message was edited by:
            Velangini Showry Maria Kumar Bandanadham

Maybe you are looking for