Passing parameters to Crystal Report 
Author Message
 Passing parameters to Crystal Report

Hi All,

I have problem setting a Crystal Report parameters in VB6.

Can someone please tell me how to do that?

I tried this:

private sub cmdPrint_Click
  rpt1.parameterfield(1) = 'values'
  rpt1.action = 1
end sub

** and in crystal report, the parameter 1 name is 'CompanyName' and
type is string.

But There is a runtime error 'Invalid Parameter Field Name' in the (
rpt1.Action=1)

Any help would be appreciated!

Thanks,
Kum

P/S: Below are the sample code from another newgroup, but i don't
understand the statement

    Set CrAppl = New CRAXDRT.Application  ==> Run time error on this
statement

Sub new_Report ()

Set CrAppl = New CRAXDRT.Application
Set CrRep = CrAppl.OpenReport(szFileName)
CrRep.EnableParameterPrompting = False
SetParameters
CRViewer1.ReportSource = CrRep

end Sub

Sub Setparameters()

Dim cpdefs As CRAXDRT.ParameterFieldDefinitions
Dim cpdef As CRAXDRT.ParameterFieldDefinition

Set cpdefs = CrRep.ParameterFields

For Each cpdef In cpdefs
    With cpdef
        Select Case .ParameterFieldName

                case  "CompanyName"
                        .AddCurrentValue   MyTextBoxCompanyName.Text

        End Select
  End With

Next



Tue, 05 Aug 2003 21:43:28 GMT  
 Passing parameters to Crystal Report
They are using new version of Crystal Reports. Version 6 or version 7.


Thu, 07 Aug 2003 09:40:08 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing parameters to crystal report

2. Passing parameters to Crystal Reports

3. Passing Parameters to Crystal Report 5.0 (Stored Procedure Query )

4. Passing parameter to Crystal Reports

5. Pass parameters to Crystal Reports?

6. Passing Parameter in Crystal Report

7. Passing Parameter to Crystal Reports?

8. Passing parameters to Crystal Reports

9. How can I pass parameters into Crystal reports?

10. problem passing parameters to crystal reports

11. Passing Parameters To CRYSTAL REPORT OBJECT

12. passing parameters in crystal reports

 

 
Powered by phpBB® Forum Software