Solved

Connect Crystal Report to SQL Server

Posted on 2001-08-29
5
167 Views
Last Modified: 2011-10-03
Without creating DSN, I want to connect Crystal Report to SQL Server.

How it is possible?
And It should be directly from Crystal Report and through vB code also
0
Comment
Question by:acftest
  • 2
  • 2
5 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 25 total points
ID: 6438284
For VB
Add the following references
Crystal Report 8 ActiveX Designer Design Time Library
Crystal Report 8 ActiveX Designer Run Time Library
Crystal Report 8 Standard Wizard Library
Crystal Viewer Control

On your MDI form

DIM withEvents CR_Report as CrystalReport

In the MDI Form load event
Set CR_Report = Controls.Add("Crystal.CrystalReport", "CR_Report")


The code to preview the report
CR_Report.ReportFileName = "C:\YOURDIRECTORY\TheREPORT.RPT"
CR_Report.WindowState = crptMaximized
CR_Report.ReportDestination = crptToWindow
CR_Report.WindowShowCloseBtn = True
CR_Report.WindowShowPrintSetupBtn = True
CR_Report.Action = 1  'run the report
CR_Report.Reset
 

The code to print the report
CR_Report.ReportFileName = "C:\YOURDIRECTORY\TheREPORT.RPT"
CR_Report.ReportDestination = crptToPrinter CR_Report.Action = 1  'run the report
CR_Report.Reset
 

I'll provide the other half shortly.

good luck
mlmcc
 
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 6438322
On the Crystal Report connection to SQL

Start Crystal
(assuming the report wizard starts)
Select BLANK REPORT
Select MORE DATA SOURCES
Select MICROSOFT SQL SERVER
Box appears
  server  :  YOUR SERVER
  user id :
  password:
  database:  SELECT FROM DROP DOWN
(we always select trusted connection, therefore no user id and password is required)
Windows Explorer type "menu" of
   + Tables
   + Stored Procedures
(SQL views are considered tables)
 Select the table/view/stored procedure for the report (more than one can be selected)
Select close
Create the report

The report is connected to SQL Server
VB connects to the report

good luck
mlmcc
0
 
LVL 12

Expert Comment

by:guidway
ID: 7180442
Thank you for your interest in Expert’s Exchange. We hope that this information has assisted you in diagnosing your problem. Please award the experts who diligently helped you to find a solution (if any) or request a moderator to PAQ or delete this question. I will check back in seven days to see if a response was given. If not this will be turned over to a moderator for a decision. Thank you!

Your options are:

1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts and include the details (expert name and point values to each).
4. Delete the question. Again, you must tell the other participants why you wish to do this, and only Moderators can take this action for you. Do not try to delete them directly if any comments exist, they will be pended and will not complete.

For special handling needs, please post a zero point question in the link below, include the question QID/link.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process: Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp


PLEASE DO NOT AWARD THE POINTS TO ME. ------------> EXPERTS: Please leave any comments regarding this question here on closing recommendations if this item remains inactive another seven (7) days.

0
 
LVL 12

Expert Comment

by:guidway
ID: 7196230
My following recommended disposition:

Points to mlmcc

If you have any comment or objection to the recommendation, please leave it here.

guidway
EE Cleanup Volunteer


0
 
LVL 5

Expert Comment

by:Netminder
ID: 7199545
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 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

21 Experts available now in Live!

Get 1:1 Help Now