Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Open Crystal Report In VB

Hi there!

I have a "little" problem. I have crystal report 9.2 and Vb6 so I tryed to open a report in vb.
I placed the Crystal report viewer on the form but I can't load the report into it.
I used CRViewer91.ReportSource ("c:

Please tell me if I made something wrong

Thank yoy very much

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Unable To Open The Crystal Report Exported In Crystal Report Format
Sub: Unable to open the Crystal report exported in Crystal Report Format

1)    I have used Oracle Native connection, while designing the report.
2)    I have passed the record set to the report at run time.
3)    Exported the report to Crystal Report Format, But I could n’t able to open report, while opening , the report asks for OLEDB information, even though I used Native connection at design time.
4)    In Crystal Report 8.5, connect driver property, but I am using crystal reports XI and in Visual Basic 6.0, Is there any method or property to convert the connection?. As I have to export report to crystal format and emailed to user, so that user can open it.
Any assistance in this regard is highly appreciated

The code is as follows:
Public Sub Aging_REPORT(strSQL As String, sReportName As String, sDestFileName As String, ReportTitle As String)

On Error GoTo Err
Dim CrAppl As CRAXDRT.Application
Dim crrep As CRAXDRT.Report

Dim rsCrystal As ADODB.Recordset
    Set CrAppl = New CRAXDRT.Application
    Set crrep = CrAppl.OpenReport(sReportName) 'Opens the report
   Set rsCrystal = New ADODB.Recordset
    rsCrystal.Open strSQL, Conn, adOpenStatic, adLockReadOnly
     With crrep
    .Database.LogOnServer "crdb_oracle.dll", strServerName, "", strUserName, strPassword
     .ReportTitle = ReportTitle
     .Database.SetDataSource rsCrystal, 3 'LINK REPORT TO RECORDSET
     .VerifyOnEveryPrint = True
     End With
   With crrep.ExportOptions
    .DestinationType = crEDTDiskFile
    .FormatType = crEFTCrystalReport
    .DiskFileName = sDestFileName
   End With
   crrep.Export (False)
    Set crrep = Nothing
    Set CrAppl = Nothing
    Exit Sub
 MsgBox Err.Description

End Sub


Crystal Report : How To Open A Report On Pressing Enter Key
Hi all,
I have created a report in Crystal report 7 that displays a list of invoices (with invoice no and customername field in report) on a particular day what i want is when the user click or press enter key on a particular invoice no i should show the details of that invoice. Can anybody suggest how to do this I think we need to use linked sub reports but i have never used such reports please help me on how to do this or suggest any tutorial where i can find such report

My report displays
invoice no. Name
1     aaaa
2     bbbb
3     cccc
4     dddd
5     eeee
6     fffff.

when user click on 2 i need to display the detials of invoice 2 in another report this needs to be done in Crystal report and not in VB


Mind is faster than Wind --- Mahabharat

How To Open Crystal Report 8.0 In Vb6.0
hi fellows

     i am a new bie in vb. now a days i am working on reports. i have created some reports using crystal reports 8.0 . now i want to open these reports in my vb forms using ADO. i want my reports to gather information at runtime from the tables developed in Access. i have consulted some books but cudnt find any help .can any body help me plz
any coding plz.plz.plz

thnx in Advance

Open A Report (Crystal Report 7.0) From VB6
Hi, people!
My name is Ana and I really need to open a report designed in Seagate Crystal Reports 7.0 from Visual Basic 6.0.
I´m looking for the following DLLs "Cpeaut32.dll e Craxdrt.dll".
I´ve read some articles and they talk about the RDC Atomation Server.
PLEASE, would someone help me telling which Dlls I really need in my computer to open, print and email my reports; and send me them attached?

My e-mail address is :

Thank you very much!

Crystal Report No Open MsAccess?
Hi guys

Anybody know how to open from Crystal Report a MSAccess 2000 because anytime I want to open my tables crystal report send a message like this "IDAPI error can not locate ODAPIxx.DLL" then another windows say "Error recognizing file". So is not possibly to open my tables? Anybody had the same error before? What should I do?

I will appreciate any help about his problem.

Thanks and have a nice day everyone.

Open Crystal Report With A Where Clause
I have a Crystal rport that is connected to the right tables and it displays the data just fine with the following code.

