Skip to content

Crystal Reports Report Design Component Questions

I didn’t want to be an authority on using the Crystal Reports ActiveX components in Delphi. I don’t like Crystal that much, and the care and feeding of ActiveX controls isn’t something I do recreationally. But I have in the past confessed to using the Crystal RDC — my company made me do it, I swear — and so people occasionally send me questions about them. For the benefit of anyone else compelled to use these things, here are my answers.

Q:I am looking at CR XI and I see some differences in COM model which are confuse me at this point. For example, I cannot locate TCRViewer.

A:TCRViewer (the ActiveX component would be called "CRViewer"; "TCRViewer", with the "T" is the Delphi VCL wrapper class) is a version 8 component. You probably want to use something newer, especially if you are using Crystal XI. Also, the viewer control is in a separate type library from the RDC itself and this must be imported separately. For Crystal 9 (which is what I’m using presently) we use the CRViewer9 control; look for "Crystal Report Viewer Control 9" in the Import Type Library dialog box. All this may sound like a pain, but it’s actually a fairly good design, as it facilitates multi-tier applications. The RDC, which connects to the database, and the viewer, which shows the report to the user, need not be on the same tier.

Q:Do you use CR XI and RDC? Do you know any good sample project for integration RDC in Delphi applications: Create/Edit/View

A:As I mentioned above, I use Crystal 9 right now. But I’m happy to supply a demo application which shows how to view reports with both ODBC and ActiveX RecordSet sources and change the SQL at runtime for the former. I don’t do anything with creating or editing reports because doing so means that you must pay BusinessObjects a royalty for each copy of your application that you ship — or at least that is the terms for Crystal 9; I haven’t yet examined the Crystal XI license.

If you have any other questions, post them in Feedback, below, and I’ll update the article

