Seeking example showing how to set database connection and parameters using D2007 & Crystal 11

Hello,

I am using D2007,  Crystal 11 and MS-SQL2005
I managed to import the Crystal type library into D2007 by creating a BPL 
and importing the library into the BPL.
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 
[which makes my solutions useless:)]
I would appreciate an example showing how to set the runtime database 
connection and runtime parameters.

Thanks 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;
0
Robert
11/7/2008 2:56:04 AM
embarcadero.delphi.reporting 487 articles. 0 followers. Follow

1 Replies
687 Views

Similar Articles

[PageSpeed] 16

> I would appreciate an example showing how to set the runtime database
> connection and runtime parameters.

Combined of earlier messages (please note I'm using RDC created at runtime 
opposed to importing the type library).
CRReport.Database.Tables[i].ConnectionProperties.Item['<itemname>']


For login information I don't have the example at hand. Take a look at the
Crystal TechRef.PDF document.


If you are using stored procedure please check out:
http://www.tek-tips.com/viewthread.cfm?qid=802224


For subreports this pseudocode could help you:

Pseudo code for doing this using the RDC Com object:


changeCRDBLocations(crReport)


crSections = crReport.Sections
For i = 1 to crSections.Count
     crSection = crSections.Item[i]
     crReportObjects = crSection.ReportObjects
     For k := 1 to crReportObjects.Count do
     If (crReportObjects.Item[k].Kind = 5) Then
         crSubReportObj = crReportObjects.Item[k]
         crSubReport = crSubReportObj.OpenSubreport
         changeCRDBLocations(crSubReport)
     End
End

Gert
0
Gert
11/29/2008 8:17:22 PM
Reply:

Similar Artilces:

Crystal Reports & PB : database Connection Handle
Hello all of you, I'm using the function <Application>.LogOnServerWithPrivateInfo( ..., ...) to connect our Crystal Reports interface to the database, specifying a valid ODBC connection handle. 1) I have succesfully used this function for any ODBC connection. However, when I make a NATIVE connection within PowerBuilder to an Oracle 8i instance this doesn't work. In this case, I get a messagebox from CR saying that an invalid connection handle has been passed. I understand the problem because no ODBC connection is used. However, I do not know how to correct this probl...

Crystal Reports switch database OR set parameter, but does not allow both
I have a collection of Crystal Reports that are based on stored procedures in our test database. When the user selects a report, I need to load up that report, point it to the production database, and set the paramaters for the stored procedure. If I leave it pointing to the original test database, then I can set the parameters and it works. OR, I can change it to point to the production database, and it works then too, except then all the parameters are set to NULL. I have tried setting the parameters both before and after I change the database location, and when I step through in the ...

does anyone use Web Services to set the database connection for Crystal?
just exploring the possibilites of using a web service in conjunction with Crystal reports. Has anyone tried this out? psinycThanks, Peter Iuvara, MCP...

Using Stored Procedure Parameter and changing Database Location at run-time in Crystal Report
New Page 1 I use Crystal Report for .Net 2005(Crystal Ver.10.2.3600.0), MSSQL 2000 where I have created an Stored Procedure having two paramenters. I am using this Stored procedure to print a Report in Crystal Report. I pass parameter to this Stored procedure through ASP.Net Page. This works fine but if I use this Report for diffrent DB Server or diffrent Database and use DBLogonInfo to set new location for stored procedure in Report, Report is Displayed but parameter critaria is on accepted and report is not displayed within the range. My Code is as Following Imp...

Help! Prompt window shows "Logon Failed..." in Database Expert when trying to use Dataset for crystal report!!
Hi, Here's what I'm doing, 1) I created a Dataset (named dataset1) in my project by "Add New Item"/Dataset 2) Added some tables into the Dataset(dataset1.xsd file) by dragging tables from the Server Exployer 3) Created a crystal report and trying to linking the Dataset created in step 1. In Database Expert/Data tab, I selected Project Data/ADO.NET Datasets and click the plus beside dataset1, after another window for selecting Data Class Name, a prompt window comes out say "Logon failed. Details: Object reference not set to an instance of an object." Anybody...

The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing.
I'm not sure what this error is referring to. I've built a report and it runs in the IDE in preview mode, however when I try to deploy it, I get this error message.   Thanks. Doug   ...

how to build Invoice & Accounts format reports using crystal web reports
hi! i am doing payroll system which is related to accounts i need to generate beautiful invoices using crystal reports , how can i can u help me ...

data truncation problem while Exporting report to PDF using Crystal Reports 11.0
hi, I need a solution for data truncation problem while Exporting report to PDF using Crystal Reports 11.0 version.    ...

