Solved

VB 6 with Crystal Report 7

Posted on 2000-04-17
7
219 Views
Last Modified: 2010-05-02
I am using Crystal Report 7 for VB 6.  I have report file Category.rpt to get a report for SQL Server for the following

Server Name : KUMAR
User ID     : kumar
Password    : 123
Database    : Inventory

What is the code we have to write during Runtime in the VB ?.
It means


With CateRpt
  ??????????
  .PrintReport
End with

Thanks
0
Comment
Question by:thangaraj
  • 4
  • 2
7 Comments
 

Expert Comment

by:gafftech
Comment Utility
Are you using the .ocx control?

if so

with CateRpt
..filename = "c\category.rpt"
..Preview
end with

0
 
LVL 2

Expert Comment

by:brice123
Comment Utility
   With CateRpt
      ' Maximize the report viewer
      .WindowState = crptMaximized
   
      ' Select destination to screen
      .Destination = crptToWindow
     
      ' Set the window title
      .WindowTitle = "Preview"
   
    ' Set the report file name
      .ReportFileName = "reportname.rpt"
   
      ' Discard saved data
      .DiscardSavedData = True
   
      ' Connect to database (using ODBC)
      .Connect="DSN=KUMAR;UID=KUMAR;PWD=123"
   
      ' Print the report
      .Action = 1
    End With


Drop me a line if you need further explanations
0
 

Author Comment

by:thangaraj
Comment Utility
I don't have DSN. Because I am using SQL Server 7. What is the Code ?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:thangaraj
Comment Utility
Yes, I am using .ocx
0
 

Author Comment

by:thangaraj
Comment Utility
Any Solution
0
 

Accepted Solution

by:
gafftech earned 50 total points
Comment Utility
If you look in Help it is under DSN-Less connections.  I can't remember the sytax i think it is
Try this using a normal connectino string

..Connect="pwd=Test;uid=test1;provider=SQLOLEDB;database=test"

Don't forget you need to be using the pdssql.dll in your report.  If you aren't within crystal go to Database change driver and select that .dll

0
 

Author Comment

by:thangaraj
Comment Utility
Yes, It works fine. Can i get ur email ID. I will mail U, if any doubt

Thanks  a  lot
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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.
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…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now