Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

Connect Crystal Report to SQL Server

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
acftest
Asked:
acftest
  • 2
  • 2
1 Solution
 
mlmccCommented:
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
 
mlmccCommented:
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
 
guidwayCommented:
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
 
guidwayCommented:
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
 
NetminderCommented:
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now