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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports 11 for Delphi 2005/2006 1

Status
Not open for further replies.

popseven

Technical User
Apr 4, 2006
17
PH
Hi,

Can anybody suggest a good sample code, site or reading material(s) related to using crystal report 11 with Delphi 2005 or Delphi 2006?
I have been tasked to convert all our existing crystal reports 8.5 RPTs running perfectly fine(with Delphi 6) to this new version and to make it work under Delphi 2005 or Delphi 2006

Please, any help is greatly appreciated.


TIA,
popseven
 
I Googled Delphi Crystal Reports and the first page listed showed this
NOTE - Crystal Reports XI does not support Delphi 2005 projects at this time.
I don't know if this is still the case but I suggest you do some further research using Google.



Andrew
Hampshire, UK
 
I don't remember exactly where it is, but you can download a VCL component from Business Objects that is compatible with Crystal XI and Delphi 2005, 2006, and 2007. I'm using it myself with XI and BDS 2007. It works fine.

You have to register with Business Objects before they'll give it to you, but that's all. It might be on their developer's site, but I think it's just on the regular site.

 
hi AnnetteH, I been there but the best VCL I can find for CR 11 is for delphi 7.
Maybe I need to contact product support?
 
PopSeven,
The VCL for 7 works in Delphi 2006 and 2007. I've had no problems with it, other than it loads pretty slow. I'm also using the CRPEDS component to send clientdataset data to the reports.

It hasn't been updated in a while, I don't know if there's risk of BO abandoning it in the future or not.

 
Hi AnnetteH, one more thing, can you please show me a simple sample code to call a RPT in delphi 7? I understand the native SQL driver is not included anymore on Crystal 11 and that we will be using ODBC to connect...can you please show me some code lines please?
 
The help file that comes with the component has examples.

I'm using the CrpeDS Component which allows you to set it's dataset property to a Delphi dataset and then I connect the report like this...

With Crpe do begin
Subreports[7].Tables[0].DataPointer := CrpeDSMaster.DataPointer;
Subreports[6].Tables[0].DataPointer := CrpeDSGenForm.DataPointer;
Subreports[5].Tables[0].DataPointer := CrpeDSGEDCom.DataPointer;
Subreports[4].Tables[0].DataPointer := CrpeDSFormAssumptions.DataPointer;
Subreports[3].Tables[0].DataPointer := CrpeDSFactOptions.DataPointer;
Subreports[2].Tables[0].DataPointer := CrpeDSGenFormDetail.DataPointer;
Subreports[1].Tables[0].DataPointer := CrpeDSGenForm.DataPointer;
Subreports[0].Tables[0].DataPointer := CrpeDSName.DataPointer;
end;

FYI, Subreports[0] is the main report, and connecting in reverse order leaves you with the main report as the active item. Also whenever the report is executed it reads the dataset so the current record changes.

There are other ways to set this up.

And in general there is no sharing of data connections between Delphi and Crystal Reports. If you don't use the CrpeDS component, you'll get two connections to your database, one from the app itself and one from Crystal. That said, if the rpt runs OK from inside the Crystal Designer application using it's internal data connection setup, that's all you need. If the ODBC DSN the report uses is available on the application machine and it's named the same as on the developer machine, you shouldn't need to do anything in Delphi. File DSNs are good in this scenario because you can distribute them with your application. Only if you need to customize the data source at runtime, do you need to do any setup inside the application. Refer to the help file for the component for more information.
 
thanks a lot for the help AnnetteH, one more thing, how about the runtime files for distribution to client purposes. Do you know any helpfile or documentation, PDF or something I can use? How about the merge module. Can I use that for runtime files in VCL? I understand that's for RDC use only.
 
You have to distribute the Crystal runtime. The easiest way is to use their merge modules, though they are bloated.

Then if you compile the Crystal VCL component into your application, you should be fine. If you don't include it in the exe, then you must distribute it as well.
 
I am calling the RPTs via a DLL i made (say reports.dll) and this DLL is being call from the main application (EXE) when the need to print a report arises.
So you saying I need to use the merge module at the client machine? So what will I do now?
 
before in crystal 8.5, I have various runtime files (DLL) I included in the destribution because we have export to excel, export to PDF etc. Each of these requires a runtime file to work on client machine...right? The old CR 8.5 VCL includes runtime.hlp file which I use to know the specific runtime files needed for each particular report.
Is there something like this in CR 11? A help file or something I can use?
 
I assume that your DLL is making calls to the Crystal Reports engine. Can't think of any other possibility. So, yes, you need to distribute the Crystal Reports engine (the Crystal Reports DLLs) via their merge modules or in some other fashion.

The Crystal Reports VCL does not contain the Crystal Reports functionality. It only functions as a wrapper or interface between Delphi and the Crystal Reports engine.

There is no way to avoid the deployment of the Crystal Reports engine.
 
You can still deploy only the Crystal Reports DLLs that your application actually uses, BUT Business Objects is pretty clear that they do not support any deployment methods other than their merge modules which include everything.

Personally, I bite the bullet and use the merge modules because I am afraid of causing conflicts with any other applications that might also be using Crystal Reports. At least I know that I'm following the standard.

I don't think the runtime.hlp file exists anymore. I assume because BO only supports the merge modules. I don't think the actual files have changed much, so an older version might still be a good reference. Or, if you have the capability to edit the merge module and remove anything you don't need, that is also a possibility.
 
Thank you so much for all the help.
There's this problem I am facing right now. I have installed Crystal Reports 11 and Delphi 2007. I'm using Crystal Reports VCL for Crystal reports 11 and running on MSSql 2000 server.
When I try to run the report in the deployment machine, I'm getting Error 723 Failed to retrieve data from the database and sometimes Error 536 : Invalid log on parameter
I've tried to debug the delphi application and I saw that the Database name is taken from the DBName use during the RPT design and the connection string is taken from the user name and password that is set in the report and not dynamically from the ini file that we are using.
Is there any way to set the connection string, via property or something to insure that the correct server and related infos are pass to the RPT?

TIA,
popseven
 
Have you looked at the Crpe.Connect.ServerName etc. properties?

As I said, I'm using the CrpeDS components to send application data to the report, so this is not an issue for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top