on 04-05-2019 2:00 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you add the CR Assemblies to your project there should be a version number, and they all need to be the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.