Error :"Missing parameter values" while exporting a crystal report to PDF in VS2005

Hi,

I have a project which is converted from VS2003 to VS2005 .I got the code to export the crystal report to pdf and is working in VS2003,but in VS2005 it showing an Error :"Missing Parameter Values" and it is runtime.The code is as shown below.

Namespaces used:

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared 

 --------------------------------------------------------------------------------------------------------------------------------------------

        Dim MyReport As New ReportDocument
        Dim strExportFile As String
        Dim objExOpt As New ExportOptions
        Dim objDiskOpt As New DiskFileDestinationOptions
        strExportFile = ReportName & ".pdf"
        MyReport.Load(Server.MapPath("." & "/Reports/" & ReportName & ".rpt"))
        MyReport.SetParameterValue("compname", objRptInfo.rptCompName)
        MyReport.SetParameterValue("compaddress", objRptInfo.rptCompAddress)
        MyReport.SetParameterValue("compshname", objRptInfo.rptCompSName)
        MyReport.SetParameterValue("mainhead", RptHead)
        MyReport.SetParameterValue("categoryhead", cathead)
        MyReport.SetParameterValue("category", stype)
        MyReport.SetParameterValue("itemhead", FormSubItem)
        MyReport.SetParameterValue("itemtype", sitem)
        MyReport.SetParameterValue("rpttype", rptstyle)
        MyReport.SetDatabaseLogon(objRptInfo.CrysRptUser, objRptInfo.CrysRptPwd)
        MyReport.SetDataSource(ds.Tables(0))
        Dim RowCount As String
        RowCount = ds.Tables(0).Rows.Count().ToString()
        objDiskOpt.DiskFileName = Server.MapPath(".") & "/Reports/" & strExportFile
        objExOpt = MyReport.ExportOptions
        objExOpt.ExportDestinationType = ExportDestinationType.DiskFile
        objExOpt.ExportFormatType = ExportFormatType.PortableDocFormat
        MyReport.Export()-----Error is here
        MyReport.Close()
        Return strExportFile

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 

Please do necessary help................................

Manu G 

0
manugopz
6/15/2007 11:54:22 AM
asp.net.crystal-reports 7043 articles. 0 followers. Follow

5 Replies
1648 Views

Similar Articles

[PageSpeed] 20

Manu,

 

I had the same problem. It turns out that in the new version (2005), when you set the datasource it clears all of the current parameters, so you have to set the datasource and logon info before you set the parameter values.

 

0
johnnesbitt
6/21/2007 5:36:48 AM

I had the same issue too. Many thanks johnnesbitt. I was binding the reportsource after all of the parameter definitions. I simply moved it before them and everything was fine.

0
rfjohnso
6/27/2007 4:58:10 PM

Set Parameter Current Value in Export Method

For Discrete Parameters   -   

ReportDocument.SetParameterValue("Parameter_Name", Value) 

For Range Parameters -

Dim RangePram1 As New ParameterRangeValue
RangeParam1.StartValue = Application("FromDate").ToString
RangeParam1.EndValue = Application("Todate").ToString
ReportDocument1.SetParameterValue("P_dateRange", Todate_Value)

 

Regards 

 


Each and Every problem has Solutions
0
lakmalvbj
8/18/2007 9:24:58 AM

 Dim MyReport As New ReportDocument
        Dim strExportFile As String
        Dim objExOpt As New ExportOptions
        Dim objDiskOpt As New DiskFileDestinationOptions
        strExportFile = ReportName & ".pdf"
        MyReport.Load(Server.MapPath("." & "/Reports/" & ReportName & ".rpt"))
        MyReport.SetParameterValue("compname", objRptInfo.rptCompName)
        MyReport.SetParameterValue("compaddress", objRptInfo.rptCompAddress)
        MyReport.SetParameterValue("compshname", objRptInfo.rptCompSName)
        MyReport.SetParameterValue("mainhead", RptHead)
        MyReport.SetParameterValue("categoryhead", cathead)
        MyReport.SetParameterValue("category", stype)
        MyReport.SetParameterValue("itemhead", FormSubItem)
        MyReport.SetParameterValue("itemtype", sitem)
        MyReport.SetParameterValue("rpttype", rptstyle)
        MyReport.SetDatabaseLogon(objRptInfo.CrysRptUser, objRptInfo.CrysRptPwd)
        MyReport.SetDataSource(ds.Tables(0))
        Dim RowCount As String
        RowCount = ds.Tables(0).Rows.Count().ToString()
        objDiskOpt.DiskFileName = Server.MapPath(".") & "/Reports/" & strExportFile
        objExOpt = MyReport.ExportOptions
        objExOpt.ExportDestinationType = ExportDestinationType.DiskFile
        objExOpt.ExportFormatType = ExportFormatType.PortableDocFormat
        MyReport.Export()-----Error is here
        MyReport.Close()
        Return strExportFile

