Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Connect Crystal Report to SQL Server

Posted on 2001-08-29
5
Medium Priority
?
180 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 101

Accepted Solution

by:
mlmcc earned 100 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 101

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

971 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