Option Explicit

Dim CApp As New CRAXDRT.Application
Dim CReport As CRAXDRT.Report

Private Sub Form_Load()
Set CReport = CApp.OpenReport("P:Crysta~1ToDoList.rpt")
CRViewer1.ReportSource = CReport
CReport.Database.Tables(1).SetLogOnInfo "Titus", "Problem Tracking", "Titus", "password"
CRViewer1.Zoom 100
End Sub

What I want to be able to do, is open this report for specific employees using a where clause that keys on EmpID.

Anyone have any ideas?


Crystal Report :-Can't Open SQl Server
anybody can help me regarding crystal reports ..i am
using back end as SQLSERVER 2000 and my OS is WINDOWS
2000..i am using VB6.0 my problem is i am not able to
open reports it says [20599] can't open SQL SERVER can
any body quickly help me in fixing this problem
thanking you

Vb6 + Crystal Report + Cannot Open Sql Server
vb6 + crystal report + cannot open sql server ...?

Using VB6 To Open Crystal Report And Export It To Pdf
I wrote a script to query up about 50 ids.  Loop thru them and open up the crystal report and pass the ids then export it to pdf format.

I have 2 questions.
1.  Instead of doing the below statements each time is it possible to do a refresh?
    Set Report = crxApplication.OpenReport("test.rpt", 1)
    Set Report = Nothing
    Set crxApplication = Nothing

2.  Sometimes VB closes after it attempts to export. Any ideas?  This occurs just before I set the report = Nothing.  

Crystal Report Cannot Open Sql Server Please Help
crystal report cannot open sql server please help


Need Help!! Urgent. Can't Open Crystal Report In VB6
Hi All,

    I am newbies in integration of Crystal Report 8.5 with VB6 application.

Private Sub Command1_Click()
End Sub

CR is Crystal Report Control.

When i run it, it will prompt me to set the Parameter for crystal Report as usual. After parameter has been set, the report is gone after few milisecond.

Can anyone help me on that?


Crystal Report : Server Has Not Yet Open
HI everybody

I have 3 reports in my app. they are successfully install/distributed to other system. I have one Problem with them

One report get open properly, but other two reports give error that is "SERVER has not yet open". I am using ODBC due to my multi-databases.

My Programming I Change registry Entries of ODBC. I think it is fine because my app is working fine, only two reports give this error. Visual Basic is used.

Please help me.

Crystal Report Error, Server Has Not Yet Been Open !
I use crystal report v8.0 to show report in vb form.

When I run program, I got an error "Server has not yet been opened "

I use ODBC to connect to an Access 97 Database in the report file.
When I preview the report the data is came out .

Does it error on report file or VB code?

If anybody know ,please let me know

Thank you

Open Crystal Report File From VB Automatically.
I've been trying to figure out a way to create a VB program that will automatically open a Crystal Report file when I click on that file from Windows Explorer. What I did was make a simple form with a Crystal Report Control on it. Then I associated the *.rpt file type with that program so that when I click on that file type, Windows will launch my program to try and open that Crystal Report file. I figure it must be some kind of DDE solution, I think. It can't be that difficult of a thing to do. I just don't know what I'm doing wrong.

Mario Giannone

Open Crystal Report File From VB Automatically.
I've been trying to figure out a way to create a VB program that will automatically open a Crystal Report file when I click on that file from Windows Explorer. What I did was make a simple form with a Crystal Report Control on it. Then I associated the *.rpt file type with that program so that when I click on that file type, Windows will launch my program to try and open that Crystal Report file. I figure it must be some kind of DDE solution, I think. It can't be that difficult of a thing to do. I just don't know what I'm doing wrong.

Mario Giannone

Open Crystal Report In A VB6 Activex Control

I've created an ActiveX control in VB6 and now I want to include un CR in it.
I can add the CR Viewer Control component but I have a message when I want to add the CR Control component (thread vs multithread).
I think that I can't open a CR in an OCX but I would like someone to confirm that and explain why. AND so, what can I do?

Thank you.

