?
Solved

VB 6 with Crystal Report 7

Posted on 2000-04-17
7
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 

Expert Comment

by:gafftech
ID: 2726524
Are you using the .ocx control?

if so

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

0
 
LVL 2

Expert Comment

by:brice123
ID: 2726570
   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
ID: 2733462
I don't have DSN. Because I am using SQL Server 7. What is the Code ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:thangaraj
ID: 2733467
Yes, I am using .ocx
0
 

Author Comment

by:thangaraj
ID: 2733476
Any Solution
0
 

Accepted Solution

by:
gafftech earned 200 total points
ID: 2734236
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
ID: 2734453
Yes, It works fine. Can i get ur email ID. I will mail U, if any doubt

Thanks  a  lot
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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 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