cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports XI with SubReports prints ok, But Parameter error on ExportToDisk?

0 Kudos

When I use PrintToPrinter, I am able to print a crystal report with subreport paramenters.

If I use ExportToDisk to save as a word document, it gets a parameter error. "Missing parameter values". "MissingParameterFieldCurrentValue{5634}". Listed below is the code I'm using. Hope someone can help. Thanks,

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

cryRpt = New ReportDocument

With cryRpt

.Load("\\LTR1SOLAP01\Microsoft Dynamics\SL\Applications\AP\03620psiXI.rpt")

strReportFileName ="\\LTR1SOLAP01\microsoft Dynamics\SL\Applications\AP\CheckImage\" & _ Trim(SQLReader.Item("RefNbr")) & "s.pdf"

.SetParameterValue("@CheckNbr", Trim(SQLReader.Item("RefNbr")))

.OpenSubreport("Overpayment")

.SetParameterValue("@CheckNbr", Trim(SQLReader.Item("RefNbr")))

.OpenSubreport("Refund")

.SetParameterValue("@CheckNbr", Trim(SQLReader.Item("RefNbr")))

'.PrintToPrinter(1, True, 1, 1)

.ExportToDisk(ExportFormatType.WordForWindows, strReportFileName)

End With

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Ah, that would be why, there was only one patch for CR for VS 2008 and no other updates for it.

If you can move to VS 2010 or above and use the supported CR runtime.

Don

Answers (3)

Answers (3)

0 Kudos

When you add the CR Assemblies to your project there should be a version number, and they all need to be the same.

0 Kudos


CrystalDecisions.CrystalReports.Engine 10.5.3700.0

CrytstalDecisions.Shared 10.5.3700.0

0 Kudos

What SDK are you using?

What version of the SDK?

No, depending on the SDK used the Parameters are one collection, don't touch the subreports parameters.

You can try the latest CR for VS SP 24 and see if that helps:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Don

0 Kudos

Installed, I have Crystal Reports Basic Runtime for Visual Studio 2008, Crystal Reports for .NET Framework 2.0 (x86), Crystal Reports XI Release 2 and SAP Crystal Reports runtime engine for .NET Framwork(32-bit) and (64-bit) Not sure of the SDK version?

The parameters are in one collection? Don't touch the subreports? Do you have sample code I can look at?

When I run the code and use ReportDocument.PrintToPrinter, it works fine? When I try and save it to a file and use ReportDocument.ExportToDisk, I get the sub parameter error?

Thanks for your help.

0 Kudos

FYI - The @ signs are reserved for Stored Procedure parameters.

Where are you logging on? Using SP's with parameters you need to set them first before logging on.

0 Kudos

Thank you for your help, really have no idea here!

This is a crystal report that calls a main stored procedure that requires a parameter and has 3 separate sub reports that calls stored procedures. Two Sub Reports require parameters and the other is just a procedure call.

The report connects to the database by ODBC connection setup on the desk top. It uses windows authentication.

When you say setting parameters, do you mean the OpenSubReport and then SetParameterValue methods?

Thanks again, your time is greatly appreciated.