CR 2008, missing parameter values in parameter list

somehow this thread got posted in the  .NET SDK section, so re-posting here...
When my users run the report, the list of values in the paramter list does not include all the possible values that exist in the view on SQL server.
How can I get ALL the values of the field in the view to show up in parameter list?  What is controlling how many/few values show up?  I have not limited in any way what should be returned from the view (not a cascading set of parameters), and the view is not set up to limit what values are available either.
Thanks for any pointers.
Robert

From a mis-post on the .NET forum, a solution was suggested that works....
Re: CR 2008, all values in parameter list not showing up

Similar Messages

  • CR 2008, all values in parameter list not showing up

    The parameter is not optional, the parameter value exists in the view on SQL server, but at report run-time, only get 5 pages of possible values to select from and user needs to go back farther to get the required report.
    I can get the report to run in full CR version by passing the value into the select expert, but users only get prompt window from the runtime version of CR.
    How can I get ALL the values of the field in the view to show up in parameter list?
    Thanks for any pointers.
    Robert

    Not sure if the help you metion is equivalnet to KB [1218588 - How to increase the number of values in a dynamic parameter list?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333533383338%7D.do], but have a look.
    Also, make sure you are on SP3:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • "Missing parameter values." Error when setting record selection formula

    Setup - VS 2008, CR 2008 (v12.0), Win XP & C#.Net
    I have a form which loops through all parameters (non-linked to sub reports, so only off the main report) and allows users to enter the values for each parameter. When hitting the preview button, I loop through all of the saved values, set the parameter field values and then add any additional filters into the recordselection formula as below. The problem i'm having is that the ReportDocument.HasRecords returns true if the ReportDocument.RecordSelectionFormula doesn't filter out every result.
    For example, I have a list of customers and if I set the selection formula to filter out a specific customer, ReportDocument.HasRecors returns true, if I set the selection formula to filter something that doesn't exist i.e. customer "xk39df", the moment this line of code runs "ReportDocument.RecordSelectionFormula = rsFormula;" - ReportDocument.HasRecors returns the following exception as opposed to "False".
    Message: Missing parameter values.
    Source: CrystalDecisions.ReportAppServer.DataSetConversion
    StackTrace:    at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.hasRecords()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_HasRecords()
    ErrorID: MissingParameterFieldCurrentValue
    The strange thing is, it works fine if the recordselectionformula selects a record which exists in the results - all parameters have a current value except for the linked parameters.
    This one has got me stumped!
    foreach (ParameterFieldDefinition parameterField in ReportDocument.DataDefinition.ParameterFields)
                    var query = ReportObjects.Values.Cast<Filters>().Where(objects => objects.ParameterName == parameterField.Name.ToUpper().Trim());
                    foreach (var item in query)
                        parameterField.CurrentValues.Clear();
                        parameterField.CurrentValues.Add(item.ParameterValue);
                        parameterField.ApplyMinMaxValues(item.MinLength, item.MaxLengh);
                        parameterField.ApplyCurrentValues(parameterField.CurrentValues);
                var records = ReportObjects.Values.Cast<Filters>().Where(recordSelection => recordSelection.RecordSelectionFormula.Trim().Length != 0);
                foreach (var item in records)
                    rsFormula += item.RecordSelectionFormula;
                if (rsFormula.EndsWith(" AND "))
                    rsFormula = rsFormula.RTrim(5);
                ReportDocument.RecordSelectionFormula = rsFormula;

    Hi,
    The report has it's own ADO Datasource set in crystal reports, so I just pass the log on information to the report object before doing anything else.
    this.DataSourceConnections[0].SetConnection("ServerName", "Database", "sa", "Password");
    I then do a refresh before applying the parameter values (I do this because the user can preview the report more than one time by using a preview button on the parameter form without re-loading the report object)
    this.Refresh();
    Then I set all parameter values followed by setting the recordselection formula.

  • Xcelsius missing parameter values (LO 26603)

    Hi experts,
    I've created a dashboard against a BW query using Live Office and a Crystal Report as the data source. Live Office and everything under it is using SAP authentication. When I click on the Refresh All Objects button in Live Office, I'm prompted for required parameters and then the data is refreshed successfully. However when I click Preview to generate the swf file, I get a "Cannot access external data.  Missing parameter values (LO 26603)" The Crystal Report's database config has been set to logon as a specific SAP user and refreshes successfully from Infoview.
    Business Objects Edge 3.1 SP3
    Xcelsius 2008 SP3
    SAP Int Kit SP3
    Any suggestions?
    Cheers
    Keith

    Which version of MS Office do you use? Any MS Office Service packs installed?
    Regards,
    Stratos

  • Use of layout when more than one parameter - Error Missing Parameter Values

    Hi,
    Is it possible to use a crystal report which has more than one parameter as the layout for the bill of materials report.
    I have 3 parameters
           1. DocKey@       The Bill of Materials to be printed
           2. Number of levels to be printed
           3. type of levels to print.
    When I try to print it gives me the error Missing Parameter Values.
    I have tried changing the DocKey@ to CodeKey@ but the same error.
    Does anyone now where to find a list of these tokens?
    Thanks
    Chris

    I looked at the crystal report conversion to try to find what parameters it used and found none.
    I have managed to create and use a crystal report to replace the production order using DocKey@ as the parameter.  This works within SAP.  However I have converted the system production order to crystal reports and from the converted report I cannot see any parameters at all.
    How and where can you find out what paramters you need to use to replace any PLD report?  Several reports have multiple selection criteria before the report prints.  How can you find out what their tokens are called?  I am starting to pull my hair out.  I am getting great help from this forum, but do you know any documentation which actually explains this area.
    Thanks
    Chris

  • ReportDocument.ExportToStream raises "Missing Parameter Values" exception

    Hi,
    I have a web app built using VS 2008 which runs many reports developed in CR 2008. Most of these reports take parameters and many have embedded subreports. Many of the reports can either be viewed directly or e-mailed. For the latter, I use ReportDocument.ExportToStream(ExportFormatType.PortableDocFormat) to export a PDF file which then gets attached to the e-mail.
    One set of reports works fine when viewed directly, but raises a "Missing Parameter Values" exception when I try to generate the PDF.  All the other reports, seemingly similar in most respects, including the number and type of parameters, work fine when calling ExportToStream.
    Here is the really strange part: the exception is spurious. I wrapped the whole thing in a try/catch block to better examine the exception, hoping to find which parameter value is actually missing.  I could not identify the missing parameter value, but once I handled the exception, the report runs fine and converts to PDF.
    Any hints as to what could be causing this problem?  It seems like a really bad hack to solve the problem using a try/catch in this way.
    Thanks.
    Dan

    Thanks for the quick response. Your code was very instructive, but did not help yet.  Here is what I have:
    (This response is too long for a single post, so I will split it and finish in the next post.)
    ReportDocument rptDoc = new ReportDocument();
    rptDoc.Load(strReportSourceFolder + strReportName + ".rpt");
    rptDoc.SetParameterValue("ClientID", lngKeyFieldID);
    rptDoc.SetParameterValue("Role", "Client");
    This is followed by an amazing chunk of code, provided to me by a guy at SAP Tech Support, who said it was necessary to pass database credentials programatically.  It iterates the tables in the ReportDocument and individually sets the LogonInfo. (I say "amazing" because it astounds me you have to jump through such hoops for something that should be routine and easy.)  The commented lines are just to help in debugging.
    ConnectionInfo conn = new ConnectionInfo();
    conn.ServerName = "myServer";
    conn.DatabaseName = "myDB";
    conn.UserID = "myUserID";
    conn.Password = "myPassword";
    Tables tables = rptDoc.Database.Tables;
    foreach (Table table in tables)
      //string str= table.TestConnectivity().ToString());
      TableLogOnInfo tableLogonInfo = table.LogOnInfo;
      tableLogonInfo.ConnectionInfo = conn;
      table.ApplyLogOnInfo(tableLogonInfo);
      //table.Location = table.Location;                        
    This is followed by the viewer stuff:
    CrystalReportViewer1.DisplayGroupTree = false;
    CrystalReportViewer1.DisplayToolbar = true;
    CrystalReportViewer1.HasToggleGroupTreeButton = false;
    CrystalReportViewer1.HasToggleParameterPanelButton = false;
    CrystalReportViewer1.Page.Title = strReportName;
    CrystalReportViewer1.ReportSource = rptDoc;
    Up to here, it works fine, displaying the report.  If the report is also to be e-mailed, the following is executed:
    if (bEmail)
      //  export to PDF, then mail that
      SmtpClient client = new SmtpClient();
      MailAddress from = new MailAddress(ConfigurationManager.AppSettings["ReportMailFrom"].ToString());
      MailMessage message = new MailMessage();
      message.From = from;
      message.SubjectEncoding = System.Text.Encoding.UTF8;
      message.Subject = "E-mail BackOffice report: " + strReportName;
      try
        foreach(ParameterField field in rptDoc.ParameterFields)
          Logger.LogEvent("test", "", field.ToString(), "Trace", null, true, true);
          Logger.LogEvent("test", "", "Name: " + field.Name, "Trace", null, false, false);
          Logger.LogEvent("test", "", "PromptText: " + field.PromptText, "Trace", null, false, false);
          Logger.LogEvent("test", "", "IsOptionalPrompt: " + field.IsOptionalPrompt, "Trace", null, false, false);
        MemoryStream memStream = (MemoryStream)rptDoc.ExportToStream(ExportFormatType.PortableDocFormat);
        Attachment data = new Attachment(memStream, MediaTypeNames.Application.Pdf);
        ContentDisposition disposition = data.ContentDisposition;
        disposition.CreationDate = DateTime.Now;
        disposition.ModificationDate = DateTime.Now;
        disposition.FileName = strReportName + ".pdf";
        disposition.DispositionType = DispositionTypeNames.Attachment;
        message.Attachments.Add(data);
      catch (Exception ex)
        Logger.LogEvent("error", "Page_Load", strReportName + " Exception: " + ex.Message, "Trace", null, true, true);
      //  ...  do the rest of the stuff to create & send the e-mail
    (The rest of this message will be in the following post.  Sorry it is so long.)

  • Crystal Runtime exception: Missing parameter values

    Our company did a PeopleTools upgrade at one of our clients recently. We upgraded them to PeopleTools 8.50.08. We had to convert all the Crystal Reports to the 2008 format using the RPT converter which is included in the Client install of PeopleTools.
    The only problem now is that a lot of the Crystal processes in PeopleSoft are failing with the following error:
    Crystal Runtime exception: Missing parameter values.
    I've checked the parameters which are being passed to the report and I see both parameters are filled:
    E:\HR881\BIN\CLIENT\WINX86\PSCRRUN.EXE -CTORACLE -CDHRMKPDEV -COPSDUT -CPOPRPSWD -I218609 -RP"PUP202K" -OT6 -OP"G:\PS\PSPRCS\log_output\HRMKPDEV\CRW_PUP202K_218609" -LGDUT -OF2 -ORIENTL "2000-10-01" "2002-06-30"
    Database type is Oracle. HRMS version is 8.8. I can run the Query which gets the data in just fine and I can also run the report from Crystal fine. This only happens with Crystal reports which have a date field as a parameter/prompt in the report.
    There's currently an SR open at Oracle, but I was hoping that someone here can help me nail this issue. I'm not too happy with the quallity of Oracle support, but that's a whole different story.

    <s>Just to be sure, did you put a space after each parameter name or is it a typo over here ?
    E:\HR881\BIN\CLIENT\WINX86\PSCRRUN.EXE -CT ORACLE -CD HRMKPDEV -CO PSDUT -CP OPRPSWD -I 218609 -RP "PUP202K" -OT 6 -OP "G:\PS\PSPRCS\log_output\HRMKPDEV\CRW_PUP202K_218609" -LG DUT -OF 2 -OR IENTL "2000-10-01" "2002-06-30"</s>
    Nicolas.
    sorry, it was wrong assumption.
    Edited by: N Gasparotto on Jun 2, 2010 5:11 PM

  • Error printing Check - "Missing Parameter Values. Error During Printing"

    Dear friends,
    Our client is in SAP B1 8.81 Pl07 and is facing an error while printing checks designed in Crystal Reports. As soon as they click on "Print" button, we are getting an error "Missing Parameter Values. Error During Printing".
    We have checked the Crystal Reports and all the parameters are given.
    Can anyone help me regarding this?
    Thanks and regards,
    Bharath S

    hi,
    Quoted from Note 1555170
    1555170 - Error 'Missing parameter values' printing with CR layout
    Symptom
    When you print on add any stock transactions document, with Crystal report layout, you receive error message:'Missing parameter values' and then 'Error during the printing; ensure all parameters are defined'
    Step by Step scenario:
    1.Go to Administration / System Initialization / Print preferences and select the tab per document.
    2.Select the document stock transfer and tick the box print document when adding document and click on update.
    3.Go to stock management / stock transactions / stock transfer
    set the Crystal report template as default.
    Note:
    - The issue is reproduced also for Goods Receipt and Good Issue.
    - The issue is reporduced with any Crystal Report Template  for the     above documents.
    Cause
    Program error
    Solution
    This issue is candidate for a change in a future release of SAP Business One.
    Workarounds:
    1.Use PLD for printing the stock transactions.
    2.Convert the PLD layout to Crystal reports with Crystal converter.
    3.Print the document after adding it.
    Other terms
    sap business one, printing issues, good issue, good receipt, stock transfer, crystal report, print preferences, print when adding, dockey, missing parameter
    Header Data
    Released on     07.02.2011 13:27:30
    Release status     Released for Customer
    Component     SBO-REP-CR Crystal Reports 2008 for SAP Business One
    Other Components     
    SBO-GEN-PRT Printing Issues
    Priority     Correction with low priority
    Category     Program error
    Validity
    Software Component
    Version
    SAP BUSINESS ONE
    8.8
    8.81
    you can download the PLD to Crystal Converter [here|http://www.sdn.sap.com/irj/scn/downloads?rid=/library/uuid/108305a7-1555-2d10-8289-9a178d441c71]
    regards,
    Fidel

  • CRVS2010 Beta - Missing parameter values

    I want to export my report to pdf file and I want to set some parameters in report in runtime.
    But when I try to do it I have exception "Missing parameter values".
    Productversion: Visual Studio 2010 + Crystal Report 2008 + service pack v3.
    I read that problem was resolved in service pack v2.
    But now I don't have any idea how to fix my problem.
    I create report and add parameters ("MyParameter") as string.
    My test project:
    //Load report
    //Set db connection
    try
                            ParameterValues crParameterValues = report.DataDefinition.ParameterFields["MyParameter"].CurrentValues;
                   ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue {Value = "SBSUrl"};
                   crParameterValues.Clear();
                   crParameterValues.Add(crParameterDiscreteValue);
                   report.DataDefinition.ParameterFields["MyParameter"].ApplyCurrentValues(crParameterValues);
                   report.VerifyDatabase();
                   report.Refresh();
                      string reportFileName = string.Format(@"D:\CrystalReport\CRResult-{0}.pdf", DateTime.Now.Ticks);
                      ExportOptions rptExportOption;
                      var rptFileDestOption = new DiskFileDestinationOptions();
                      var rptFormatOption = new PdfRtfWordFormatOptions();
                      rptFileDestOption.DiskFileName = reportFileName;
                      rptExportOption = report.ExportOptions;
                           rptExportOption.ExportDestinationType = ExportDestinationType.DiskFile;
                           rptExportOption.ExportFormatType = ExportFormatType.PortableDocFormat;
                           rptExportOption.ExportDestinationOptions = rptFileDestOption;
                           rptExportOption.ExportFormatOptions = rptFormatOption;
                      report.Export(); //  I have exception here ("Missing parameter values.")
                 catch (Exception e)
                      Console.WriteLine(e);
              private void SetCurrentValuesForParameterField(ReportDocument reportDocument, ArrayList arrayList)
                   ParameterValues currentParameterValues = new ParameterValues();
                   foreach (object submittedValue in arrayList)
                        ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
                        parameterDiscreteValue.Value = submittedValue.ToString();
                        currentParameterValues.Add(parameterDiscreteValue);
                   ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
                   ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions["MyParameter"];
                   parameterFieldDefinition.CurrentValues.IsNoValue = true;
                   parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
    Could anybody help me with this exception?

    Make sure you log on to the database, set the parameter, then export.
    See the following KBases:
    [1244475 - Error: Missing parameter value when exporting a Crystal Report with optional parameters using the CR .NET SDK|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    [1215426 - Err Msg: Missing parameter value when printing or exporting in VS .NET|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    [1215536 - Err Msg: Missing parameter field current value when exporting/printing in .NET|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    [1216546 - Err Msg: Missing Parameter Field Current Value when viewing a report in VS.NET|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    Also, see the following forum thread for possible solutions:
    Passing Parameters CR 2008 VS 2008 ASP.net
    Ludek

  • Error: Missing Parameter Values on

    I've started experiencing the "Missing Parameter Values" error on a report containing a subreport. All of my other reports can export just fine, but just not the one with the subreport. The report (and the subreport) both use a stored procedure to retrieve their data, with 4 parameters. The first three parameters are linked directly from the report to the subreport. The 4th parameter is optional, and is linked to the subreport with a Formula Field.
    When I delete the subreport, the report exports just fine, so the issue is definitely with the subreport ?configuration?
    I'm using Visual Studio 2005, with Crystal Reports for VS 2005. I've been searching the forums, and I downloaded and installed a package: crnet20win32x86_en_chf.zip, but it didn't solve my problem. Just to be sure, I restarted and installed it with nothing running, in case that could be a factor.
    Is there anything I can do to work through this? Any other fix I'm missing?
    Thanks
    Alex

    Thanks for the tip. I did that just now, and I found the [Hot Fix|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313339333533393334%7D.do]
    That particular Hot Fix describes my situation exactly, in that a report Stored Procedure parameter is "supposed" to be passed on to the Subreport. However, the Hot Fix describes prompting, which isn't occurring in my case, since I'm exporting the report entirely in code. My situation is just the error, Missing Parameter Values.
    In any case, I've already run that entire Hot Fix package (twice), and I've found that I have 2 of the crpe32.dlls. Neither one is the version specified in the Hot Fix, (Version 10.2.0.1256). The second dll listed below seems to be of a version prior to the Hot Fix, I don't know if it could be the reason why it still doesn't work after applying the Hot Fix.
    C:Program FilesCommon FilesBusiness Objects2.7Bin (Date 1/11/2007, version: 10.2.0.1624) and
    C:Program FilesCommon FilesCrystal Decisions2.5Bin (Date 10/5/2005, version: 10.0.5.1177).
    I've checked all the versions of references in my projects, and they all reference the 2.7 dlls, but I'd like to know if there is a way to replace the 2.5 version, just in case.
    As far as the other search results, they hinted at things I've already tried. What else can I try?
    Thanks,
    Alex

  • Missing Parameter Values - C# - Pushing Datatables to feed data to Report

    Hello,
    I am working on a .NET project to process close to 650 "existing" reports developed in Crystal Reports 8.5. Rendering reports without subreports is working just fine. However I am getting the following error everytime I try to render a report that has multiple subreports
    Missing parameter values. at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
    Following is how the reports are built.
    Main Report - Fed with a Datatable whose name corresponds to the name of the SQL Query configured in Crystal UI
        SubReport1 - Fed with a Datatable whose name corresponds to the name of the SQL Query configured in Crystal UI. The                           subreport is linked to the parent report using one of the fields in the Datatable that is passed to the main report.
    Example: the main report receives a datatable with the following fields
    EmployeeId (integer), EmployeeName (string)
    The subreport receives a datatable with the following fields : EmployeeId (Integer), EmployeeHobbies (string)
    The link is established as follows:
    SubReportQueryName.EmployeeId link to MainReportQueryName.EmployeeId
    _I have checked the data, its correct in terms of the fields required to render the report. The report parameters are being set from the code and ApplyCurrentValues is being called to ensure that the set values are used when rendering the report.
    Please note that I am not using live connections to the database
    I tried saving a copy of the above mentioned report and removing the subreport and then rendering the report, all works fine. However the moment i introduce the subreport, per the above mentioned report design/architecture all hell breaks loose and i cannot render the report.
    The environment is Windows Vista and I am running VS 2008.
    Any help is appreciated.
    Thanks
    Edited by: pkumbhat on Sep 15, 2010 4:43 PM

    The issue has been dealt with.
    The solution is to set the datasource with a dataset even if the report or subreport expects or is configured to work with a single table.

  • Missing Parameter Values CR2008 Optional Parameter

    Hi,
    I am getting "Missing Parameter Values" error
    "CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Fehlende Parameterwerte. ---> System.Runtime.InteropServices.COMException (0x8004100E)"
    if I try to export a Report with an optional Parameter without setting the parametervalue.
    The Report works fine with ReportViewer.
    If I uncomment the "Parameterpart" and set a parametervalue it works fine, but it should works without a parametervalue too, its optional.
    I have tried many for a long time and read many Websites but it does not work !
    I use WinXP SP2 CR2008 with C# .NET 2.0 VS2005
    CrystalDecisions.CrystalReports.Engine.dll version 12.0.2000.683 Date: 2008-03-01
    CrystalDecisions.Shared.dll version 12.0.2000.683 Date: 2008-03-01
    Sorry my English is very Bad !
    Thanks a lot!
    ExportFormatType ExportType = ExportFormatType.PortableDocFormat;
                ReportDocument RD = new ReportDocument();
                RD.Load("C:\\ParaTest01.rpt");
                string strServer = "<ServerName>";
                string strDB = "<DBName>";
                string strUser = "<UserID>";
                string strPW = "<PW>";
                RD.SetDatabaseLogon(strUser, strPW, strServer, strDB);
                //ParameterFieldDefinitions crParameterFieldDefinitions = RD.DataDefinition.ParameterFields;
                //ParameterFieldDefinition crParameter1 = crParameterFieldDefinitions[0];
                //ParameterValues crParameter1Values = crParameter1.CurrentValues;
                //ParameterDiscreteValue crDiscrete1Value = new ParameterDiscreteValue();
                //crDiscrete1Value.Value = "GER";
                //crParameter1Values.Add(crDiscrete1Value);
                //crParameter1.ApplyCurrentValues(crParameter1Values);
                RD.ExportToDisk(ExportType, "C:\\Test2.pdf");
    RecordSelectionFormula in Report:
    (not HasValue({?Land}) OR {tab.location_code} = {?Land}) and
    {tab.sup} = "XXX" and
    {tab.Accounting_Period} = "200801"

    You need to be careful when using optional parameters. If you are using the optional parameter in a record selection formula you'll need to check and make sure it has a value before you use it. There is a function call HasValue() that you can use to do this.
    If you have an optional parameter in the record selection formula and you don't pass a value you'll need to make sure your selection formula can be completed with out it.
    This is an excerpt from our help file.
    Crystal Reports supports optional parameters. An optional parameter is a prompted value that does not have to be supplied by the user.
    Report designers should provide some guidance to the end user that a parameter is optional by adding this information to the prompt text.
    Optional parameters are treated by Crystal Reports as optional anywhere within the report that they are used. You cannot set one instance of the parameter to optional and another to mandatory.
    Note: After you set a parameter to optional, if you use the Select Expert, the system will automatically add the selection formula for you using the HasValue() function.
    The Formula Workshop Editor does not automatically add the formula. Only the Select Expert automatically adds the formula for you.
    If you change the parameter from optional to mandatory, the HasValue() function is not automatically removed from your formula.
    Handling a parameter with no value
    When the report engine evaluates any formula which references an optional parameter that does not have a value, it generates a runtime error. All formulas that reference an optional parameter should first use the HasValue() function to check if that parameter has a value before evaluating it. This includes record selection formulas and saved data formulas.
    Note: The system will not automatically drop a statement from the SQL WHERE clause. It is the report designeru2019s responsibility to decide which statement to leave out based on HasValue() testing.

  • Missing parameter values when trying to export to pdf in C#

    HI all,</BR>
    </BR>
    I'm having a problem passing a parameter from my c#.NET code through Crystal Reports 2008...</BR>
    </BR>
    Crystal Reports Developer version 12.1.0.892</BR>
    using a WinXP machine</BR>
    The parameter I've setted up in Crystal Reports Design is one to dynamically change the query that will run on the report:</BR>
    "SELECT * FROM  REPORTS.{?Protocolname}_FC_QUERY"</BR>
    </BR>
    </BR>
    The code I use calling one of the reports I must provide:</BR>
    </BR>
    using System;</BR>
    using System.Collections.Generic;</BR>
    using CrystalDecisions.CrystalReports.Engine;</BR>
    using CrystalDecisions.Shared;</BR>
    using System.Data;</BR>
    using System.Data.OracleClient;</BR>
    using System.Collections;</BR>
    namespace CrystalReportsRapportjes</BR>
    {</BR>
    class MainClass</BR>
    {</BR>
    public static void Main(string[] args)</BR>
    {</BR>
    Console.WriteLine("Start of program!");</BR>
    string connString = "server=CT_PRD;user id=report;password=report";</BR>
    OracleConnection conn = new OracleConnection(connString);</BR>
    try</BR>
    {</BR>
    conn.Open();</BR>
    Console.WriteLine("Connection opened.");</BR>
    </BR>
    Console.WriteLine("Connection Properties:");</BR>
    Console.WriteLine("\tConnection String: {0}", conn.ConnectionString);</BR>
    Console.WriteLine("\tServerVersion: {0}", conn.ServerVersion);</BR>
    Console.WriteLine("\tState: {0}", conn.State);</BR>
    QL_ExportReport("C:\\Data\\converted2crystal\\PLANNING_REPORT_params.rpt");</BR>
    </BR>
    } catch (OracleException e) {</BR>
    Console.WriteLine("Error: " + e);</BR>
    } finally {</BR>
    conn.Close();</BR>
    Console.WriteLine("Connection closed.");</BR>
    }</BR>
    Console.WriteLine("End of program!");</BR>
    Console.ReadKey();</BR>
    }</BR>
    private static void QL_ExportReport(string reportName)</BR>
    {</BR>
    ReportDocument CR_reportDocument = new ReportDocument();</BR>
    DataSet ds = new DataSet();</BR>
    CR_reportDocument.Load(reportName);</BR>
    CR_reportDocument.SetDatabaseLogon("Reports", "Reports");</BR>
    for(int i=0;i<CR_reportDocument.DataDefinition.ParameterFields.Count; i++)</BR>
    {</BR>
    Console.WriteLine("Reading parameters");</BR>
    Console.WriteLine(CR_reportDocument.DataDefinition.ParameterFields<i>.ParameterFieldName);</BR>
    if(CR_reportDocument.DataDefinition.ParameterFields<i>.ParameterFieldName==
    "Protocolname")</BR>
    Console.WriteLine("Correct parameter found, now assigning value");</BR>
    ParameterValues ThisPV = new ParameterValues();</BR>
    ThisPV.AddValue("TMC999C999");</BR>
    CR_reportDocument.DataDefinition.ParameterFields<i>.CurrentValues.Clear();</BR>
    CR_reportDocument.DataDefinition.ParameterFields<i>.DefaultValues.Clear();</BR>
    </BR>
    CR_reportDocument.DataDefinition.ParameterFields<i>.ApplyCurrentValues(ThisPV) ;</BR>
    //CR_reportDocument.SetParameterValue("Protocolname","TMC999C999");</BR>
    //CR_reportDocument.DataDefinition.ParameterFields<i>.CurrentValues.AddValue(ThisPV);</BR>
    }</BR>
    CR_reportDocument.Refresh();</BR>
    CR_reportDocument.ExportToDisk</BR>(ExportFormatType.PortableDocFormat,"C:\\Data\\converted2crystal\\EDC_PLANNING_RPT_params.pdf");</BR>
    CR_reportDocument.Close();</BR>
    }</BR>
    }</BR>
    }</BR>
    </BR>
    The exceptions he throws using this code is = CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: </BR>Missing parameter values. ---> System.Runtime.InteropServices.COMException: Missing parameter values.</BR>
    at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException</BR>
    at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream</BR>
    at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream</BR>
    at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export</BR>
    at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk</BR>
    at CrystalReportsRapportjes.MainClass.QL_ExportReport in </BR>c:\Data\sharpdevelopfolder\CrystalReportsRapportjes\CrystalReportsRapportjes\Program.cs:line 72</BR>
    at CrystalReportsRapportjes.MainClass.Main in </BR>c:\Data\sharpdevelopfolder\CrystalReportsRapportjes\CrystalReportsRapportjes\Program.cs:line 33</BR>
    </BR>
    When I use the code</BR>
    CR_reportDocument.DataDefinition.ParameterFields<i>.CurrentValues.AddValue(ThisPV);</BR>
    instead of</BR>
    CR_reportDocument.DataDefinition.ParameterFields<i>.ApplyCurrentValues(ThisPV) ;</BR>
    </BR>
    the error I get there is:</BR>
    System.ArgumentException: Value does not fall within the expected range.</BR>
    at CrystalDecisions.Shared.SharedUtils.ConvertToDecimal</BR>
    at CrystalDecisions.Shared.ParameterDiscreteValue.set_Value</BR>
    at CrystalDecisions.Shared.ParameterValues.AddValue</BR>
    at CrystalReportsRapportjes.MainClass.QL_ExportReport in </BR>c:\Data\sharpdevelopfolder\CrystalReportsRapportjes\CrystalReportsRapportjes\Program.cs:line 69</BR>
    at CrystalReportsRapportjes.MainClass.Main in </BR>c:\Data\sharpdevelopfolder\CrystalReportsRapportjes\CrystalReportsRapportjes\Program.cs:line 33
    </BR>
    </BR>
    </BR>
    Can someone please tell me what's the right way passing a parameter to a report?</BR>
    </BR>
    Thanks in advance.</BR>

    You should use the
    ReportDocument.SetParameterValue("ParameterName", "ParamValue");
    >
    Els Cochez wrote:
    > When I use the code</BR>
    > CR_reportDocument.DataDefinition.ParameterFields<i>.CurrentValues.AddValue(ThisPV);</BR>
    > instead of</BR>
    > CR_reportDocument.DataDefinition.ParameterFields<i>.ApplyCurrentValues(ThisPV) ;</BR>
    > </BR>
    > the error I get there is:</BR>
    > System.ArgumentException: Value does not fall within the expected range.</BR>
    > at CrystalDecisions.Shared.SharedUtils.ConvertToDecimal</BR>
    > at CrystalDecisions.Shared.ParameterDiscreteValue.set_Value</BR>
    > at CrystalDecisions.Shared.ParameterValues.AddValue</BR>
    > at CrystalReportsRapportjes.MainClass.QL_ExportReport in </BR>c:\Data\sharpdevelopfolder\CrystalReportsRapportjes\CrystalReportsRapportjes\Program.cs:line 69</BR>
    > at CrystalReportsRapportjes.MainClass.Main in </BR>c:\Data\sharpdevelopfolder\CrystalReportsRapportjes\CrystalReportsRapportjes\Program.cs:line 33</BR>
    > </BR>
    > </BR>
    > Can someone please tell me what's the right way passing a parameter to a report?</BR>
    > </BR>
    Try parsing the parameter value to a decimal value before setting it as parameter value.
    Hope this will help

  • 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.

  • "Missing parameter value" error on autoprinting with CR layout

    Hi all, i had recently run into the following:
    document layouts that work perfectly from preview and after adding a document, dont work if the document is auto printed on add.
    Gives an error:
    missing parameter value
    And in system messages log:
    Error during printing: ensure all parameter values are defined.
    With only @dockey token  present in the layouts (so no other parameter).
    What makes me wonder is that this doesn't happen to all the layouts, most of them works perfectly the same way (only dockey parameter, autoprint is set etc.) but the stock related documents do this on add.
    Any ideas?
    I found a likely issue in note 1466274 but it's listed as fixed in 8.8 PL 13, we are on PL 15. Could reproduce on PL 18.
    Thanks and regards.
    Daniel

    Hi Gordon.
    I could reproduce on the test copy of the db even on different patch levels.
    Can this be the almost same issue as stated in the note? I mean same code problem but at another point?
    Yesterday i found another example:
    uppon exiting the dunning wizard with print and exit option allmost the same error. The difference is that beforehand the same error messages one pops up with the following:
    title:Crystal Reports Windows form viewer
    "A report application server meghibásodott." (this is even with sap b1 gui langugage set to english)
    "The Report application server crashed/broke down(?)"
    Will try to test it on the demo database now..
    Any ideas?
    Thank you.
    Regards.
    D
    Edited by: Daniel Omaisz Takacs on Feb 1, 2011 9:09 AM

Maybe you are looking for

  • GIF files (MIME attachments) in incoming mail display too large

    This happens only in messages I get from my service provider about msgs their Spam filter catches. They attach small GIF files to differentiate the kinds of Spam in the list, i.e. money offers, gift offers. The first time each image appears it's the

  • Album info DATED BUT goes back to default

    Dear Sony amd Sony Users, I have been updating my Walkman album information for a couple of times already and my patience is thinning out. Yes, I do use the Download Music Info and it is great for some selected songs. But those songs that are saved t

  • MAC os 10.4 powerprocessor

    i cant install the flashplayer :/

  • Cannot open file because saved CS7.0, what?

    Sorry - i do not understand this: i try to open a indd file with Indd CS6 and i see this alert: I do not use CS7.0 but i use CS6 8.1! What is the problem? I do not know what Indesign have created this file. (Note: InDesign CC open the file with no pr

  • Error code 0xE8000065

    i connect my ipod touch to itunes and this error code came up 0xE8000065 please help