How to pass parameter field from VB to crystal report 
Author Message
 How to pass parameter field from VB to crystal report

In my report, I have a dynamic header which is defined in parameter field. I
want to run my vb progam and then pass the variable to the Crystal Report's
parameter field. However, it show error code 553 every time. How to pass?
thanks.


Sun, 29 Jun 2003 17:40:17 GMT  
 How to pass parameter field from VB to crystal report
I have the same problem.  What have you tried so far??

Quote:

> In my report, I have a dynamic header which is defined in parameter field.
I
> want to run my vb progam and then pass the variable to the crystal
report's
> parameter field. However, it show error code 553 every time. How to pass?
> thanks.



Sun, 29 Jun 2003 22:16:35 GMT  
 How to pass parameter field from VB to crystal report
I'd like to know as well. I've gotten as far as being able to read
information from the report about the collection of parameter fields but
when I try to set any parameter field values I get a VB runtime error 70:
Permission denied.

Here is what I've got, using Crystal Smart Viewer with Report Designer
components in my VB app:

CRViewer1.ReportSource = crInvoice  ' assign a report to the viewer control
crInvoice.ParameterFields(1).Value = 1  ' this line gives me an error

Shaun Landau


Quote:
> I have the same problem.  What have you tried so far??


> > In my report, I have a dynamic header which is defined in parameter
field.
> I
> > want to run my vb progam and then pass the variable to the crystal
> report's
> > parameter field. However, it show error code 553 every time. How to
pass?
> > thanks.



Mon, 30 Jun 2003 12:02:15 GMT  
 How to pass parameter field from VB to crystal report
I think I figured it out. I am using the Crystal Reports designer as my
reportsource, and this exposes the object model of the report:

crInvoice.ParameterFields(1).AddCurrentValue (1)
(where crInvoice is the name of the crystal report object in my app)

I hope this helps!

Quote:

> In my report, I have a dynamic header which is defined in parameter field.
I
> want to run my vb progam and then pass the variable to the crystal
report's
> parameter field. However, it show error code 553 every time. How to pass?
> thanks.



Mon, 30 Jun 2003 12:56:08 GMT  
 How to pass parameter field from VB to crystal report
I tried but VB can't recognize "AddcurrentValue(1)"
I use "cryRpt.ParameterFields(1) = "testing" but it shows error code "553"


Quote:
> I think I figured it out. I am using the Crystal Reports designer as my
> reportsource, and this exposes the object model of the report:

> crInvoice.ParameterFields(1).AddCurrentValue (1)
> (where crInvoice is the name of the crystal report object in my app)

> I hope this helps!


> > In my report, I have a dynamic header which is defined in parameter
field.
> I
> > want to run my vb progam and then pass the variable to the crystal
> report's
> > parameter field. However, it show error code 553 every time. How to
pass?
> > thanks.



Mon, 30 Jun 2003 14:39:26 GMT  
 How to pass parameter field from VB to crystal report
Quote:
-----Original Message-----

In my report, I have a dynamic header which is defined in parameter field. I
want to run my vb progam and then pass the variable to the crystal report's
parameter field. However, it show error code 553 every time. How to pass?
thanks.

If you're using the Crystal reports 8 crviewer.ocx, use the following code.
Otherwise, ?????

-------------------------------------------------------------
Dim crxParameterFields As CRAXDRT.ParameterFieldDefinitions
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
'This will be the parameter that is currently being referenced
Dim crxParameter As CRAXDRT.ParameterFieldDefinition

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

Private Sub SetParameter(spParameterValue As String, Optional spParameter2 As
String, _
                         Optional spParameter3 As String)

Dim spParameter         As String
Dim ipParameterCount    As Integer

CRViewer1.EnableRefreshButton = False

crxReport.EnableParameterPrompting = False

ipParameterCount = 1

'Set each parameter to the value selected
For Each crxParameterField In crxParameterFields
   If ipParameterCount = 1 Then
      spParameter = spParameterValue
   ElseIf ipParameterCount = 2 Then
      spParameter = spParameter2
   Else
      spParameter = spParameter3
   End If
   Set crxParameter = crxParameterField
   'set the current parameter.
   Select Case crxParameter.ValueType
       Case 7 'Number
           crxParameter.AddCurrentValue CLng(spParameter)
       Case 8 'Currency
           crxParameter.AddCurrentValue CDbl(spParameter)
       Case 9 'Boolean
           crxParameter.AddCurrentValue CBool(spParameter)
       Case 10 'Date
           crxParameter.AddCurrentValue CDate(spParameter)
       Case 12 'String
           crxParameter.AddCurrentValue CStr(spParameter)
       Case 11 'Time
           crxParameter.AddCurrentValue CDate(spParameter)
       Case 16 'DateTime
           crxParameter.AddCurrentValue CDate(spParameter)
       Case Else
           MsgBox "Unknown Data Type:  Cannot add to parameter"
   End Select
   ipParameterCount = ipParameterCount + 1
Next crxParameterField

End Sub
---------------------------------------------------------------------

.