{ 37 } Comments

  1. Serge | February 24, 2005 at 11:31 am | Permalink

    Thank you, now I found a class and were able to link Crystal Reports into our reporting system (which now supports both Report Builder and CR).

    Yes, samples will be great, I even can host them or CC submission will be great to.

    I am working on some articles about this and your samples will be good addition to it.

    CR XI Dev now comes with 750 clients installation free before you are asked to became OEM partner. Still it is only "virtual" control over licensing. In many cases client already has CR installed and then licenses counted differently.

    Anyway, thank you

  2. Craig Stuntz | February 24, 2005 at 11:42 am | Permalink

    Serge, note that there is a sample app on CC linked in the article above.

  3. Serge | February 24, 2005 at 11:47 am | Permalink

    Oh, I see it. Unfortunately format does not indicate link "a demo application" very well, only when hover over it.

    Thank you

  4. Wolfgang | March 16, 2005 at 8:39 am | Permalink

    Hi ,

    I have problems to download or even view the demo app.

    Is there another way to reach that page

    Thank you

  5. Craig Stuntz | March 16, 2005 at 8:52 am | Permalink

    If you are unable to download the sample app on CodeCentral, please do this:

    1) Report the problems you’re having on the Borland.public.bdn.codecentral newsgroup

    2) Use the "Contact" link on the sidebar to email me, and I’ll send you the sample app via email.

  6. Pablo | March 18, 2005 at 3:10 am | Permalink

    I don’t now if anyone of you can help me or now where can I find some help about my problem. I am trying to use "Crystal Reports 9 ActiveX Design and Runtime Library" using Import Type Library dialog box but I get this error: "A class named ‘TDatabase’ is already installed"

    look for "Crystal Report Viewer Control 9" in the Import Type Library dialog box

  7. Craig Stuntz | March 18, 2005 at 8:55 am | Permalink

    Pablo, try pressing "Create Unit" instead of "Install" in the TL Import dialog. You don’t need to put the RDC components on the component palette.

    However, you *do* want the viewer components on the palatte. So you should use Component->Import ActiveX control for that.

  8. saeed | April 1, 2005 at 12:11 pm | Permalink

    hi i have example for Delphi and crystal (please send to my id ((saeed_rayane)))

  9. Larry Maturo | July 18, 2005 at 3:57 pm | Permalink

    I was checking out the licensing for the Developer Edition of Crystal Reports, and it says this:

    ———————————

    Licensing conditions for integrating reporting components into thick-client applications

    Developers can integrate 750+ royalty-free report viewing, printing, and modification APIs into thick-client applications and deploy or redistribute these applications at no extra cost.

    ———————————

    I believe this means that as long as you don’t distribute the actual report, but just allow the user to design and view reports within your program, that you don’t have to pay additional licensing fees.

  10. Firat Turan | July 19, 2005 at 3:42 am | Permalink

    Can I create a crystal report (.rpt) file at run time with asp.net application?

    or

    Can the user create their own .rpt file with Report Design Component in asp.net application?

  11. Craig Stuntz | July 19, 2005 at 8:02 am | Permalink

    I’ve never tried it, but I’d imagine you’d want to use one of Crystal’s web-based tools rather than the RDC for that.

  12. mo3ez | September 14, 2005 at 10:17 am | Permalink

    Hi EveryBody

    I would like to know how could I launch a crystal report (with parameters: selected cells, user prompt) from microsoft excel through vba using rdc. I use CR 8 and excel 2003. In fact I’m migrating an Access database with an excel interface and access reports to an sql server database interfaced with excel and crystal reports.

    Thnx for any help

    Nota: I downloaded the sample files on the website but it doesn’t work (the .ppt works well but not the access database!)

    Have a nice day

  13. Craig Stuntz | September 14, 2005 at 10:19 am | Permalink

    "mo3ez" I’ve never used CR from VBA, only from Delphi, so I can’t help you with that.

  14. sanchoon | October 17, 2005 at 5:39 am | Permalink

    hi..according to ur post, actually, is it really Crystal Report Xi doesnt provide us wit the CRViewer? and can we use the CRviewer of version 10?

    i got an error message indicate a TLV error…

    besides that, i wan to know, where can i get the components or cx or references for crystal report, if the user PC doesn;t had crystal report installed?

    i’m using VB 6,Crystal Report Xi, and MySQL

    Pls get back to me if any of u can help me solve this problem..

    your help will be appreciate most..

    rgds,

    sanchoon@hotmail.com

  15. riz12124 | January 23, 2006 at 4:26 am | Permalink

    Hi EveryBody

    I would like to know how could I launch a crystal report from SQL Server through Delphi using rdc. I use CR 9 and SQL Server 2000. i had download demo app. it’s not running. i can find component CRAXDRT_TLB. how can i add that component to delphi ?

    Thnx for any help

  16. Craig Stuntz | January 23, 2006 at 7:58 am | Permalink

    "Riz"

    Please read the CC description:

    "Note that you *must* import both the RDC and CR Viewer 9 type libraries before opening the project in Delphi."

    These are ActiveX controls. Use Project->Import Type Library -> Create unit for the RDC and Component -> Import ActiveX control for the viewer.

  17. Qin Yang | February 8, 2006 at 6:13 pm | Permalink

    Hi,

    I used Delphi 6 and Crystal report 8.5 Active. The report links Word Document as OLE object. The problem is some computer did not show Word Document. Any Idea?

    Thanks in advance.

    Qin

    qyang2000@hotmail.com

  18. Craig Stuntz | February 9, 2006 at 7:52 am | Permalink

    Qin, try running the same report on the same computer with the free Crystal viewer. Does it work then? If not, then the problem is a Crystal issue and you can eliminate Delphi from consideration.

    I would guess there is a problem with the Word ActiveX control on that machine, but it’s only a guess.

  19. Md. Muzibul Hoque | February 10, 2006 at 12:43 am | Permalink

    Hi,

    Previously I worked in Delphi 5 and Crystal Report 8 & Quick Report. Now I wish to use Delphi 7 and Crystal Report 10. How can I use the Crystal Report File generated separately ?

    Thanks

    Nuzibul

  20. Craig Stuntz | February 10, 2006 at 8:20 am | Permalink

    Nuzibul,

    You:

    1) Write the report you want to run using the Crystal designer.

    2) Run the report using the ActiveX control, as demonstrated in the sample app linked in the article.

    Unlike QR you do not design the report in the Delphi IDE (at least, not with D7).

  21. Craig Stuntz | February 16, 2006 at 7:51 am | Permalink

    Pam, I can really only help with Delphi integration with CR. I’m not an expert on CR report design.

  22. Andrew | March 2, 2006 at 4:23 pm | Permalink

    Trying to use CRXI with Delphi 6. Are these compatible. No CRViewer (previous component from Crystal 8.5), however there is a CrystalActiveXReportViewer component for XI.

  23. sal | May 8, 2006 at 3:12 am | Permalink

    Hi,

    I’ve successfully installed CR 8 web component manager. The problem that im facing is that the user name and password can’t be verefied with the database.

    When i user CR 8 its working fine.

    Can you pls help me.

  24. Craig Stuntz | May 8, 2006 at 8:34 am | Permalink

    Sal, I only use the RDC, not the web stuff. I can’t help you with that since I’m not familiar with it.

  25. Jonathan | May 18, 2006 at 5:09 pm | Permalink

    Hi,

    I’ve got a problem with my CrystalActiveXReportViewer in Delphi. I Use Delphi 2005 with CRXI.

    My application is using the ActiveX to preview the report, and it works well for that. However, when I want to click in it to select the textobjects (in a blue rectangle), it just doesn’t work. Nothing happens.

    With the exact same project, on another computer, the same manipulations does select the textobject. Any ideas on why it’s not functionning properly?

  26. Craig Stuntz | May 18, 2006 at 8:37 pm | Permalink

    Jonathan, I can only guess. My first instinct is to look at the labyrinth of DLLs used by Crystal/the RDC. The RDC and the viewer are two separate controls which have their own DLLs and also use additional DLLs to actually run the report. At my company we have updated the DLLs with hot fixes from Crystal / BusinessObjects in order to solve certain bugs we experienced. So the first thing I’d do is walk the DLLs loaded in each process and record the version numbers. You can do this in code using the JCL debugging helpers, for example, or there are third-party apps which will do it for an external process. Record the version numbers for *all* libraries loaded into your process on each machine and compare the working machine with the non-working machine. Chances are good that one or more are different, and this would explain the different behavior.

  27. Abdul | May 20, 2006 at 2:34 am | Permalink

    this are informative and helpfull

  28. Jorge | July 13, 2006 at 9:31 pm | Permalink

    I can’t access ReportSource.

    ‘TCrystalActiveXReportViewer::ReportSource’ is not accessible

  29. Can not find exception | July 24, 2006 at 10:06 am | Permalink

    Hi, I tried to export a report to pdf and use email, Most of the time,it succeed, and sometimes, it throw out exception. I can not find what’s the exception? Any Advice?

    thanks

    Dorothy

  30. manibed | August 6, 2006 at 3:10 pm | Permalink

    i am trying to install crviewer.dll in borland Delphi studio 2006. But an errocu occurs : ‘Error creating palette bitmap of (TCRViewer) : No Server registered for this CoClass’ repeating for the other Crystal components. What’s wrong please

    Thanks

  31. Craig Stuntz | August 7, 2006 at 10:19 am | Permalink

    Dorothy, I’m not sure what the problem is since I see exceptions from Crystal as expected. That said, they don’t give a lot of information; Crystal errors are pretty obtuse. But you should get the message. Try a simple demo app and force an exception (e.g., bad DB login) to make sure your exception handling in your app is working correctly.

    Manibad, sounds like your RDC isn’t installed correctly.

  32. Bhupendra Chandra Papanai | September 28, 2006 at 8:08 am | Permalink

    I am new in the field of software development.

    Is it possible to create a software in visual basic and use crystal report for reporting purpose. My Question is this .Is this is necessary to install Crysta Report Software where we are using that software or we can add only some component with .exe file ?

  33. Craig Stuntz | September 28, 2006 at 9:34 am | Permalink

    Running Crystal Reports requires installation of the CR runtime.

    VB6 will not be updated and VB6 code is incompatible with VB.NET. I wouldn’t recommend using it.

  34. Monica | October 13, 2006 at 10:54 am | Permalink

    I’m trying to use the TCRViewer9 to view a report that I created using CR9 in Delphi.

    When I try to set the source report if fails. What is the proper way to do this, this is my code:

    CRViewer.ReportSource := ‘C:\UpgRpt.rpt’;

  35. Craig Stuntz | October 13, 2006 at 10:59 am | Permalink

    Monica, download my demo application for an example of this:

    http://cc.borland.com/codecentral/ccWeb.exe/listing?id=23061

    ReportSource is the IReport interface you get from Application.OpenReport. You have to open the file with OpenReport. You can’t directly assign it to the viewer.

  36. Norma | November 7, 2006 at 11:28 am | Permalink

    Hi,

    I use Delphi 6 and Crystal 8.5, but now i want to migrate to Delphi 2006 but i dont now how to install the component of Crystal inside delphi 2006

    thanks

    Norma

  37. Craig Stuntz | November 7, 2006 at 11:32 am | Permalink

    The ActiveX control works in D2006 just like it did in D6. I haven’t looked at the VCL control in D2006 and wouldn’t recommend using it anymore as Crystal/BusinessObjects doesn’t seem to be committed to updating it.

Post a Comment

Your email is never published nor shared. Required fields are marked *

Bad Behavior has blocked 1846 access attempts in the last 7 days.

Close