Crystal Report - Cant Open Sql Server Problem
i'm using VB6 and Microsoft SQL Server.
i have created a crosstab on my report by using crystal report. i get an error when i try to view my report. The error is "Can't Open SQL Server".
i found that if i untick the "Save data with report" and "Verify data on every print" in crystal report,i will get the above error.
Otherwise,i can view the report but the data are unable to refresh.
How can i solve it?

Thanks for helping.

Edited by - yuen on 3/18/2008 6:11:29 AM

Open A Crystal Reports Report With Fresh Data
Hello all,

Can somebody give me a simple example on how to open a Crystal Reports report in VB6 with refreshed data on it.

Thanks a lot !!


How To Open CRYSTAL REPORT If Msaccess Database Have Password?
i just want to know how to open crystal report if msaccess database have password?
i use crviewer in my form...
kindly help.

Private Sub Form_Initialize()

Call OpenCrystalReport

End Sub

Private Sub OpenCrystalReport()
    Dim CRReport2 As CRAXDRT.Report
    Dim CRApp2 As New CRAXDRT.Application
    Set CRReport2 = CRApp2.OpenReport(App.Path & "Attendance.rpt")
    With CRReport2
        'Set the Access database path
        .Database.Tables(1).Location = App.Path & "Mygradingsys.mdb"
    End With

    With CRViewAtt
        .ReportSource = CRReport2
        While .IsBusy
        .Visible = False
    End With
    Set CRApp2 = Nothing
    Set CRReport2 = Nothing

End Sub

Open Multiple Instances Of A Crystal Report Viewer
How do I create multiple instances of my CR Viewer

The form is just has CrystalActiveXReportViewer

Thanks in advance

Problem Using Shell Command To Open Crystal Report In Vb6
Problem description

1. Database: Access
2. Crystal Report 10

I use vb6 to open Crystal report environment using shell statement,
every time when i refresh data i have to reentry the user name and password to access database.

My code is:

retval = Shell(Chr(34) & CRpath & Chr(34) & " " & Chr(34) & RepPath & "" & strRepName & Chr(34))

would anybody know how to use shell command to open crystal report in vb6 and pass database connection information to the crystal report?

Many thanks,


Crystal Report Runtime Error 20599 Can Not Open SQL Server
Hi All,

i am using vb 6.0 and crystal reports 8.5 with SQL Server 2000 Database.
below is the code which i have written.

CrystalReport1.ReportTitle = "Payment Analysis per salesman for date range " & DT1.Value & " And " & DT2.Value & ""
sql = "{FinalWeeklydata.Shipmentdate} IN date(" & DT1.Year & "," & DT1.Month & "," & DT1.Day & ") TO date(" & DT2.Year & "," & DT2.Month & "," & DT2.Day & ") " & sql2
CrystalReport1.SelectionFormula = sql
CrystalReport1.ReportFileName = reportfilepath & "
CrystalReport1.Action = 1

can anyone help me on this.


Open Crystal Report That Conect To Password Protected Database
Hello everybody:

I'm using VB6 to show the reports. I already add a form with Crystal Report Viewer, but the problem is when I tryed to open the report. It shows me a message that the user account is not valid.
The crystal report already exists and it conects to a password protected database (Access), this database also has user accounts.
If i open the report on crystal report it ask me for user, password, Jet database password and Jet system database.
I want to know if the code i'm using is the correct for this.

My code is:

Dim CrxApp As New CRAXDRT.Application
Dim oReport As CRAXDRT.Report

Set CrxApp = New CRAXDRT.Application

Set oReport = CrxApp.OpenReport(DBPath & "Ced.rpt", 1)
oReport.ParameterFields.GetItemByName("muni").AddCurrentValue id_muni
oReport.ParameterFields.GetItemByName("dpto").AddCurrentValue id_dpto

For i = 1 To oReport.Database.Tables.Count
 oReport.Database.Tables(i).SetLogOnInfo "LocaLPC", "Ced.mdb", "User", "passwor"

CRViewer91.ReportSource = oReport
CRViewer91.DisplayGroupTree = False
CRViewer91.EnableGroupTree = False
CRViewer91.EnableAnimationCtrl = False

Please help me!!


How Can I Open A Locked Access Data Base Through Crystal Report?
hi I m Amjad
i want to use crystal report but my Access data base is lock then how can i give the database ID/pass through Crystal Report to open my data base??
plzzz reply me soon its vary urgent.

