Print Page | Close Window

Crystal Report ExportToHttpResponse Error

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10004
Printed Date: 07 May 2024 at 7:47pm


Topic: Crystal Report ExportToHttpResponse Error
Posted By: arian4uin
Subject: Crystal Report ExportToHttpResponse Error
Date Posted: 12 May 2010 at 11:52pm
Hi frnds' I m working on project VS2008 C# and Crystal Report now my problem is when I am trying display report in PDF format direct when user want to view report we are directly opening in new browser in pdf format the below function is being used by us to create it. Its working properly so far on development machine but when we try to dynamically view this reprt on production machine where in we are passing the production machine details at runtime then it is throughing error sayin :-{"Missing parameter values."}

*****************************************************
        public void showSOAReport(string fromNo, string toNo, string reportMode)
        {
            string main = "rptSOAPreview.rpt";
            string subRpt1 = "rptSOAPreviewsub1.rpt";
            string subRpt2 = "rptSOAPreviewsub2.rpt";
            string subRpt3 = "rptSOAPreviewsub3.rpt";

            ReportDocument rptDoc = new prjBEW0910.Reports.rptSOAPreview();
            ReportDocument rptDoc1 = new prjBEW0910.Reports.rptSOAPreviewsub1();
            ReportDocument rptDoc2 = new prjBEW0910.Reports.rptSOAPreviewsub2();
            ReportDocument rptDoc3 = new prjBEW0910.Reports.rptSOAPreviewsub3();

            rptDoc.SetDatabaseLogon(UserId,Pwd,Server,DB);
            rptDoc1.SetDatabaseLogon(UserId,Pwd,Server,DB);
            rptDoc2.SetDatabaseLogon(UserId,Pwd,Server,DB);
            rptDoc3.SetDatabaseLogon(UserId,Pwd,Server,DB);

            rptDoc.ParameterFields["@Mode"].CurrentValues.AddValue ((int)1);
            rptDoc.ParameterFields["@SOANoFrom"].CurrentValues.AddValue ((string)fromNo);
            rptDoc.ParameterFields["@SOANoTo"].CurrentValues.AddValue((string)toNo);

            rptDoc1.ParameterFields["@Mode"].CurrentValues.AddValue ((int)2);
            rptDoc1.ParameterFields["@SOANoFrom"].CurrentValues.AddValue((string)fromNo);
            rptDoc1.ParameterFields["@SOANoTo"].CurrentValues.AddValue((string)toNo);

            rptDoc2.ParameterFields["@Mode"].CurrentValues.AddValue ((int)3);
            rptDoc2.ParameterFields["@SOANoFrom"].CurrentValues.AddValue((string)fromNo);
            rptDoc2.ParameterFields["@SOANoTo"].CurrentValues.AddValue((string)toNo);

            rptDoc3.ParameterFields["@Mode"].CurrentValues.AddValue((int)4);
            rptDoc3.ParameterFields["@SOANoFrom"].CurrentValues.AddValue((string)fromNo);
            rptDoc3.ParameterFields["@SOANoTo"].CurrentValues.AddValue((string)toNo);

            ExportOptions exportOpt = new ExportOptions();
            exportOpt.ExportFormatType = ExportFormatType.PortableDocFormat;
            exportOpt.ExportDestinationType = ExportDestinationType.DiskFile;

            HttpContext.Current.Response.Buffer = false;
            HttpContext.Current.Response.ClearContent();
            HttpContext.Current.Response.ClearHeaders();

            rptDoc.ExportToHttpResponse(exportOpt, HttpContext.Current.Response, false, "Report"); //Error is coming over here {"Missing parameter values."}
        }
*****************************************************
Please help me frnd to know where I m going wrong. To make this report work properly on production we again need to do Set Datasource location on production machine and then its working fine. What is going wrong or where I have done mistake.



Print Page | Close Window