cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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...

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Note that you are using a retired technology and help will be hard to come by. All below assumes that you have followed the following article:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80c191b8-6664-2b10-498e-e12951468...

Your best way of approaching these queries is to look at how this is done using the Crystal Reports OCX for VB6. Translating code from the OCX to VCL is relatively straight forward. E.g. for selection formula, see the KB [1207940 - Using a Crystal Selection Formula with a Visual Basic variable and the OCX|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303337333933343330%7D.do]

For hints re. recordsets, see "Microsoft’s Data Access Object (DAO)" in [this|http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/901fb3d6-6d1e-2b10-0b8a-9b7a53b8c68a?quicklink=index&overridelayout=true] article.

My recommendation would be to move on to the CR assemblies for .NET as this technology will provide you with the longest life cycle, best resources, best help, most current information, etc., etc. For more info, see the following blogs:

/people/trevor.dubinsky/blog/2009/10/09/introduction-to-delphi-prism-applications-development

/people/trevor.dubinsky/blog/2009/10/19/delphi-prism-how-to-setup-the-environment-for-crystal-reports-2008-and-bobj-enterprise-r3-development

/people/trevor.dubinsky/blog/2009/10/26/crystal-reports-and-enterprise-net-developer-resources

Alternatively, use the Report Designer Component (RDC). You will find way more resources on the RDC than the VCL. Please note, that the RDC has been retired in CR 2008 (12.x) and any support for CR XI R2 which you are currently using expires in June of this year.

Use the search box in the top right corner of this web page and also don't forget to search these forums.

- Ludek