Error In Crystal Report "Server Has Not Been Open Yet"
I have a problem. I have my database in a server and i connect to the database with a odbc driver. All my connections in my program are ok, but when i try to open a report in crystal reports the next error appears.

"Server has not been open yet"

Anyone knows what i need to do?

Error In Crystal Report - "server Has Not Yet Been Open"
hi experts,
I am building reports using crystal report 8 in my VB application. the datasource is Oracle 8i(8.1.6).
When i built a report using the report expert in Crystal report it has successfully created the report.
But when i ran the application i throws an error (ORA01005) saying - "null password was given; logon denied" and "server has not been yet started"

i have not written any code, i just used the wizard(report expert) and i have give the correct user name and password.

also i did the same thing without wizard, using code. the code which i have written is in the follwoing lines.

Const ConString = "Provider=MSDAORA.1;User ID=gtsc;password=gtsc;Data Source=portal1;Persist Security Info=False"

Private Sub Report_Initialize()
Dim con As ADODB.Connection
Set con = New ADODB.Connection
con.ConnectionString = ConString

Dim rs As ADODB.Recordset

Set rs = New ADODB.Recordset
rs.Open "Select * from emp", con, 3, 2, 1

Database.SetDataSource rs
End Sub


so any body can help me on this issue.
immediate help is required.
thanks in advance.


Error In Crystal Report - "server Has Not Yet Been Open"
hi all,
I am building reports using crystal report 8 in my VB application. the datasource is Oracle 8i(8.1.6).
When i built a report using the report expert in Crystal report it has successfully created the report.
But when i ran the application i throws an error (ORA01005) saying - "null password was given; logon denied" and "server has not been yet started"

i have not written any code, i just used the wizard(report expert) and i have give the correct user name and password.

so any body can help me on this issue.
immediate help is required.
thanks in advance.

What Other File Crystal Report Can Open Except Image File?
Hi frens,

Is anyone here know crystal report can open a text file or not? i know that crystal report can open an image file . but i want to open a text file (.txt). Anyone can help me?

What im doing now is i have few difference file (eg. .doc, .txt, .jpg, .xls) that is store in my SQL server database. And i open crystal report and put the field that contain this file in detail section. The result i get is i only able to see the .jpg picture open. but the rest is empty. Is that mean crystal report not support other file other then an image file?

Appreciate yo help. TQ.


"cannot Open Sql Server" Vb-crystal Report 7.1
Hello !
i'm a bigginer to crystal report 7.1 working with vb6 and sql2000.

i' have created a report in crystal report 7.1 and want to call from vb form.

when i tried this with the following coding using crystal report control i'was getting the error message

"cannot open sql server"

what should i do ? do i need to give the connection string ?
if so show me sample.

With crcontrol
.ReportFileName = App.Path + "
.ParameterFields(0) = "pbcode;" & txtbcode.Text & ";true;"
.WindowState = crptMaximized
.Action = 1
End With

thanks in advance.

How To Pass Format String To Crystal Report From VB And How To Use It In Crystal Report?

I am working on VB 6.0 and using crystal report 7 as reporting tool.
In report, some clients are asking 3 decimal places(Eg. 2000.500) while other clients are asking 2 decimal places(Eg. 2000.50) for numeric fields.
I want to pass the amount of decimal places for numeric fields to crystal report from VB.
How should I implement this using VB.
Pls any one can help me?

Thanks in vance,

How To Replace Crystal Report Control With Crystal Report Designer

I want to replace crystal report control with crystal report designer in vb. report files are ready.
and parameters have passed by crystal report control to the actual repors which are made in segate crystal report.
now i want to keep the re[prt files as it is. but instead of control,
i want to use designer.

plesae help me


Crystal Report ActiveX Vs Crystal Report Wrapper.bas
When print a report via Visual Basic, is it recommended to use the methods and properties of the ActiveX or using the functions provided by the wrapper, such as PEOpenPrintJob and etc.? If there's no diff in using both, then I have a question. There is a PEClosePrintJob function in the wrapper, however, there isn't any methods or properties in the ActiveX to perform such function. What will happen if PEOpenPrintJob (called by ActiveX's ReportFileName) is executed x times but the print job is not closed at all?



Connecting SQL Db From Crystal Report (through VB Crystal Report Control)
VB -> Crystal Report -> SQL database
I need to use VB to call CR (Crystal REport) to access data in an SQL server.

1) Over at the SQL server, I have created a login account, login ID = "RMS", and password = "9999".
2) I have created a ODBC - System DSN (in the control panel), with the login ID, password as in (1).
3) I have run-time CR installed on the client PC.
4) At the click of a button in my VB application, the CR (.rpt) will open (via Crystal Report Control in VB) and retrieves data from the SQL server database through the System DSN created in (2).

