Skip to Content
0
Former Member
Apr 25, 2011 at 06:26 PM

Assign DataRecord to RPT with CR r2 SP 6 and Delphi 2007

10 Views

Hi all...

I'm using Crystal Report XI r2 with SP 6 and Delphi 2007; in my app I use different RPT created with a simple sql query without the Where Part.

I'm working with the VCL components and Delphi 2007; the components are TCRPE and TCRPEDS...

I need create a Report based in this RPT with a filter or Where part on specific data.

Now, I create a ADO Query that get me a Dataset with the informaction that I need that the RPT, but when I assign the dataset this is "ignored" by the rpt and this is executed with the basic query with which it was created.

For example, this is my code:

Crpe1.DiscardSaveData;

ADOQuery1.Open;

if not ADOQuery1.IsEmpty then

Crpe1.Tables[0].DataPointer := @(ADOQuery1.Recordset);

Crpe1.Execute;

On the other hand, I have tried different ways to accomplish this, one way is to assign the sql to RPT, but this is not possible, but if you can assign part of the Where in the RPT, SelectionFormula through, but I have no idea how.

Please I need your help, and any comments, tips or advice to accomplish this will be welcome...

Thanks a lot...