Mon, 30 Jun 2003 22:38:32 GMT  
 How to pass parameter field from VB to crystal report
The paramaterfields must be passed as a string - here's a line of code from
my program: (I use the OCX from VB.

CReport.ParameterFields(0) = "Invoice;" & Text1 & ";True"

where the string looks like xxx;yyy;zzz
xxx = paramater name
yyy = value to assign to that paramater
zzz = TRUE - don't ask the suer for the paramater,  while FALSE - ask them

Good luck


Quote:
> I'd like to know as well. I've gotten as far as being able to read
> information from the report about the collection of parameter fields but
> when I try to set any parameter field values I get a VB runtime error 70:
> Permission denied.

> Here is what I've got, using Crystal Smart Viewer with Report Designer
> components in my VB app:

> CRViewer1.ReportSource = crInvoice  ' assign a report to the viewer
control
> crInvoice.ParameterFields(1).Value = 1  ' this line gives me an error

> Shaun Landau



> > I have the same problem.  What have you tried so far??


> > > In my report, I have a dynamic header which is defined in parameter
> field.
> > I
> > > want to run my vb progam and then pass the variable to the crystal
> > report's
> > > parameter field. However, it show error code 553 every time. How to
> pass?
> > > thanks.



Wed, 02 Jul 2003 10:00:27 GMT  
 How to pass parameter field from VB to crystal report
Why not pass via a database?


Quote:
> The paramaterfields must be passed as a string - here's a line of code
from
> my program: (I use the OCX from VB.

> CReport.ParameterFields(0) = "Invoice;" & Text1 & ";True"

> where the string looks like xxx;yyy;zzz
> xxx = paramater name
> yyy = value to assign to that paramater
> zzz = TRUE - don't ask the suer for the paramater,  while FALSE - ask them

> Good luck



> > I'd like to know as well. I've gotten as far as being able to read
> > information from the report about the collection of parameter fields but
> > when I try to set any parameter field values I get a VB runtime error
70:
> > Permission denied.

> > Here is what I've got, using Crystal Smart Viewer with Report Designer
> > components in my VB app:

> > CRViewer1.ReportSource = crInvoice  ' assign a report to the viewer
> control
> > crInvoice.ParameterFields(1).Value = 1  ' this line gives me an error

> > Shaun Landau



> > > I have the same problem.  What have you tried so far??


> > > > In my report, I have a dynamic header which is defined in parameter
> > field.
> > > I
> > > > want to run my vb progam and then pass the variable to the crystal
> > > report's
> > > > parameter field. However, it show error code 553 every time. How to
> > pass?
> > > > thanks.



Thu, 17 Jul 2003 23:50:13 GMT  
 How to pass parameter field from VB to crystal report
There are times we just want some information from the user (That's what a
parameter is) and no suitable db location or join to put the user input.
Sometimes DB's aren't the only solution to a problem.


Quote:
> Why not pass via a database?



> > The paramaterfields must be passed as a string - here's a line of code
> from
> > my program: (I use the OCX from VB.

> > CReport.ParameterFields(0) = "Invoice;" & Text1 & ";True"

> > where the string looks like xxx;yyy;zzz
> > xxx = paramater name
> > yyy = value to assign to that paramater
> > zzz = TRUE - don't ask the suer for the paramater,  while FALSE - ask
them

> > Good luck



> > > I'd like to know as well. I've gotten as far as being able to read
> > > information from the report about the collection of parameter fields
but
> > > when I try to set any parameter field values I get a VB runtime error
> 70:
> > > Permission denied.

> > > Here is what I've got, using Crystal Smart Viewer with Report Designer
> > > components in my VB app:

> > > CRViewer1.ReportSource = crInvoice  ' assign a report to the viewer
> > control
> > > crInvoice.ParameterFields(1).Value = 1  ' this line gives me an error

> > > Shaun Landau



> > > > I have the same problem.  What have you tried so far??


> > > > > In my report, I have a dynamic header which is defined in
parameter
> > > field.
> > > > I
> > > > > want to run my vb progam and then pass the variable to the crystal
> > > > report's
> > > > > parameter field. However, it show error code 553 every time. How
to
> > > pass?
> > > > > thanks.



Thu, 24 Jul 2003 13:27:41 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Passing Parameters from C# to Crystal Report / Crystal Report Viewer

2. How can I pass parameter field in VB6 to crystal report?*******

3. How do you pass parameters from VB 5 to crystal reports

4. How to pass parameter from VB.Net to Crystal Report

5. Passing a variable from VB.NET to a Crystal report parameter or formula with no prompt

6. Pass Parameter to Crystal Reports from VB

7. Passing SQL Server parameters to subreports in Crystal Reports 6 from VB

8. Problem with VB passing parameters to Crystal Report - Stored Procedure

9. passing Parameter from Vb to Stored Procedure In crystal reports

10. vb problems - parameter passing to crystal reports

11. Passing parameters to Crystal Reports from VB

12. VB Pass Parameters to Crystal Report

 

 
Powered by phpBB® Forum Software