Can some one show me a example that search a SQL database and use a table to show all results?
Can some one show me a example that search a SQL database and use a table to show all results? Thank you very much~   Well can you be more specific? Do you know what fields (information) and what tables that database contains? Do you know what you're searching for?? (specific information for each field) or do you want to simply "scan" the database for tables and do a generic search? I don't suffer from madness, I enjoy it every minute of my life ok, I'm doing a website using Asp.net 2.0 + C# I have a SQL database which contains a Table called "CodeTable" Fields: ...

How to create Charts using Crystal Report 2008 which uses stored procedure that takes parameters
All,  Question#1: Can someone explain how to create charts using Crystal Report 2008 which uses stored procedure? My stored procedure will take parameter from textboxes.   Question #2: After creating, how I can deploy them into web (Visual Studio 2008 using C#) applicationAnil Singhal Hi read these articles http://aspalliance.com/215_Creating_Professional_Reports_using_Crystal_Report_for_Visual_StudioNET_Part_1.allhttp://aspalliance.com/265_Crystal_Report_for_Visual_Studio_NET.allhttp://aspalliance.com/crystal/ Don't say thanks rather mark my reply as "Answe...

Crystal Report && sqlserver Reporting Service
I am new to the reporting service.Can anyone tell me which one is Best  Crystal Report && sqlserver  Reporting Service.sqlserver  Reporting Service is it required liesence?i am working in a web application which need 200 -300 reports regular basic.Please give me a solutions urgently  To Compare Reporting Services. vs. Crystal Reports / Crystal Enterprise http://www.baadd.org/uploads/SQL%20Reporting%20Services%20vs%20Crystal%20Reports%20comparative%20analysis.pdf http://images.globalknowledge.com/wwwimages/whitepaperpdf/SQLvsCrystal_WP.pdf?bcsi_scan_2229F3D84EB...

Report that is using ObjectDataSource that uses a proc is showing report with no data?
I was in a hurry so I used the wizards to do this even though I have a strong dislike for them. I have verified that the parameters return data when using the proc. The data source is set in the ReportViewer controls properties in design mode. What might I have missed? Here is my code that get's called when a button is clicked.paramList = New List(Of ReportParameter) paramList.Add(New ReportParameter("StartDate", startDate.Date, False))paramList.Add(New ReportParameter("EndDate", endDate.Date, False)) ReportViewer1.LocalReport.SetParameters(paramList) Re...

How do I deploy an application using crystal reports/install crystal reports?
First of all: C# .NET framework 1.1, IIS 6.0, XP SP1, Windows forms - not ASP.NET but I don't see how it would make a differenceMy Situation: I am tasked with adding to an application the ability to generate a crystal report.  It currently has nothing to do with them.The application runs on an XP system with .NET 1.1 installed but lord only knows how it was installed on there (the guy that set it up is long gone and from past experience with his work I think he was just guessing anyways) In an attempt to see if crystal reports was installed, I wrote a quick test forms appl...

how show image from database in crystal Report
hi all , i have to show user image in his status report but i not avial to get the user image in Crystal Report how i can get the user in image in crystal report i m using 2003.net /sql2000 User image saved in DB(datatype Image)  Regard  New In .NET World You can add image just like any other db field, drag and drop the image field on ur report. Forexample if u have saved the image in db field User_image add that field in query and drop that field on ur report....

Web resources about - Seeking example showing how to set database connection and parameters using D2007 & Crystal 11 - embarcadero.delphi.reporting

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
High-quality data, if not used properly, can still lead marketers to make bad decisions. Consider these common ways that numbers are used to ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

CareerSonar Turns Facebook Friends Into Job Connections
Looking for a job ? Among your Facebook friends lies the potential for employment. CareerSonar , a new service, brings together a person’s connections ...

Sydney's beauty relies on its visual and physical connection to nature
Landowners, custodians and developers must collaborate to create a healthy environment, happy residents and a more productive city.

Adam Savage from 'MythBusters' has an incredible connection to the 'Star Wars' franchise
Adam Savage, co-host of the popular " MythBusters " television show, soured on the plot of "Interstellar." But when it comes to the newest films ...

Heavyset woman with facial hair arrested in connection to downto - CBS News 8 - San Diego, CA News Station ...
Police were on the lookout Thursday for a heavyset woman with facial hair who stabbed a man in the East Village.

10th person arrested in connection with Paris attacks
CNN 10th person arrested in connection with Paris attacks CNN (CNN) Belgian police have arrested a 10th person in connection with last month's ...

Should auld connections be forgot...
This environmental testing company has strict data-retention requirements and they go beyond the data, reports a pilot fish on the scene. "Per ...

Test Claims To Show T-Mobile’s YouTube “Optimization” Is Just Connection Throttling
... on the same network, and at the same time of day. They tested video streaming against three other kinds of downloads and measured the connection ...

Resources last updated: 1/6/2016 1:45:11 AM