SSRS Cascading Parameter Setting Default Value of Parameter by Expression

Hi All,
I need some help on an issue I am running into in SQL server 2008 report parameters. I have the following Report Parameters defined:
1) @PredefinedDateSelection - Boolean (User Selectable True/False, Default Value - 'False')
2) @StartDate - Text (User input text box)
If @PredefinedDateSelection = TRUE, then I would like to provide a particular default value to the StartDate textbox (i.e. @StartDate Default Value), If @PredefinedDateSelection = FALSE, then I would like to provide a different default value.
I have the following code for the Expression for the Default value of @StartDate: =code.GetStartDate(Parameters!PreDefinedTimeSelection.Value)
where GetStartDate is a very simple VB function defined as :
Public Function GetStartDate(x as boolean ) As String
Dim a as string
Dim b as string
a = "Report Uses Predefined Values"
b = "Please Input Value"
If (x) then
Return a
else
Return b
end if
end function.
Now the default value of @StartDate stays set as "Please Input Value", and does not change when I toggle @PredefinedDateSelection from False to True and vice versa. I was expecting to see the Default value to change between the two messages depending on my selection in the report preview.
Another parameter which is a dropdown and uses a dataset to display two different set of selectable items depending on the value of @PredefinedDateSelection is working just fine. I am not sure if I am missing something or I am doing something wrong.
Instead of using the VB code I also tried : =iif(Parameters!PreDefinedTimeSelection.Value = True,"Report Uses Predefined Values","Please Input Value")
I also tried changing the default value using a dataset with SQL query and the available value set to NONE, so that the user could input. But the Default value does not refresh or change values.
 I hope I have explained my question clearly. I would really appreciate any thoughts and comments.
Thanks,
Arunesh

Thank you much for your response.
I tried that and it did work. But my requirement is to have a user input the date. The basic idea is if the user decides on a predefined time range like Day Shift Today or Yesterday and so on... then the report would automatically calculate the values based on predefined date time values. On the other hand, if the intent is to run the report for an arbitrary period then the user supplies the date and time limits.
What I am trying to achieve is have the same parameter available for user input , but when the User decides he wants Predefined then the "textbox" populates with date and time as per his choice of predefind range.
I understand that by this the user can still overwrite the date and time on the text box, but the report will run the predefined values as long as he has the @PredefinedDateSelection Set to true.
Is there a way I can impement this?
Once again I thank you and appreciate  your input.

