Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you delete crystal report parameters

Status
Not open for further replies.

INFORMAT

Programmer
Jan 3, 2001
121
BE
Hello

I have a CR report with 4 parameters.
On my form I place an OLE control that send these 4 parameters to crystal reports.
I use the following code to fill the parameter fields:

THISFORM.OleControl1.ParameterFields(0) = ...
THISFORM.OleControl1.ParameterFields(1) = ...
THISFORM.OleControl1.ParameterFields(2) = ...
THISFORM.OleControl1.ParameterFields(3) = ...

Then I print my report and after this report I want to print directly an other report that have no parameters.
How can I delete the 4 parameters that I have created with my first report. If I don't delete these parameters, they are used for my second report and these report doesn't allow parameters and the I receive the CR error 20553 that means that I use invalid parameters.

Thanks for your time and answer

Informat Cv
Devriendt Nico
informat@unicall.be
 
Code:
THISFORM.OleControl1.ParameterFields(0) = ...

Can't you simply say:
Code:
THISFORM.OleControl1.ParameterFields(0) = ""

etc.? Do this just after the report is off to the printer (or CR... whatever works). Alternatively, you could generically do this before each report.

PS. You might have to say = 0 or = .null. or = .F. depending on how these fields work.

Dave Dardinger

 
Hi Informat,

The Crystal OCX has a Reset method you can call after printing the first report that will reset its properties to their default values.

THISFORM.OleControl1.Object.PrintReport
THISFORM.OleControl1.Object.Reset
Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Jon,

That's certainly convient. But what if there are perhaps some properties you don't want to change back to default? Do you have to reset them each time, or is there some sort of 'make default' method which can be used? Relatedly, are the defaults stored in the registry or somewhere else? --Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top