0
Srujana123
6/11/2008 4:59:03 AM

guys please check outh the following

http://forums.asp.net/t/1272667.aspx

0
joseabie
6/11/2008 9:57:36 AM
Reply:

Similar Artilces:

Convert my reports from "Active Reports" to "Crystal Reports"
Hello, I discovered data dynamics active reports product a year ago while I was starting a new asp.net project and decided to use it as the reporting tool, it's a very nice product and have a lot of advantages over many other products in the market. However...I also discovered that although they clearly declare that they support Right To Left languages, they have a BIG issue when using Right To Left languages in ASP.NET.I've been writing them posts about this problem and asking when they are going to fix it for 8 months, and yet they did not give me an estimate time frame for fixing this i...

"Logon failed error on Crystal Reports" when using oracle at backend and crystal reports
I am using VS.NET 2003 and oracle 8i database at backend. When I connect DB by ADO it connects and show tables and after making the report when I try to view it in browser there is an error of Logon failure on crystal reports. I am using VB.NET and ASP.NET. Kindly reply me soon. All in all I want to show reports in crystal reports from oracle 8i database. Haroon. can you post your code where you load the report--------------------------------------------------Sincerely,Michael ReyerosPlease remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if...

Export Crystal Report to PDF -error missing parameter value
i want to export my crystal report to pdfi wrtie my codewhen i pass the perameter,crystal report export pdf that give me error of missing perameter valuehere i m write my code below! ]using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using CrystalDecisions.Shared;using CrystalDecisions;using System.Data.SqlClient;using CrystalDecisions.CrystalReports.Engine;//using CrystalDecisions.Report...

Error found "Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. "
Hi guys! i'm trying to solve the error "Err Msg: "Object reference not set to an instance of an object" in ASP.NET app" but when i followed the instructions in the http://community.crystaldecisions.com/library/kbase/articles/c2011144.asp link, this error appeared ""Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. " What's going on? i already went to the iis to add new virtual directory (CrystalReportWebFormViewer) but different error appeared when i compile and browse my application. pls help ...

Crystal Report give error "Load Report Failed"
Helloi in my Project I m using Crystal report,My Crystal report is Export in PDFi Have 150 fileapplication is first file export in pdf,then second file export pdf,in same say may be 30-40 file export in pdfbut after they give error load report faild, why this error will come.for run that application agian i have closed my VS and start again applicationwhy this will happen?  Nothing is really over,untill the moment stop trying for it...Amitsp(MCTS,MCP)sqlreporting.blogspot.com...

Printing report error "Missing Parameter Value"
Hello,At the time of printing report there is error at line  ReportDocument.PrintToPrinter(1,False,0,0)The error is "Missing Parameter Value"Please help me to solve my problem.Thanking you,  Does this happen only when printing? I mean, generating the report works ok? The common cause of this is that a parameter value is always required, and your application is not providing it to Crystal. Sometimes this happens when you have subreports and subreport parameters are not bound to the parent report parameters (linked parameters if they are called the same). Hi Actually, I have the...

Dissecting the "Logon Failed" Error in Crystal Reports .NET
Following up Eric Landes' article "Troubleshooting Database Login Errors using Crystal Reports with .NET", I set out to see why this error is so common in Crystal Reports .NET projects. The result is a Crystal Alliance article published today, "Dissecting the 'Logon Failed' Error in Crystal Reports .NET". <abstract> Often, the best way to prevent an error is to understand why it occurs. In various newsgroups, questions regarding the “Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed” are asked quite often. A recent Crystal...