Similar Messages

  • Set default value for parameter fields

    Good day!
    Situation:
    1. I have 2 parameter fields in reports (dateFrom and dateTo)
    2. Before running report in ASP.NET I change value this fields (dateTo = today, dateFrom = today - 3 days)
    3.I use for this source:
    foreach (ParameterField crParam in CrystalReportSource1.ReportDocument.ParameterFields)
                            CrystalDecisions.Web.Parameter crParametr = new CrystalDecisions.Web.Parameter();
                            string ParametrName = crParam.Name;
                            crParametr.Name = ParametrName;
                              crParametr.DefaultValue = ActionReportParameter.GetParametrValue(ReportName, ParametrName);
                             CrystalReportSource1.Report.Parameters.Add(crParametr);
    4. And repurt run without request value parameter fields.
    5. BUT!!! now I need request value parameter fields before report start running - I want set default values for filelds and offer user change its before report start run.
    How do this?
    Thanks

    I believe you need to create your own parameter promt screen. Capture what the user entered and pass that to the report(?).
    slv

  • How to set default values with parameter ID EVO

    Hi I need to set price adoption as ''do not copy'' in purchasing default values for buyer(OMFI) and need to assign this default value to the user using the EVO parameter.
    I can not see the parameter ID in dropdown list in maintain user screen.
    Can any one help me in this regard?
    Thank you,

    Just addition to Charlie's suggestion, make sure that you put the same value as used while creating parameter ID. if EVO key is created with Z1 and you put z1 then it wont work, you must put the same value Z1.
    Regards
    Arif Mansuri

  • Can we set default value to dynamic parameter?

    <font size="3"><font face="Times New Roman">Hi,</font></font><font size="3"><font face="Times New Roman"><span> </span>I am using BO XI and CR XI.</font></font><font size="3"><font face="Times New Roman"><span> </span>I want to set default value for dynamic cascading parameters as &#39;ALL&#39; when i open report in BO Xi INFO view.</font></font><font size="3"><font face="Times New Roman">I think is not possible.</font></font><span style="font-size: 12pt; font-family: &#39;Times New Roman&#39;">can anybody know solution for this. </span>

    Hi,
    I cannot imagine why you would want to do this. The nextvalue from sequence would just the next available number from the sequence, the numbers wouldn't necessarily even be sequencial. So not very useful as a parameter to a report.
    Rod West

  • How to set Default value of a parameter  to display Current Date

    I need to display the Default value for my parameter 'As of Date' which is of datatype Date as Current Date[DD-MON-YYYY].
    How can I do This??

    As Tamir-L pointed out, there is no direct way to do this, but there is a workaround:
    First, create a new parameter, but do not base it on any item. Give the parameter a default value of "Today".
    Then, create a condition like:
       (    :myParam = 'Today'
        AND <date_item> = sysdate)
    OR (    <date_item> = to_date(:myParam, 'DD-MON-YYYY'))Where :myParam is the parameter you created, and <date_item> is the item you are comparing against.
    To make things a bit more bulletproof, you could create a calculation that returns sysdate when the parameter is 'Today', a date when the to_date is successful, and NULL when the to_date fails, and use the calculation in the condition.

  • How to find out default value of parameter in stored function???

    Hi,
    is there any kind (metadat) how to get default value of parameter of stored function???
    thx

    that's where it's supposed to be, but it doesn't seem to work correctly. I checked on 9 & 10, and the DEFAULT_VALUE column is always null on both. in fact, the underlying column (sys.argument$.default$) is also always null.

  • Start/End Date parameters that check day of week and using to set default values.

    Hi,
    I've got a report that presents data between a start and an end date.
    I want it to check if it's a monday and present data from the previous week, otherwise present data from this week.
    For the "Default" value of parameter @startdate, I've got the following expression:
    =iif(WeekdayName(DatePart("w", Today)) = "Monday",DateAdd("d",-8,Today()),DATEADD("d", 1 - DATEPART(DateInterval.WeekDay, Today(),FirstDayOfWeek.Sunday), Today()))
    for @enddate I've got default value:
    =iif(WeekdayName(DatePart("w", Today)) = "Monday",DateAdd("d",-1,Today()),DATEADD("d", 7 - DATEPART(DateInterval.WeekDay, Today(),FirstDayOfWeek.Sunday), Today()))
    but it doesn't appear to be working, I've checked 
    WeekdayName(DatePart("w", Today))
    as an expression in a text box and it evaluates to Monday but my IIF statement above always uses the DATEADD line therefore not returning "Monday" as the value (even though it is).
    Is it a problem that the parameters are of Data/Time data type and I'm trying to evaluate as type text?
    Any help would be appreciated.
    Thanks :)

    StartDate
    =IIf(DateDiff(DateInterval.Day,CDate("01/01/1900"),Today) Mod 7 =0,DateAdd(DateInterval.WeekOfYear,DateDiff(DateInterval.WeekOfYear,CDate("01/01/1900"),Today)-1,CDate("01/01/1900")),DateAdd(DateInterval.WeekOfYear,DateDiff(DateInterval.WeekOfYear,CDate("01/01/1900"),Today),CDate("01/01/1900")))
    EndDate
    =IIf(DateDiff(DateInterval.Day,CDate("01/01/1900"),Today) Mod 7 =0,DateAdd(DateInterval.Day,-1,DateAdd(DateInterval.WeekOfYear,DateDiff(DateInterval.WeekOfYear,CDate("01/01/1900"),Today),CDate("01/01/1900"))),DateAdd(DateInterval.Day,-1,DateAdd(DateInterval.WeekOfYear,DateDiff(DateInterval.WeekOfYear,CDate("01/01/1900"),Today)+1,CDate("01/01/1900"))))
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    Hi, 
    This one works but it results to be between monday and saturday, how to make it between sunday and saturday?

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

  • How to Set default value for taxonomywebtagging control with terms and nested terms

    Hi,
    I have created taxonomy control in custom aspx page and I am able to select terms but I am trying to setup default value to that control.
    Can anybody let me know how to set the default value for TaxonomyWebTagging control in custom.aspx page with nested terms?
    Any help would be greatly apprecited.
    Control code in aspx page:
    <td>
    <asp:Label runat="server" ID="lblLanguages">Field A: </asp:Label><asp:Label runat="server" ID="rfvlblLanguages" CssClass="errorMsg" ForeColor="Red">*</asp:Label>
    </td>
    <td>
    <Taxonomy:TaxonomyWebTaggingControl ID="term" Width="385px" runat="server" /></td>Mapping metedata code:TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    //Set the Business Unit Field
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GROUPName"];
    TermSet termSet = group.TermSets["TERMSETNAME"];
    Term term = termSet.Terms["TermA"];
    Guid termGuid = term.Id;
    term.SspId.Add(termStore.Id);
    term.TermSetId.Add(termSet.Id);
    term.AllowFillIn = true;
    term.AnchorId = countryGuid;
    term.IsMulti = true;
    Thank you.
    AA.

    Hi,
    According to your description, you want to set default value for TaxonomyWebTaggingControl.
    I have a test in my environment. It could be achieved by setting the Text Property of TaxonomyWebTaggingControl.
    Here is the code snippet:
    TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GroupA"];
    TermSet termSet = group.TermSets["A"];
    Term term = termSet.Terms["A1"];
    TaxonomyWebTaggingControl1.SspId.Add(termStore.Id);
    TaxonomyWebTaggingControl1.SSPList = termStore.Id.ToString();
    TaxonomyWebTaggingControl1.TermSetId.Add(termSet.Id);
    TaxonomyWebTaggingControl1.TermSetList = termSet.Id.ToString();
    TaxonomyWebTaggingControl1.AllowFillIn = true;
    TaxonomyWebTaggingControl1.IsAddTerms = true;
    TaxonomyWebTaggingControl1.IsMulti = false;
    TaxonomyWebTaggingControl1.Text = string.Format("{0}|{1}", term.Name, term.Id.ToString());
    Here is a detailed article for your reference:
    http://blog.bugrapostaci.com/2010/09/23/taxonomywebtaggingcontrol-sharepoint/
    Feel free to Reply the test result.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to set default value to input field

    Hi Experts,
    I need to set default value to one input field for the transaction crmd_order as a screen variant. Guide me in doing that.
    Regards,
    Harish

    Using the transaction SHD0, you can define the screen variant. While defining the sceen variant, you are allowed to define the default values.
    Using screen variant, for the main transactoin, you can also define the transaction variant and you can use this as an independent transaction.

  • Any opinions on setting default values on Business Partner level?

    Hi All,
    I do not have a question, but would like to have a good discussion on how you should preferably be setting default values on a business partner and it's assignment blocks.
    In my opinion you have two main alternatives:
    1. The "old fashioned" way by using the get_<attribute_name> method and doing some checks for the perticular attribute in the context node.
    2. Using the Badi BADI_CRM_BP_UIU_DEFAULTS to fill fields with a default value. With some enhancements on the assignment blocks (making typed_context attribute public and, when not called yet, calling the badi) you can use the badi for all assignment blocks.
    Because I discovered via debugging that in the, by many forums suggested, badi code a programm error/exception is used so that the default values are only set during creation mode, I started doubting to use the badi. Because once I had set my data declarations to the right references and the exception did not occur anymore, suddenly it always fills the values even when there are already values filled. So additional checks are needed to assure that I am in creation mode.
    Although I like the use of the badi, because all my default values on the whole business partner object can be found in the same place, it is getting a bit strange to: first still enhance the view and context node class, adjust the visibility of the typed_context, call the badi and do all kind of checks to assure that you are in the right view/context node, where this all is faster and more lean and mean when done directly in the get_<attribute_name> method on a context node.
    Anyone who wants to give there opinion on this?
    Regards,
    Martijn.

    Cameron,
    Unfortunately you cannot pass the Account and Contact name before saving the record. Post default tries to capture the name just before the record gets saved, but as the record is yet to be created, the relationship wont exist and only the respective id fields will have values. If you try using account id/ contact id it will work else just pass the time stamp in the name field which will make sure there is some value when the record is saved. later in the back end you might need WS to update the field values.

  • Setting Default values in portal form

    I have a portal Master/Detail Form. I want to set some of the detail block columns value to the value of a field in the master block.
    In the formattng option of the detail column, I tried setting default value to:
    p_session.get_value_as_varchar2(p_block_name=>'MASTER_BLOCK', p_attribute_name=>'A_CLASS_CD');
    and default value type to: function (I also tried expression). It compiles, but gives me an error when I ry running form. How can you set the default value (from the value of a differnt field)?

    HI,
    You can set the default value to value of a different field. The only way is to use javascript like onFocus.
    Thanks,
    Sharmila

  • Setting default values for field on screen.

    Hello,
    I am trying to set default value for one of the fields I have on screen when I execute the custom transaction.
    I am doing that in PBO as follows. But the default value is not set for Date field.
    PROCESS BEFORE OUTPUT.
    MODULE PBO_OUT.
    MODULE STATUS_5000.
    *&      Module  STATUS_5000  OUTPUT
          text
    MODULE STATUS_5000 OUTPUT.
      SET PF-STATUS 'NON_SAP_DOCUMENT'.
      SET TITLEBAR '001'.
    ENDMODULE.                 " STATUS_5000  OUTPUT
    *&      Module  PBO_OUT  OUTPUT
          text
    MODULE PBO_OUT OUTPUT.
      ERDAT = SY-DATUM.
    ENDMODULE.                 " PBO_OUT  OUTPUT
    Please help.
    Thanks.
    Regards,
    Rajesh.

    Works Now...

  • How to hide PNP selection windows and set default values for PNP.

    Hi expert,
         I am using HR logical database PNP, but I don't want to display selection windoes for running program on PNP, whereas I want to set default value for some selection items in the program. could you please tell me how to get those two targets?
    Many Thanks,

    Hi
    You have mentioned 2 things.
    1. Don't want selection windows for running program for PNP - this can be achieved using the HR Report category - You can get more details on HR Report Category on
    HR Report Category
    2.  I want to set default value for some selection items - This you need to achieve in initialization event of your program.
    How you can get this can be explained by INITIALIZATION (SAP Library - ABAP Programming (BC-ABA))
    Thanks,
    Sreeram