MY VB application FAILS to open up a CR file (.rpt) No error message though.

I realise that the VB CAN only open the CR (.rpt) when the PASSWORD in (1) is LEFT BLANK.

It seems that I have to Hardcode the password somewhere.
1) HOw do I pass the password to CR so that the CR will not fail to display itself?

Really appreciate your good karma!

Thanks in advance!

Crystal Report... How To Print Crystal Report Using PrintDocument??
Hi.. I need help greatly... there's an issue which required me to make use of the PrintDOcument Object to print this crystal report..Instead of the pre defined printer button on the crystal report viewer..???Can anyone teach me HOW to print crystal report using the print document??it just seems to can't capture the crystal report for printing.... ANd how do i make use of the PrintPage Event???

Accessing Main Report Field From Sub Report In Crystal Report 8.5
Hi there,

is it possible to access a field that is in a main report from the subreport. The sub report and main report uses different Sql
statment. How could i achive this.

The reason i need this is because, i would like a value to appear
in a fieldA in the subreport, if the value in fildmain in main repoert is equals to 10.

any suggestions....

Thank You...

regards ....

How To Dynamically Change The Login Info Of A Crystal Report Using Crystal Query File

How can I dynamically change the login information of a Crystal Report that uses a Crystal Query File (*.qry) to retreivee it's data using VB.NET?

It works fine when the report is built on regular table links generated within the Report Designer, I simply use the following :

Dim myLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo()
myLogonInfo.ConnectionInfo.ServerName = UCase(SelectedDB.GetName) & "_ODBC"
myLogonInfo.ConnectionInfo.DatabaseName = UCase(SelectedDB.GetName)
myLogonInfo.ConnectionInfo.UserID = UCase(usr)
myLogonInfo.ConnectionInfo.Password = UCase(pwd)



But when the Data is retreive using a query file it crashes.
Any ideas?


In Crystal Report, Report Is Viewed But Doesnot View Next Page Or Not Any Message Display!
in crystal report, report is viewed but doesn't view next page or not any message display! and surprisingly page no is increased infinitely (up to no limit!, I have checked up to 400+) but next page was not displayed! if I print report , only 1st page is print!

In this report , I have attached 6 subreports!

I hope anybody reply about my problem

Storing And Retriving Images From Access Databse Through VB Data Report Or Crystal Report
hi friends
    i have a problem that i have a database of some 8000 students in which there is a field called "photo" which stores the photograph. it is stored as BLOB field. now i want to retrive it in my report. i'm getting very much difficulties in it. can i have a help from master minds to resove the same. it will be very much helpful to me.
    my e-mail id:
  ur suggestions r welcome. anybody can mail me. hoping for the best.

Crystal Report Crosstab Report Criteria Selection Using Access 2000
Hi there
I there anyone with an idea on how i can filter crosstab Report done in Crystal Report 8.5.. I'm trying to get data btw two dates for instance 05/01/04 and 05/31/04 but the following code doesn't do that. I'm using access 2000 database. Pls assist.

fMainForm.CrystalReport1.ReportSource = crptReport
fMainForm.CrystalReport1.ReportFileName = "F:OutGrowerReportsGLdelivered.rpt"
fMainForm.CrystalReport1.SelectionFormula = "Wdate" >= " & {CrossTabData.WDate} =" & "'" & CDate(DTPicker2.Value) & " AND Wdate" <= " & {CrossTabData.WDate}=" & "'" & CDate(DTPicker2.Value) & "'"
fMainForm.CrystalReport1.WindowState = crptMaximized
fMainForm.CrystalReport1.PageZoom (100)

or is there another better way to do this.

