Crystal Report Parameter Default Value

Hi All,
I have one issues regarding the parameter in the report.
I have two parameter field in the report. The scenario will be as below:
In my report, i have mobile no & passport no parameter selection. Currently in my report, the selection was like below:
{pax.mobile} = {?mobile} and
{pax.passport} = {?passport}
Formula above was placed in report's select expert. Each time user need to select or enter the two parameter above in order to select the entered data to be reflected into the report. However, my report REQUIRED to allowed null value from the parameter selection. I can enter mobile no but leave passport null, however with the formula above was unable to proceed to refresh the report. I have the formula as below, however it could not be able to work.
(if(hasValue({?mobile}) = true) then {pax.mobile}  = '*ALL'
else {pax.mobile} = {?mobile} ) and
(if(hasValue({?patssport}) = true) then {pax.passport}  = '*ALL'
else {pax.passport} = {?passport} )
The formula above will display all of the records and sometimes it will b hung.
Appreciated anyone who knows this able to advice.
Thanks.
Regards,
CK

hi,
Thanks for your feedback.
I have try one of the example below:
if(hasValue({?Country})=false) then true
else {Customer.Country} like '*'&{?Country}
If country parameter is null, it will retrun all country. But i would like to return Country = 'USA' if my parameter value is null.
Is this possible to do it in the formula above? I tried something like below, but if has parameter value it will return the USA as well.
if(hasValue({?Country})=false) then {Customer.Country} = "USA"
else {Customer.Country} like '*'&{?Country}

