Delphi - Crystal 11 ActiveX/RDC : Need example setting database connection & parameters -

Posted on 2008-11-08
Last Modified: 2012-05-05
I am using Delphi 7 & 2007, Crystal 11 [ActiveX / RDC] and MS-SQL2005
I  imported the Crystal type library.
I've tried two ways to create a report view: oApp and iApp
They both work as long as I do not need to change the database or parameters
I would appreciate an example showing how to set the runtime database
connection and runtime parameters for an MS-SQL stored procedure used by the report.
Thank you,
Robert Baker


procedure TTestCR11.cxButton2Click(Sender: TObject);

var MyPath:string;


  if Form2 = nil then

    Form2 := TForm.Create(self);

  Form2.Height := Height * 3;

  Form2.Width := Width * 3;

  CrystalActiveXReportViewer1 := TCrystalActiveXReportViewer.Create(Form2);

  oApp :=CreateOleObject('CrystalRuntime.Application');

  MyPath := 'C:\Crystal\' + cxListBox2.Items[cxListBox2.ItemIndex];


  CrystalActiveXReportViewer1.Parent := Form2;

  CrystalActiveXReportViewer1.Align := alClient;

  CrystalActiveXReportViewer1.ReportSource := oRpt;






    iApp : CRAXDRT_TLB.TApplication;

    iRep : CRAXDRT_TLB.IReport;


  iApp  := CRAXDRT_TLB.TApplication.Create(Self);

  iRep  := iApp.OpenReport('C:\mycrystal.rpt', CrOpenReportByTempCopy);

  iRep.Database.LogOnServer('crbd_ado.dll', 'mysqlserver', 'mydatabase', 

'myuserid', 'mypassword');

  iRep.EnableParameterPrompting := False;


Open in new window

Question by:zxytek
    LVL 100

    Expert Comment


    Accepted Solution

    The only suggested solution is a link to the SAP site that was not helpful.
    An accepted solution was found via the Delphi newsgroups.
    Please delete this question. Thank you.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now