Help With Report - Easy One For People Familiar With Crystal Reports, Data Report Et Al
Till date, I have worked only with the Data Report
Utility that is dovetailed with the Data Environment
Designer, for the purpose of generating reports in my
applications. Shamefully, I am completely nescient of
Crystal Reports. I would want someone to kindly take
time to read my query and provide me a clue as to the
solution. The problem, I surmise, would be
interstingly simple for the creed of programmers who
are familiar with reporting softwares like Crystal

I have a table in MS-Access 2000 and its called
'Holidays'. The Holidays table has the following

What's Logon Parameter To Oracle Server With Vb To Print Report With Crystal Report
Hi all,

How to write a log on parameter to oralce server with using vb to print a report that using crystal report

is it crystalreport1.connect = "Dsn=servername;uid=username;pwd=password"

and how to use the selectionformula

VB6.0 With Crystal Report 8.5 Package Setup For Crsytal Report Engine (Crystl32.ocx)
Setup Crystal Report Problem When I click Crstal Report Engine at Control Component (Crystl32.ocx) and I make Exe of VB 6 with SP4 , then I use Package & develop tool to make setup list I will facing a problem of Error 28 Out of Stack Space .

How To Change Database Conn Using RDC9 On Created Crystal Report Report.

please answer me as soon as possible.

I have used CR 9 to create report that uses SQL Server data.

Now I want in VB to change so that I get report for some other database server and database. Structure and table names are identical.

I neet solution that will work for SQL Server and that will be work for all my reports, so that I don't need to know what tables are used in report. Also I need to say that my report uses more than 20 tables.

How ?!! I have read about changing connection property but it doesn't work. What to insert * HERE *:

Dim crxApplication As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Dim strSel As String

Set Report = crxApplication.OpenReport("HZZO.rpt")

* HERE *


strSel = "{Stavke_računa_poliklinike.RacunBR} = '20030000001' "
Report.RecordSelectionFormula = strSel

cv.ReportSource = Report

Server will be: gradp4
Database will br: Bis6Test
User: ime
Password: sifra
Connectivity technology: OLE DB

Thnx in advance.

Show Print Dialog When Printing Report With Crystal Report
Hi there,

In my code when I press on the printing button I want it to show the printing dialog to choose printer and tray which I will print out.

My code like this:

Public Report As CRAXDRT.Report
Set Report = crxApp.OpenReport(App.path & "Data
Report.PrintOut true

With these code it only let me choose from page to page not for printer and tray.

Thanks a lots.

Crystal Report Problem Stock Ledger Report In Pos System
I am making a stock ledger report for a Point of Sales System. The user selects the items and the date range and the stock ledger report comes in the following format

Date --- particulars-- reference--qty--rate--value

The report is grouped item wise. The database table contains more or less the same fields.

What i want is to calculate the opening balance and make it appear before each item. say a user selects 1st march - -7th march 2005 as the date range and all items, so the report should show opening balance as on 28th feb 2005, the transaction after the date. How do i calculate the opening balance as on 28th feb in the report?

kindly help

Set Crystal Report Width And Height - For Very Long Report Size
i need to come up with a report that is 25 inches in width and about 113 or 15 in height... how?

i know, this might be simple for some but, i really have no idea...

Passing Pwd To Crystal Report Through Code To Generate Report On Pwd-protected Db
Hi everyone.

Now, I need to pass password to a report in run-time and generate it. I am using Crystal reports 8.5 and my database (from which I intend to generate report) is db-password protected. My project works very fine after the addition of 'Jet OLEDBatabase Password=myPwd' in the open string.

Please help me as I am in the middle of nowhere. I need to have a code on opening a report by passing the pwd from code and then open it using filters users prefer.

Thanks in advance.


How To Save Report In Jpg Format, Generated Using Crystal Report In VB Application
Hello dear,
I am using VB6 + CR9 to generate a photo-ID report and want to save the report in jpeg format. Pls. let me know, How can it be possible?

Splitting Wide Report Into Multiple Pages In Crystal Report 6.0
I have designed a report in Crystal Reports 6.0 which does not fit into an A4 sheet. So I have to split the page into two or more A4 sheets. How can i do that?

Any help or sample report will be greatly appreciated.

Copyright © 2005-08, All rights reserved