Similar Messages

  • Report Parameter Default Value at runtime

    Post Author: DMiller
    CA Forum: .NET
    Hi,
    I need to be able to create new parameters at runtime and have been somewhat successful in this endeavor. I have one remaining issue that I am hoping that somebody can help me with. Let me explain.
    When you create a parameter from within the Crystal XI designer, you are able to specify a number of default values that will display as a list box at runtime. Eg. ParameterName is MaritalStatus and default values are ("Married", "Single", "Divorced" etc). There is also the ability to specify the Default Value in the Value Options area of the screen. This value could be set to any one of the default values above - let's say that I set it to "Single". By setting the Default Value, this causes the Parameter Fields screen, at runtime, to "Select" the specific default value set above - in this case "Single", instead of showing "..." as the parameter value.
    The default value setting in the Value Options is beneficial when you have reports that are usually run with certain parameter values and only occasionally these need to change. Instead of having to specify every parameter value, the user only has to set the ones that have not been defaulted or they want to change.
    So, I have been successful in creating the parameters at runtime and successfully running the report. I have been unsuccessful in setting the "Default Value" as seen in the Value Options area. I have tried a number of properties on the report parameter object and have not found anything to set this.
    Does anybody know how to set the "Default Value" as seen in the Value Options area in the designer at runtime?
    Thanks for any help.

    Post Author: JerryB
    CA Forum: .NET
    You have described my scnario to a tee.  Did you ever figure out how to get the single default value that is available in the "value options" area when working within the Crystal Reports development environment.  I am using VB.Net and have a nice report menu form and viewer but recently a user ask me to set the default value in one of my combo boxes and I have been unsuccessful in finding the correct property to use.

  • Report parameter default value do not default correctly

    Hello Experts, I have a cascading parameters in my report.
    The first parameter called "Project" will allow to select a single Project Name from the list and based on the Project Name, the second parameters which is a "Date" parameter will give out list Months and Year in the Format 'Nov-14'. 
    For this Second parameter I defaulted the parameter to show First Month in the retrieved list of Months. But the problem is it will display the default Date correctly only certain times (there is a refresh problem). If i select a different project and it
    has a month that was retrieved in the first project it will still show the that Month but not the actual default month (Start Month) for that particular Project.
    Example: If I select Brisk from Project parameter, It will give me 18 months of Dates in the Date parameter. In that 18 month range first month is Sep-13 it will default to Sep-13 correctly. Then if I select a different project like "Creek" (example)
    as Project , the Date parameter retrieves some dates corresponding to Creek Project and in the retrieved months if  Date parameter has Sep-13 it will still show Sep-13 even though the
    Start Date for Creek project is Jun-12.
    1. Project Brisk: Defaulted correctly to Sep-13
    2. Creek Project : Should default to Jul-12 but still shows Sep-13
    Just for default value I created a separate dataset and used it to populate the default value and the SQL I used just for default value is as below:
    SELECT DISTINCT TRUNC(DATE_KY, 'MM') AS DEFUALT_DATE
    FROM            DATE_D D
    WHERE        (DATE_KY = ADD_MONTHS(:PROJECT_DT, - 6))
    Date parameter datatype is Date/Time,
    Available Values Tab: label field is a String but the Value field and the default field (Default Values tab) are Dates 
    Thanks in advance

    Thanks Vicky for reply.
    Yes you are right but I did not use First function as the query above retrieves only one date.
    I used your suggestion but it did not fix it.
    In this report I have three parameters.
    1. Project Code (Visible)
    SELECT DISTINCT PROJECT_CODE
    FROM      DIM.PROJECT     
    ORDER BY PROJECT_CODE
    2. Project Date (Invisible)
    SELECT
    MAX(CASENA.MILESTONE
    WHEN'ABCD'THENTRUNC(PROJECT_DATE,'MM')ELSENULLEND)PROJECT_DATE
    FROM
    DIM.PROJECTNA
    WHERE(NA.PROJECT_CODE
    =:PROJECT_CODE
    or'ALL'=:PROJECT_CODE)
    3. Start Date (Visible):
    Available Values Query:
    SELECT DISTINCT
    --DER_DATE is "Value Field"
    TRUNC(D.DATE_KY, 'MM') DER_DATE 
    --Display_date is "Label Field"
    , TO_CHAR(D.DATE_KY, 'Mon-YY')   Display_Date
    FROM DATE_D D
    WHERE DATE_KY BETWEEN ADD_MONTHS(:PROJECT_DATE, -6)  AND ADD_MONTHS(:PROJECT_DATE, 6)
    ORDER BY 1
    Default Values Query:
    SELECT DISTINCT TRUNC(DATE_KY, 'MM') AS DEFUALT_DATE
    FROM            DATE_D D
    WHERE        (DATE_KY = ADD_MONTHS(:PROJECT_DATE, - 6))
    When you select a Project from "Project Code", it will give a "Project Date" and based on the "Project Date" it will give a date range in "Start Date". That is why I am using "Project Date" parameter in my
    query. I even tried using Project code as you suggested but I still got the same result.
    Thanks a lot for your reply.

  • Crystal report parameter defalut values in infoview

    Hi All,
                I am working on crystal reports, and  i have created a local variable in the crystal and set a default value. I aslo deploy it to the BO enterprise . When i open the report from the infoview, the default values which was set in crystal is not available.We can set this at the CMC level, but a developer may not have access to CMC other than Instance manager. Do we have any other option for the same to get the default values in infoview. Appreciate your help at the earliest.
    Thanks & Regards,
      Magesh Anandan.

    Hi Deidra,
    You can download latest service pack and hotfix from the following link:
    [https://www.sdn.sap.com/irj/boc/businessobjects-downloads]
    Have a look to Knowledge base article 1219377 - Error "ERROR: Thread was being aborted" in .NET InfoView .
    Hope this helps!!
    Regards,
    Shweta

  • Crystal Report Parameter multiple values

    In crsytal report 2008, I created a report to enable user to view list of sales order. I created the following parameter to display list of sales order:
    doc@select docnum from ORDR
    In SAP B1 8.8, it displays a dropdown list of SO and users can select one sales order at a time to view the report. However, is there a way for users select MULTIPLE SO from the dropdown. I know in the parameter properties, you can set the 'enable range values' to TRUE. The end result of that is it generates a range for users to choose from (docnum next to each other). Instead of selecting range of SOs, is there a way for users to select random SO from the list? Example, from the list, select SO 13000, 13010, 14000 etc. Thanks.

    Daniel,
    Excellent, I changed
    - list of values from static to dynamic
    - changed toke from @select docnum to @select *
    - changed select criteria from docnum to docentry
    The list works fine.
    From the multiple values selection screen in SAP, it shows the following three columns:
    - Value (DocEntry)
    - Description (DocNum)
    - Check Box
    I was able to hide the vlaue (docentry) column from form settings. However, can I change the name of 'Description' to something more meaningful like 'Sales Order #'? Also, the description column is really wide. Is there any way I can narrow the column width?

  • Parameter default value issue

    Hi, I am using SQL Server 2008 R2 database & SSDT (Visual Studio 2012) to develop reports. I am trying to modify an existing report after the upgrade and something seems not right especially with report parameter default values. I am using the expression
    below and for the default value its always returning the false part. When I put this expression in a textbox to test results it works as expected. Thanks in advance.
    =IIf(Parameters!Area.Value = "Test Area", "1", "2")
    Ione

    Hi Lone,
    Per my understanding you are experiencing the issue that the report parameter’s default values not work, the default values for this parameter is using the expression based on another parameter, but now it not always display the correct value, right?
    I have tested on my local environment and can reproduce the issue, the issue can be caused by you have not specified available values for this parameter base on their parent parameter(Area), so the parameters will not refresh when the value of the first
    parameter has changed. In Reporting Services, if we want to create cascading parameters, we should specify both available values and defaults values for child parameters.
    Please specify the Available values as below, using both the expression in the Label and Value:
    =IIf(Parameters!Area.Value = "Test Area", "1", "2")
    You also use an alternative method to create this parameter without using the expression:
    Create an Dataset using below query to get the Parameter(“1”,”2”):
    select distinct (CASE WHEN (@Area) =' Test Area' THEN '1' ELSE '2' END) AS  FieldName  from TableName.
    In  the Second Param(Param2) In both the “Available Values” and “Default Values” select the “Get values from a query”.
    For more information about how to create cascading parameters, please see MSDN document which tell us how to do it steps by steps.
    http://msdn.microsoft.com/en-us/library/aa337498(v=sql.105).aspx.
    If your problem still exists, please feel free to ask.
    Regards
    Vicky Liu

  • Dynamic parameter default values

    Hello guy,
    i'm having a little problem, i hope someone in here can help me. So, here is my situation:
    I'm building a windows forms application in C# to display some reports. As i want to redesign all the controls, i made my own prompt to fill in the parameters. This works really fine, except one thing:
    Whenever a parameter has default-values (so just a list of values is allowed), I switch from a textbox to a dropdown-menu filled with the default values.
    No problems with static parameters, but i can't find a way to access the default values from dynamic parameters (values are retrieved from SQL-Server). The default prompt from the report-viewer can do it right, so i hope  you can hep me with my following question:
    Is there a way to obtain these values? Or at least the SQL-statement that is used to get them?
    thanks
    using:
    Visual Studio 2010 v10.0.30319.1
    Crystal Reports runtime engine .NET 4, v13.0.1.220
    Crystal Reports for Visual Studio v13.0.1.220
    Edited by: Peter Wurstberg on Oct 12, 2011 1:15 PM

    I don't think the CR or Enterprise .NET SDK has any public APIs to retrieve default dynamic prompt values for crystal report parameter. With Java SDK there are no direct methods as well, however you can tap the HttpResponse object to read the prompt values that are sent to your viewer by the server as the viewer displays them and prompts you to select parameter value, however this method is not officially supported. With .NET SDK I am not sure if it is even possible. You have to use the standard viewer to see those values and let the viewer prompt with them, ratherthan your own controls.
    Hope that helps.
    Aasavari

  • Crystal Reports Date Parameter Default Value OPtion Empty

    Is there a way to set a default date value for a Date Parameter? It is shown empty, it only allows to set a fixed date, i.e. 10/10/2013. But it doesn´t allow me to use a formula (which has a CurrentDate inside), so I can set, for example, today's date as default.
    How can I achieve this? I´m not using Crystal for Enterprise. I'm using Crystal Reports, the normal version.

    Hi Erika,
    The feature is only available in CR for Enterprise at the moment.
    If you're OK with selecting the currentdate from the dropdown, here's a workaround:
    1) Go to the Database Expert > Click the Connection Name > Select 'Add Command' > Type in a simple sql query that returns today's date. Example for oracle would be:
    Select SYSDATE from DUAL
    2) Don't link this Command Object with other tables on the report
    3) Create a new Parameter > Select 'Dynamic' under 'List of Values' > Under the 'Value' column choose 'SYSDATE' from the command object > Click create parameter > OK
    -Abhilash

  • Parameter Default values

    Does anyone know how to set up more than one defult values in a parameter.  I am on cr version11 and it appears to only allow one default value

    what version of crystal reports that you are using? if you are using CR2008 then make the parameter as optional and in the record selection try this
    if hasvalue({?parameter}) then
    {field}={?parameter}
    else
    {field}=currentdate
    So now if you run the report without entering any value in the parameter then it takes today date.
    regards,
    Raghavendra.G

  • Programatically modifying Parameter Default Values in CR10 rpts

    If this isn't the correct forum for this, then I apologize.  Here is the situation:
    Our company uses Microsoft Dynamics SL version 7.0 (formerly Solomon), which leverages a "runtime" version of Crystal Reports 10 for some custom reports (simply named "Crystal Reports 10 for Solomon").  These reports are stored as .rpt files but are opened from within Dynamics.  About 15 of these reports have a "client" parameter and I am having to manually refresh the list of default values once a month because new clients are always getting added to the system.  As you can imagine, this is a pain.
    My goal is to write a simple console app that can programatically refresh the default values.  I would then schedule it to run nightly.
    I've downloaded the CrystalReports files for VS2010 (from http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp) and I almost got it working, but I noticed a problem.  If I save the file using the ReportDocument.SaveAs() method, it seems to save the rpt as a newer version of CrystalReports.  When I open the report with "Crystal Reports 10 for Solomon", I get a message that says "This report was created with a version of Crystal Reports for Solomon which is later than the version you are running.  Some features used in the report may not be supported."
    Is there any way to save it in the native version of the original rpt?  Is there an older version of Visual Studio (such as 2005?) or an older SDK that could be used to save the report as CR10?
            static void Main(string[] args)
                ReportDocument rpt = new ReportDocument();
                rpt.Load(@"P:\Usr_Rpts\08CARDC - pgaule.rpt");
                //open the report
                Console.WriteLine(rpt.ParameterFields["ClientName"].DefaultValues.Count.ToString());
                rpt.ParameterFields["ClientName"].DefaultValues.Clear();
                Console.WriteLine(rpt.ParameterFields["ClientName"].DefaultValues.Count.ToString());
                rpt.SaveAs(@"P:\Usr_Rpts\08CARDC - pgaule.rpt", ReportFileFormat.VSNetFileFormat);
                rpt.Close();

    Hello,
    The short answer is that there's no way to "save down" your reports to the CR10 version without using CR10 (or CR 10 runtimes). The bundled versions of CR that ship with earlier versions of Visual Studio are built on the same CR10 code stream, but they're still not the same version. The warning message would not be eliminated by using an older version of Visual Studio.
    The only way to eliminate the warning message would be to create an application that was created with the stand alone version of CR10. I expect it would be very difficult to find a copy of CR10 Developer edition. CR10 reached End of Life for patch support in January, 2007.
    The warning message you're seeing when you open the updated report is just saying that you're opening a "newer" report with "older" runtime files. You're not really adding any new functionality to the RPT files so the warning can be ignored. If you were trying to use a dynamic cascading parameter (new functionality) this would not work correctly in your Solomon v10 application.
    Even though you can ignore the warning message there's no way to suppress it that I'm aware of.
    Sincerely,
    Dan Kelleher

  • How to parse crystal report query prompt value via url parameters

    HI All,
    I am creating a employee detail report in crystal report. The recordset is huge and i have created a parameter prompts in the query and thinking to parse the prompt value via url parameters. Not sure why i still could not make it works.
    for example, in my query panel i have created a prompt called "pwwid"
    and this is how i parse the prompt value via open document url.
    OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AV8U6HlIq4FBl_MhcBwHqGI&lsSpwwid=12345678
    I read the sap documentation, this is how it parse the prompt value via url parameter. but it is not working for me and i am getting prompt to fill in the wwid whenever i run the reports.
    any idea why i am not getting this works?
    Regards,
    KeatAun

    Could you try:
    OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AV8U6HlIq4FBl_MhcBwHqGI&lsSpspwwid=12345678
    -Abhilash

  • Ssrs parameter default value not showing ,when available values is binded to query dataset

    I have developed a report using sql server data tools for vsiual studio2012 ,i have defined few parameters ,on one of the parameter when available values is binded to a dataset query, the report default value is  not showing in report preview .
    Many Thanks
    Chandra

    Hi Chandra,
    According to your description, you have set the default value for a parameter, but it's not displayed when initially running the report. Right?
    In this scenario, since you have set the available values bind to query, so your default values should be within these available values. If these default values are not within the available values, the default values will be not displayed. So please check
    the default values.
    Reference:
    Add, Change, or Delete Default Values for a Report Parameter (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Crystal report parameter issue in SAP B1 8.8

    Hi Experts,
    We are facing following issue in Crystal report SAP B1 8.8 version
    Can not open crystal report without mentioning optional parameters.
    User is forced to mention all parameters
    User should allow to open crystal report by mentioning mandetory parameters
    if We set for the parameter value of field [Optional Prompt] to 'True' and then preview in SAP Business One, then although the dialogue is displayed,  click 'OK' without populating the parameter value, the report is run
    but in our case we are passing parameters through Stored Procedure and this option is block in report to do so.
    means that option available to make optional true / false is block and we are not able to do anything.
    Pls. provide solution
    Regards
    Kamlesh Vagal

    Julie.
    This change has already occurred?
    Thanks.

  • Crystal report parameter usage

    Hi all,
    I am facing a issue in designing crystal report. I want to display records in report as per user entered value of date parameter but  in database if data is not present for given input date value then the report should run for value which is one older than given input date value which is present in database (In short, report run for near by older value than input date value if record is not present for entered input value)  .
    How to do it in crystal report.
    Please help.
    Any comment is valuable.
    Thanks

    You can try this - In your sql query select data for both the dates - input date and next higher date (something like where sale_date = {input date} or saledate ={input date}+1)
    In Crystal do a record select filter to display the data for input date
    For eg:
    if sale_date ={input date} then
        if count(sale_id) is not null then 'sale amount'
    else ' '.
    Basically use the idea not sure about how to put it in syntax without looking at other report elements....Hope it helps

  • Regarding the Report's Default Value

    Now the default value of the CrystalDecisions.CrystalReports.Engine is empty which is a problem clarified by both Luke and Don Williams. Don provided a good tips for code, referring Don's reply at Jan 10, 2014 and Jul 31, 2012, I’ve tested this and it is worked, and I got a default value. However, the other sever problem has been occurred. Since the unmanaged code (COM) can't construct (casting) to the managed code directly, since it is a interface. Otherwise the original all Crystal Document objects will be wiped out, and become null value. Here is my analysis referred Don’s code:
    foreach (CrystalDecisions.ReportAppServer.DataDefModel.ParameterField rasParamfield in                                                             myReport.ReportClientDocument.DataDefController.DataDefinition.ParameterFields)
    Here myReport is coming from CrystalDecisions.CrystalReports.Engine.ReportDocument, so this code will not be useful if you want to keep myReport active. From this point, I do not know what another alternatives could be used to achieve this or using Reflection , and how?
    Any responses would be so appreciated.
    J. Huang

    Hi Johnson,
    Correct, but mostly it works without having to set the viewer to the RAS Report Object but just in case you do then I use a flag id RAS has modified the report and set the viewer accordingly:
    You still need to open the report by the Engine but then assign it to the RAS client Doc:
    add these assemblies:
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.ReportAppServer;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ReportDefModel;
    using CrystalDecisions.ReportAppServer.CommonControls;
    using CrystalDecisions.ReportAppServer.CommLayer;
    using CrystalDecisions.ReportAppServer.CommonObjectModel;
    using CrystalDecisions.ReportAppServer.ObjectFactory;
    using CrystalDecisions.ReportAppServer.Prompting;
    using CrystalDecisions.ReportAppServer.DataSetConversion;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    using CrystalDecisions.ReportSource;
    Global flag:
    bool IsRpt = true;
    CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
    In the routine to you update the values add IsRpt =  false;
    In your open method use this:
    rptClientDoc = new CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument();
    rpt.Load(rptName.ToString(), OpenReportMethod.OpenReportByTempCopy);
    rptClientDoc = rpt.ReportClientDocument;
    Then in the view report button use this:
    try
        if (!IsRpt)
            crystalReportViewer1.ReportSource = rptClientDoc.ReportSource;
        else
            crystalReportViewer1.ReportSource = rpt;
    catch (Exception ex)
        btnSQLStatement.Text = "ERROR: " + ex.Message;
    Don

Maybe you are looking for