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

Similar Messages

  • IDCS3 crashes when trying to Export or PDF

    IDCS3 crashes when trying to Export or PDF.
    What are the steps I should take to resolve this?
    Thanks!

    figured it out:
    - power off mac and turn back on while holding down Command + R (dont do it on an external keyboard just to be safe)
    - choose the re-install Lion option (I'm sure there is another way to re-install Lion, this is just the way I did it, not saying its the best or only method)
    - DO NOT INSTALL MACBOOK (Mid 2012) Software Update 1.0 - THIS SCREWS ADOBE UP!

  • "Missing parameter values " when passing parameter to subreport

    i have a subreport embedded in main report.
    sub report take a procedure with parameter.the main report does nothing but only holds many sub report.now i have to pass parameter from code to sub report.ive used the following code but it gives "missing parameter values" error
    Any help??
       ParameterField paramField = new ParameterField();
            ParameterFields paramFields = new ParameterFields();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
            paramField.Name = "@LabNo";
            paramDiscreteValue.Value = "1034";
            paramFields.Add(paramField);
            ParameterValues paramvalues = new ParameterValues();
           paramvalues.Add(paramDiscreteValue);
            paramField.CurrentValues.Add(paramDiscreteValue);
    rptDocument.ParameterFields[0].CurrentValues = paramvalues;

    does the sub report have parameters in it as well?
    if the sp used for the sub report has parameters you need to pass them to the sub. i would probably remove the parameters from the sub and join the sub to the main by the parameter from the main to the field in the sub.

  • InDesign crashes continuously when trying to export into PDF - Urgent Help!

    Hello All,
    I'm facing the issue like InDesign is getting crashed continuously when trying to export directly the PDF, I'm using InDesign CS5.5. Please suggest urgently.
    Thanks,
    Praveen

    Gejaraja wrote:
    I tried with script, but later assumed it's crashing even doing manually using File -> Export.
    Sorry, that's terribly unclear.
    Is it crashing with BOTH the script and File > Export?
    Is your script using exportFile or asynchronousExportFile?
    If it crashes manually, have you tried disabling asynchronous exports per Re: Background PDF export Help?

  • Subreport displays "..Missing parameter values" when published

    I would like some expert knowledge on the issue i'm currently having with a transaction report that I've developed. I have one main report with all the db tables linked.
    I have two parameters field defined, one is part id, the other is date issue.
    I have 3 report footers defined: 1=issues subreport, 2=adjustments subreport, 3=cycle counts
    The subreports has a subreport link for Part id and one for the date issue, date adjustment, and date cycle counted. I've also created in each of the subreports a date parameter field or else these data will not display on the primary report correctly.
    When i run this report in my Crystal Reports XI pro software, it works fine, all transactions are captured and everything is great.
    When i publish this report onto the Crystal reports enterprise server, after entering the two values on the main report, the report errors with [COMException: Missing paramter values].
    I know that there is a subreport linkage problem that i have or I'm doing something backwards but any suggestions would be greatly appreciated.
    Regards,
    Linda

    Thank you for the response Sharon but it is still not working for me. Here is more details if anyone has any feedbacks to give.
    Main report:
    Has 5 db tables linked, a counts table, a parts table, a detail table, a receipts table, and a adjustment table.
    Parameter fields on the Main report:
    1 for part id
    1 for date issue range <this range should match to the other 3 sub-reports>
    Sub-Reports: <example>
    Receipts sub
    Adjustment sub
    Count sub
    Example: The report footers where these subreports reside, all their subreport links are:
    partid --> ?Pm-<tablename>partid with check in the select data in subreport based on field <tablename>partid
    receivedate --> ?Pm<tablename>receive date with no checkbox
    same for other 3 = this is the only way the data displays correctly.
    All sub-reports have the following parameter fields:
    Pm-<tablename.Part>
    Receiptdate
    Pm-<tablename.receipt date>
    Pm<tablename.part>
    adjustmentdate
    Pm<tablename.adjustment date>
    Pm<tablemname.part>
    countdate
    Pm<tablename.count date>
    When i press the refresh on the main report, all of the date ranges comes up, i enter the value in all of the ranges, and the data displays accurately and correctly.
    Because the 3 prompts in the sub-reports are not on the main report, i think this is where the problem when i publish the report on the server it errors with missing parameters.
    Thank you

  • CS 3 InDesign Crashes when trying to Export To PDF

    Our File Problem
    Dell Microsoft XP service pack 2
    Mac Intel Duo, Tiger
    CS3 Fully Updated as of 3/17/08
    CS2 Fully Updated as of 3/20/08
    The problem first arose back when we upgraded to CS3, we found that files inside our document were crashing InDesign CS3 when we went to print or export the document as a pdf, the file originally made an interchange file which we could work with in CS2 so we went back and avoided CS3 until the catalog was finished.
    The problem arose again after we started using CS3 again, but not right away. Many documents have been built and exported and printed with no problem. I was able to find and fix the problem through a piece by piece removal process of elimination. I isolated the problem link, opened it in photoshop, made a new psd file and saved the new file with a different name. Problem solved.
    The problem became more complicated recently when I created a document, filled it with links, exported the file, changed nothing but copy in the document went to export and the document crashed InDesign. I then started the process of elimination and found that the problem link was different every time, and when placed into another fresh document would export just fine. All of the links were re-created in photoshop and used to create another document. The document was re created on other machines, everything went well until drop shadows were added into the document, then it crashed InDesign and could not be exported to PDF. We then took the same document, with the drop shadows, exported it in Interchange to CS2 and the document exported just fine to PDF.
    As a test on the drop shadow issue, we took a number of different files and tested these in CS2 and CS3 with and without drop shadows. Every file we tried in CS2 worked fine with and without a drop shadow. However ,we experienced a number of crashed of InDesign with the drop shadows on these files in CS3. It seems to be just a portion of images, of a certain type of product we carry, but other than that there is no consistency to what is causing the crash. We also tested other effects and had the same results with InDesign CS3 crashing.
    The other issue we see with this is that before the 1st of the year, we were able to export the same images in InDesign with the drop shadows and other effects. It seems that since the first of the year, the same images are not longer able to export from CS3 to a PDF. A couple of the possible thoughts we had were that there was an issue with recent updates in CS3, to test this we are going to uninstall CS3 and reinstall without running updates. We also are going to try to recreate the files that crashed InDesign and see if they can crash again on export.
    Has anybody else experienced any similar issues? Does anybody know of a way to identify the problem in CS3 or with our files other than through trial and error? This is a major issue and problem for us since we are primarily a catalog based business and cannot have out catalog crash unexpectedly when we spend months working on it.
    This problem is also not operating system specific, it is happening on both machines listed above

    Dean,
    We found that the issue is a bug in the program, and this was the response i Got from an Adobe guy:
    Initial Response:
    Thank you very much. Weve been able to reproduce the crash. It appears the underlying bug is triggered by having tall narrow PSD images and transparency effects (i.e. drop shadow). Well be working to further understand the root cause, and then working on a fix for a future release/update.
    In the interim the best workaround I can come up with is to rotate the canvas in Photoshop 90 degrees so the image is short and wide, and then rotate it -90 degrees in InDesign after placing so you get the vertical orientation you want. The bug is triggered when processing the data as saved by Photoshop, so avoiding the tall and narrow psd should avoid the bug.
    Im sorry to not have an easier workaround or immediate fix. Please let me know if you encounter any new crashes. Ill let you know if our further investigation changes our understanding of the root cause of the bug.
    Second response:
    Well, I have a bit more info. Switching from a tall narrow image size to a short and wide one should avoid the crash for any specific image that crashed when tall and narrow, but unfortunately the root cause of the bug is in code that could potentially be triggered by any image. It appears to be exceptionally rare for other image proportions, but it is still theoretically possible. It just turns out its much more likely for a tall narrow CMYK+Alpha image.
    So, as it stands I dont have a 100% guaranteed way to avoid this crash, but it should be much less common for short and wide images. If you do encounter the crash, switching the orientation should avoid the crash. Hopefully the orientation workaround will allow you to be productive with InDesign until a future release contains the fix.
    Hope that helps

  • InDesign CS5 crashes when trying to export a PDF and/or a Warning dialog box appears!

    Just bought a new macbook pro 15" non retina the other day and the SAME version of InDesign CS5 that was running on my 2010 iMac is now crashing each time I get a Warning dialog box and/or try exporting a PDF?!??!?! How was this NOT an issue before and now is??? Running the same Lion 10.7.4 as well....
    Holding the alt key while deleting a page does help it not prompt the warning dialog box, but no help to exporting a pdf...
    So guessing this is a Apple issue and we need an update or??
    I am only using Fontbook and have NOT even added any new fonts yet, practically bare bones mac still with just CS5...
    What is also weird is that the warning dialog boxes are always BLANK and have no text on them, like there is a font issue??
    I've cleared the system font cache, reset InDesign prefs, reset PRAM and NVRAM, re-installed InDesign and updated to 7.0.4...
    This is madness....please help me in the name of all that is good.
    Crash:
    http://pastebin.com/DYv0vwNQ

    figured it out:
    - power off mac and turn back on while holding down Command + R (dont do it on an external keyboard just to be safe)
    - choose the re-install Lion option (I'm sure there is another way to re-install Lion, this is just the way I did it, not saying its the best or only method)
    - DO NOT INSTALL MACBOOK (Mid 2012) Software Update 1.0 - THIS SCREWS ADOBE UP!

  • InDesign CS6 keeps crashing when trying to export to PDF

    I never had an issue with this before, but now my InDesign is crashing every time I try to export to a PDF. The document is 22 pages long. I updated an older version that I had no problem with exporting to a PDF. Now I can't even take the older InDesign doc and make into a PDF. It just keeps quitting every time I try to export it. What could have triggered this issue and how can I fix it?
    h.

    see Adobe Community: File Crashing on Output - printing/PDF/other

  • I keep getting "Conversion Failure" when trying to export a PDF to Word or Excel.

    Not working for the file I need ro convert to Excel.
    Also, since this happened, I can no longer click "Convert" from within Adobe Reader.

    Hi,
    I tried to convert PDF through Acrobat.
    But it seems there is some corruption in file format.
    This PDF is created by 'Nitro Reader 2(2.1.1.3)'.
    Please refer to this link for non Adobe application support policy:Support Policy for PDF Files created by non Adobe applications
    Regards,
    Florence

  • Hi all - Am receiving the "bad parameter" error when trying to save a PDF w/ Reader 10.1.0

    I've read through various topics and many point to the source of the PDF, but using other versions of Reader.
    Other users - not using version 10.1.0 - but previous version, do not have this problem.
    I am not sure if the client is able to download and install another version of Reader, as their network is locked down.
    Any tips or suggestions?
    OS = Win7.

    Pls try updating to the latest version of Adobe Reader i.e. 10.1.4 and see if it solves your problem. The new version has lots of fixes which may solve your issue.

  • 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 message when trying to export pdf to excel

    i keep getting an error message when trying to export a pdf to excel

    Hi ,
    Could you please elaborate more about the issue ?What exactly are you trying to perform and how are you trying to do the same?
    Are you using Adobe Reader or Adobe Acrobat to export PDF to excel?
    What software version are you using?
    Also ,could you please tell what is that error message and it would be wonderful if you could share the screenshot of the error message with us so that we can assist you accordingly .
    I would also like to know what OS do you work on ?
    Is it happening with all kinds of PDF you are trying to convert or any specific one?
    Please update me with above mentioned details so that we can assist you further .
    Regards
    Sukrit Dhingra

  • Missing parameter values message when exporting report

    Post Author: Gr_Pr
    CA Forum: .NET
    Using .NET 2005, CR XI R2, and the Crystal SDK for .NET 2005 to generate reports. Basically CR is my application's reporting tool. So, we create a report in CR XI R2, then distribute that report to our users loading it into the .NET application using the Report Document class.
    We have a small problem.
    Our user's have the ability to use pre-defined 'prompts' that will pass parameters to the reports. Let's say that the prompt will pass in (5) pre-defined parameter values, but the customer wants to run their own 'custom' report using our prompt, but their 'custom' report contains (6) parameters.
    If I let the Report Viewer load the report, the user will be prompted for the missing parameter value that was not supplied by the 'prompt'.
    If I run the report without loading it into the Viewer and try to export the report directly to PDF I receive an error message from CR stating I have 'Missing Parameter Values' then the report errors out.
    Has anyone come across this? Is there something I missed?
    I am not real sure as to why you would be prompted by the Viewer and not by the Export Class. This worked fine when using the RDC component, I was prompted for the missing parameter value by both options.
    Any help would be greatly appreciated.

    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.

  • "Missing parameter values" error on Export

    Hi,
    I am getting "Missing Parameter Values" error if all required parameter values are not passed in the report through application. Same error is not coming when all the parameters are passed.
    And parameter window also not displaying if all parameters are not passed to the report for export option. (Parameter window displaying on preview option if all the parameters are not supplied).
    I have tried both Report Viewer's ExportReport function & ReportDocument's Export function. But both are results same.
    Software details:
    Crystal Report created in Version: 10.0.0.533
    .Net 2005
    10.2 Crystal component. Crystal Runtime Version - v2.0.50727 and DLL Version - 10.2
    Please help me to resolve this issue.
    Thanks,
    Venkateswaran.P

    Given example is not working as expected.
    1) Calling of  ExportReport() function invokes the file Save As window to save the exported file eventhough exported path & file name supplied in the program.
    2) After accepting the output file name, "Missing parameter values" error coming instead of displaying Crystal's Parameter window.
    Below is the piece of code to export the output. I am calling Export() function if all the parameters are supplied by the application otherwise i am calling Viewer's ExportReport() fuction. Please have a look and let me know if any code change is required.
                   ReportDocument crRepDocument;
                   String m_strExportPath;
                    Boolean bUseRepViewExport = false;
                    if( crRepDocument.ParameterFields.Count > 0 )
                        if (m_Parameters.Count < crRepDocument.ParameterFields.Count)
                                bUseRepViewExport = true ;
                    ExportOptions crExportOptions;
                    DiskFileDestinationOptions crDiskFileDestinationOptions;
                    crDiskFileDestinationOptions = new DiskFileDestinationOptions();
                    crExportOptions = crRepDocument.ExportOptions;
                    if (base.m_ExportFormat == eExportFormat.RTF)
                       crDiskFileDestinationOptions.DiskFileName = base.m_strExportPath + ".rtf";
                        crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                        crExportOptions.ExportFormatType = ExportFormatType.RichText;
                        crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
                    else if (base.m_ExportFormat == eExportFormat.PDF)
                        crDiskFileDestinationOptions.DiskFileName = base.m_strExportPath + ".pdf";
                        crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
                        crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                        crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
                    else if (base.m_ExportFormat == eExportFormat.DOC)
                     if (bUseRepViewExport)  //If all the parameter are not supplied. I calling Viewer
                        FormReportViewer oFormReportViewer = new FormReportViewer();
                        oFormReportViewer.CrystalReportViewer.ReportSource = crRepDocument;
                        oFormReportViewer.CrystalReportViewer.ExportReport();
                        return true;                 
                    else
                        crRepDocument.Export();  //
                        return true;

  • "Missing parameter values."  --  Export and Print only...

    I have a web application and I am using CrystalReportViewer.  I am passing several parameters to Crystal using: 
    report.SetParameterValue(field.Name, Session[field.Name]);
    I have session variables which will hold parameters needed to pass into the report.  The session variables are populated from controls on my webpage after an onclick event.  This even not only populates session, but also passes parameters to the report with the following code: 
    ReportDocument report = new ReportDocument();
    Session["MapPathName"] = "./Reporting/CaseStudy.rpt";
    report.FileName = Server.MapPath(Session["MapPathName"].ToString());
    ParameterFields fields = new CrystalDecisions.Shared.ParameterFields();
    fields = report.ParameterFields;
    foreach (ParameterField field in fields)
          report.SetParameterValue(field.Name, Session[field.Name]);
    CrystalReportViewer1.ReportSource = report;
    This works great for reporting and is very extensible.  However, when clicking on the "Print" or "Export" buttons on the toolbar I get "Missing parameter values."  I attempted to export manually in code using the .ExportToStream function but I still get the error, "Missing parameter values." 
    I received this error also in Refresh, Search, and Navigate functions.  This was corrected by calling a function that supplies the above code block to these functions.  However, I do not see any events for controlling the Print nor the Export events. 
    QUESTION: How can I print or export a report when passing parameters using CrystalReportViewer?  Thanks in advance!
    P.S. - Crystal Reports XI Release 2
    Edited by: KyleSavant on Jun 18, 2009 5:42 PM

    There are no Export or Print events accessible for the viewer
    Since it sounds like you are creating the reportdocument object in your click event, the settings on this object become out of scope on successive postbacks executed by other events.
    to get around this without major changes, you can place your "report" object in session in this event and retrieve it from session on successive postbacks.  This should solve your problems around navigation, printing and exporting.  What you will need to do is check if the session object exists (usually in page_load or page_initialze) and if so, retrieve it from session and bind it to the viewer's reportsource.  If the session object does not exist, then do nothing (ie you have not clicked your button yet that retrieves the parameter values from session and loads the report).  Also, in your click event you can check if the report session object exists and if so, remove it so that it can be re-created with your new parameter values (ie i'm assuming the only time you want to set parameter values is in this event).
    Dan

