Solved

Connect Crystal Report to SQL Server

Posted on 2001-08-29
5
169 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

856 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