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!

Interfacing with delphi 1

Status
Not open for further replies.

Pietjeparasietje

Programmer
Jun 13, 2005
55
NL
Hi!

I've got the following problem. I my delphi app I want to show a Crystal Report containing the data that was just filtered by the user.

For example I've got an Access table containing all Items. In my Delphi App the user selects a certain category and then I want to show a Crystal Report containing those Items.
Probably this isn't such a big problem to fix, but haven't had any success so far.
Is there a way you can set like a parameter value from Delphi or is there another, more easy, way to fix it?

Thanks!!,

Peter
 
You can do it either by creating a parameter in the report for the Category, or you can add the record selection criteria at runtime. I prefer the parameter method. How you send the parameter to the report from Delphi depends on the method in which you're integrating your app with Crystal (VCL or RDC):

VCL:
Crpe1.ParamFields.Items[1].CurrentValue := YourValue;

RDC:
CrystalReport.ParameterFields.Item[1].AddCurrentValue(YourValue);

If you'd rather change the record selection formula at runtime, that's done like this:

VCL:
Crpe1.Selection.Formula.Clear;
Crpe1.Selection.Formula.Text := '{Items.Category} = "' + YourValue + '"';

RDC:
CrystalReport.RecordSelectionFormula := '{Items.Category} = "' + YourValue + '"';

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top