Converting Crystal Reports 9 report to Crystal Reports .NET report
I have a web page that is supposed to display a crystal report.  The report is fully written and functional in crystal 9 (non-.Net)  .  Is there a way to convert my .rpt so that I can just include it in the new web site? why you don't try to compile project with .net and include your report. then if crystal report is power tool will suggests you with conversation tool    My blog is here.Please remember to 'Mark as Answer' if this post answered your question! Wow it really was that easy!  I just added the old crystal report into my .NET proj...

"Load Report Failed."
Hi Everyone, I have developed a report in VS2005 (On a Vista PC, in case that's relevant). In the report designer, I switch to "Main Report Preview" and the report shows up fine - it get the data from the database and displays perfectly. I tried to add a page to display the report in my app.  I added a crystal report viewer and a Crystal Report Source.  The report displays fine in design view.  However, when I run the app, all I get is "Load Report Failed". Please see the code below:<%@ Page Language="C#" M...

Crystal Reports for VS2005 ExportToHTTPResponse gives "Invalid report file path" on deployed server
I have a ASP.Net application developed in C# on Win2k SP4, VS2005 SP1 using CR for VS2005. The application allows the user to select different reports and the selection and filtering criteria for those reports.  The user can then view the report using the embedded CrystalReportViewer control and print the report via exporting it to a PDF file.  Everything works great on my development machine.  When deployed to a Win2k3 server, using a web setup deployment project that contains the CR merge modules, the report loads in the CrystalReportViewer as expected.&n...

Error after deloyment
Hi,I am using crystal reports with Visual Studio 2005. And that was working fine in development environment. After I deployed it to server, It is giving me this error.#######################################################System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x80000220): Error in File C:\WINDOWS\TEMP\rptInvoice {D21318F6-F9E2-4FDA-8CA9-95B11CB95993}.rpt:Access to report file denied. Another program may be using it.   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Opti...

cyrstal reports export to pdf format.. "logon failed" error... in VB.NET
hey all out there... currently i have this project on hand and im really really stuck... can't seem to figure out where the problem lies in... im trying to export data from crystal reports into pdf file formats... but i keep on getting the same error.. which states "Logon failed".. i'm using ms access database. connection to database has no errors.. that's y im so stucked... can anybody out there pls help me out here.. really appreciate all the help i could get now... below is a sample of my codes... heyz... anyone who had the same problem as me before can u contact me vi...

Crystal Report, Report "Flashes" on screen, then disapers when Priviewed
I am using the Crystal Report Automation Service to preview CR reports from my PowerBuilder application. When I call the Preview function, the report "flashes" on the screen, then it disapers right away. How can I make it "stay" untill the user closes the Preview Window ? OLEObject sc1, loo_Report sc1 = CREATE OLEObject li_return = sc1.ConnectToNewObject ("crystal.crpe.application") loo_Report = sc1.OpenReport( ls_FullFileName) loo_Report.PrintWindowOptions.CanDRillDown = TRUE loo_Report.PrintWindowOptions.HasCancelButton = TRUE loo_Report.PrintWind...

Crystal Report Viewer Error: "CRAXDRT Error Occured on Server. 507 : An Exception Occured"
We have recently setup Window Server 2003 SP2 (IIS V6.0) with Crystal Report 8.5 installed. All things working well for report viewer in internet browser, but only the problem is when user trying to export report to a file (CR/word/rich text/etc format) will hit the error:CRAXDRT Error Occurred on Server. 507 : An exception occurredOnly option is click "OK" to continue... Well, so we just click "OK" and try again... Note that, for second tried onward will hit another error:CRAXDRT Error Occurred on Server. 70 : Permission deniedIt was annoying us as export ...

Web resources about - Error :"Missing parameter values" while exporting a crystal report to PDF in VS2005 - asp.net.crystal-reports

Resources last updated: 12/17/2015 7:41:34 PM