Crystal Reports - CRViewer1
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.
Re: Crystal Reports - CRViewer1
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
Re: Crystal Reports - CRViewer1
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.
Re: Crystal Reports - CRViewer1
post your code and I will look at it.
Jim Hewitt
Software Developer
Liberty Tax Service
www.LibertyTax.com
Re: Crystal Reports - CRViewer1
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.
Re: Crystal Reports - CRViewer1
'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.
Re: Crystal Reports - CRViewer1
Have a look at this:
http://codeguru.earthweb.com/cgi-bin...collapsed&sb=5
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Re: Crystal Reports - CRViewer1
If your problem is not yet solved, tell me. I think, I've got a solution !-)
regards
Dieter