[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2008-11-08
4
Medium Priority
?
878 Views
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;
begin
  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];
  oRpt:=oApp.openreport(MyPath,1);
  CrystalActiveXReportViewer1.Parent := Form2;
  CrystalActiveXReportViewer1.Align := alClient;
  CrystalActiveXReportViewer1.ReportSource := oRpt;
  CrystalActiveXReportViewer1.ViewReport;
  Form2.Show;
end;
===============
var
    iApp : CRAXDRT_TLB.TApplication;
    iRep : CRAXDRT_TLB.IReport;
begin
  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;
  iRep.Database.Verify;

Open in new window

0
Comment
Question by:zxytek
2 Comments
 

Accepted Solution

by:
zxytek earned 0 total points
ID: 24625358
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.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 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