thangaraj
asked on
VB 6 with Crystal Report 7
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
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
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=KU MAR;PWD=12 3"
' Print the report
.Action = 1
End With
Drop me a line if you need further explanations
' 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=KU
' Print the report
.Action = 1
End With
Drop me a line if you need further explanations
ASKER
I don't have DSN. Because I am using SQL Server 7. What is the Code ?
ASKER
Yes, I am using .ocx
ASKER
Any Solution
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, It works fine. Can i get ur email ID. I will mail U, if any doubt
Thanks a lot
Thanks a lot
if so
with CateRpt
..filename = "c\category.rpt"
..Preview
end with