Maybe you are looking for

  • How to append a character using UTL_FILE pkg

    A table with student_id, student_name and date_of_join. create table student(std_id varchar2(10),std_name varchar2(20),std_doj date);I am loading the data from the below flat file using UTL_FILE package 101   ron   04081999 101   ron   01081996 102  

  • I have a podcast video that refuses to be deleted.

    I have a podcast video that refuses to be deleted. Normally, a swipe would bring up the delete function. For one video it will not allow the delete button. I am sure there is not content, only the label. How can I get rid of this annoying entry? This

  • Select option value dynamic

    Hi, I have a select option which must have a default value. This default value is the current date -1 (yesterday...). DATA ws_date TYPE p0001-begda. SELECT-OPTIONS s_date FOR ws_date DEFAULT sy-datum - 1. But sy-datum - 1doesn't exist. The 'RP_CALC_D

  • Trying to make a logarithmic Category axis - is this impossible?

    I'm trying to keep my y-axis linear and my x-axis logarithmic on a simple line chart – is this impossible, for some reason? I see no mention if it in the documentation, and I've spent hours trying to figure it out. It seems odd that it'd be so easy t

  • Duplex printing on Canon i860

    I have a Canon i860 printer which I have had for a couple of years and have loved it. But since I upgraded a little over a year ago from a Lombard PB running OS 9.1.1 to a G4 iBook running OS 10.4 in its various incarnations I have not been able to p