Maybe you are looking for

  • Safari will not open, error posted

    My Safari will not open. I am unable to get to the tool bar due to the following error. Please help, I have no clue what I need to do. I apologize if I am not suppose to paste the whole error, however I wanted to ensure that whom ever takes the time

  • Maximum Slide Size

    Anyone know if Keynote has a maximum slide size? I'm trying to create a Keynote presentation with a slide size of 4272X1080 and it won't seem to let me put that size in the custom slide settings. I've tried different sizes, but anything above 4000 gi

  • Are the unlocked iPhone 4S sold in Apple stores?

    I'm wondering if it would just be easier for me to go to the Apple store and pick up the phone. That is assuming they actually sell the unlocked ones in the store. Anyone know about this? I recently placed an order for 2 of the iPhone 4S online, but

  • Sharing music via a home server?

    We have the following setup: 1 PC Desktop running W7 1 PC Laptop running W7 1 iMac desktop 2 iPhones (one synced with iMac, one with PC Desktop) 1 iPad (synced with PC Desktop) 1 HP EX495 Windows Home Server that has all our music on it (and recorded

  • 6300 Lost Image Size Menu

    For whatever reason, I seem to have LOST two menu items that I know I used to have: Menu > Messaging > Message settings > Multimedia messages > Img. size (MMS plus) Menu > Messaging > Message settings > Multimedia messages > Image size (MMS) Does any