Click to See Complete Forum and Search --> : Crystal Reports - CRViewer1


patricknolan
April 2nd, 2001, 07:23 PM
HI,

I am loading my crystal reports through my vb6 app using CRViewer1.ocx. Everything is working fine except I need to set the date field on my report to equal the date displayed on my VB form. Does anyone know how to access unbound fields on crystal reports via VB.

Please Help.
Thanks, Patrick.

James Longstreet
April 3rd, 2001, 08:23 AM
It depends on what your date field is in crystal. If it is a formula or a parameter( crystal reports parameter ) there are collection objects in the Report object you pass to the viewer that enable you to set/chagne values in parameters and formulas.

Jim Hewitt
Software Developer
Liberty Tax Service
www.LibertyTax.com

Cimperiali
April 4th, 2001, 02:24 AM
I tried the parameter field, but was unable to make it work. May you provide some code example? Thanks in advance

Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.

James Longstreet
April 4th, 2001, 08:03 AM
post your code and I will look at it.

Jim Hewitt
Software Developer
Liberty Tax Service
www.LibertyTax.com

Cimperiali
April 4th, 2001, 08:41 AM
Thanks a lot. I will do it as soon as I can (I think maybe tomorrow)

Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.

Cimperiali
April 5th, 2001, 10:06 AM
'Here is the code:
'A simply report with one parameter field
'called SelectMe in a omit formula for a section.
'Matter is not to make the selection (I can workaround using
'formulas). Matter is to pass a parameter value to a rpt file
'through Ocx - or: to make parameter fields to be filled
'via code form VB.
Cr1.Reset
Cr1.ReportFileName = "D:\Condivisa\Cesarevb\Crystol\cryweb\Report1.rpt"
Cr1.ReportSource = 0
Cr1.DiscardSavedData = True
Cr1.ParameterFields(0) = "1" 'parameter field name={?SelectMe}

'executing this following line I get the error 20553 "Name of parameter field not valid"

Cr1.Action = 1 'make it print

'I tried with:
'Cr1.ParameterFields(1) = "1"
'Cr1.ParameterFields("{?SelectMe}") = "1"
'with no goals. Hope you can help
'Best Regards,
'Cesare Imperiali

Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.

Cimperiali
April 6th, 2001, 05:15 AM
Have a look at this:
http://codeguru.earthweb.com/cgi-bin/bbs/wt/showpost.pl?Board=vb&Number=48098&page=0&view=collapsed&sb=5

Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.

Dieter T
February 27th, 2002, 02:36 AM
If your problem is not yet solved, tell me. I think, I've got a solution !-)

regards
Dieter