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

Opening Crystal Reports .rpt File

I need to open a Crystal Reports .rpt file from within VB6
Can anyone let me know how to do this please. I have a Crystal reports viewer on a form and need to know the code that calls the file from a directory on my hard drive and displays it on the viewer.


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Error Opening File In Vb With Crystal Reports

I have a Vb app that has a crystal report in it. Crystal report is 8.5 standard and vb6. I use the crviewer to view the report. when i go and view the report it gives me an error stating 'error opening report'.

I am only having this problem on clients machine that do not have crystal reports installed. Is there some dll that I need. the database is access 2000 with not security on it. Everything is in one folder. The app and database are all installed on the clients machine.










Crystal Reports..opening Reports Runtime
I want to know is there anyway where i can make a query and attach that recodset to the report .I dont know much about ttx and would like to write the code with opening a crystal report application.
I have just added a reference of Reports dll and dont want to use Crystal Report control in the project.
I have made report with ADO option.
hopefully someone helps me in this direction
Thnaking you

Opening A Crystal Reports 10.0 Report Using VB 6.0

I am totally new to Crystal Reports 10.0 from the programming point of view. Crystal Reports 8.5 used to provide a Crystal Report control that I could place on my VB 6.0 form and launch the 8.5 report from within VB 6.0.

But with Crystal Reports 10.0, that control is not available. I did some research and found out that I need to use the RDC component to open a Crystal report.

I have the following code written:

Public crxApplication As New CRAXDRT.Application
Public Report As CRAXDRT.Report

Dim crxDBTable As CRAXDRT.DatabaseTable
Set Report = crxApplication.OpenReport(strCommonPath, 1)

where strCommonPath is the concatenation of App.Path and the report file name.

For Each crxDBTable In Report.Database.Tables

The reason I have specified ???? is because I am looking for that method but I do not find it. I know that is the way I can set my log in properties, what reference am I missing?

Also, if I need to use about 10 reports, all with the same connection, I realized I can set it at the crxApplication level like:

crxApplication.LogOnServer "p2sodbc.dll", "Server", "SampleDB", "sa", "sa"

But I do not have p2sodbc.dll on my machine. I installed Crystal Reports v10 OEM edition that came with Microsoft Business Solutions software named Great Plains.


I am sure someone has accomplished this before, I would greatly appreciate it if someone can point to the solution for my missing pieces.

Thanks a bunch in advance.

Chad Sriram

Opening Crystal Reports From Visual Basic
I need some assistance on how to open a crystal report from vb.

Opening Crystal Reports In VB, Adapt Report And Save It As Pdf?
How can I open a report template in vb, edit some field and save this report as pdf? All this in vb without opening crystal reports?

Problem Viewing Crystal In MDI - Multiple Opening Of Reports (RESOLVED)

i'm having problems viewing my crystal reports in MDI style. If i open multiple reports in MDI i cant seem to get its focus (ican't bring it to front) if its already open.

this is what my report looks like in MDI form.

is there a way i can get the focus of my crystal report if its already open or loaded?

this my typical code to load the report:

Private Sub mnuTransactionReport_Click()

Me.CrystalReport1.SelectionFormula = ""
Me.CrystalReport1.ReportFileName = ""
Me.CrystalReport1.WindowTitle = "Transactions Report"
Me.CrystalReport1.ReportFileName = mReportPath & "rptTransactions.rpt"
Me.CrystalReport1.Destination = crptToWindow
Me.CrystalReport1.WindowParentHandle = frmMain.hwnd
Me.CrystalReport1.WindowState = crptMaximized
Me.CrystalReport1.SelectionFormula = "{ViewTransactions.TransDate} = #" & mTransDate & "#"

End Sub

any suggetions?


Crystal Reports Help File
Does anyone know where i can get hold of the crystal reports
help file, it is not installed on my PC, so every time i do F1
it asks me if i want to try and find it myself, which i know i do not have.

the file name its asking for is DEVELOPR.HLP

Any pointers would be great.



Crystal Reports 8.5 And .qry File

I am using an older version of Crystal Reports (v8.5) for reporting and the report I have uses a .qry file rather than a database link. I realized that the data is not refreshing on the report unless I refresh /re-run the query in Crystal SQL Designer. It will not refresh the data if I try to refresh in the .rpt file. I have to open the .qry file to get the new data. Does anyone know how to refresh this automatically?



Refreshing XML File In Crystal Reports
am using XML as my data source. also am using the Embeddable crystal report designer on a vb form for which i have set the CR XML ODBC driver .however this XML file changes ie node texts but not the Structure. if i use the xml file to design report template and save it , how do i get the report to contqain the new data when i open the report the next time? the problem is when i open it dispalys the content of the XML file i used the last time.
what i want is to save the tags pointing tom the datasource
sample code pliz

Crystal Reports, Missing File
I've built a vb 6 program and using Crystal Reports Developer 10, I have embeded several reports. When I try to install the app to another machine "Which has the same operating system, Windows XP", I get the error: "Component 'CRViewer.dll" or one of its dependancys not correctly registered: a file is missing or invalid". I know that CRViewer is registered because I registered it myself. And CRViewer only has one dependant file associated with it "Olepro32.dll" which isn't missing or invalid. Anyone have any Idea what is wrong. Thank you

Connecting Crystal Reports Thru File Dsn
Hello friends

i want to connect my vb application with crystal reports , this i can do easily with system dsn but this want it to be done by file dsn

plz help me


Anyone Have Crystal Reports 8.0 Runtime.hlp File?
I am looking for the runtime.hlp file for crystal 8.. because it has detailed info on files and versions for distributing the cr engine during installation, but for some reason, it comes with the development edition of CR and not the professional version...

Display Crystal Reports *.rpt File
is it possible to display a crystal reports *.rpt file using the crystal reports activex control? i'd like to have the reports external to my app, cos there's quite a lot of them. failing that, would it be a good idea to have them all in a DLL?

Text File To Crystal Reports
Do you know any body how to convert into a crystal report through VB. Or even if any component which gives a report of form in VB would be enough

HELP With Crystal Reports 7.0 And A Missing File
Hi everybody..

i've use the package & deployment tool for an application i've just developed. i'm using crystal report 7.0.

in my computer, everything works fine. In fact, the application works correctly in workstations where crystal report has been installed.

the problem at distribution time. When the application is installed in a computer with no crystal report, the reports won't run because they call for a "pdsql.dll" file which was not required before.

Can anyone tell me where i can find that file or any workaround?
the workstations run on Win95. My computer uses winNT workstation 4.0


Problem Using File Dsn In Crystal Reports
HI members,
    I have used a file dsn to make my crystal reports as i have to change the location and name of my databse but the structure (i.e, database schema) is same.
    It was working well when i created it for the first time but when i changed my database it is giving error (Method readrecords of object icrreport failed) i am using crystal report 8 and opening reports using crystal report engine 8 to open my reports through VB Code.
    Can any one help me in this regard that i don't have to change settings of my report each time while running it for a databse with different name.

I'll appreciate u'r support
Thanks in advance.

Crystal Reports: File Not Found
hi there all trying to load a crystal report and i get this message
Quote: crystal reports viewer: file not found

this has somthing to do with the subreport that i have in it,
if i delete the subreport the report will load with no problems.

can some one help here ???

Crystal Reports, Exporting To A File

I'm using crystal reports 9 in a project..
printing a report per user works, but getting it to export isn't going that well :x

so far I have:
    report.ExportOptions.PDFExportAllPages = True
    report.ExportOptions.DiskFileName = App.Path & "Reports" & Test.Naam & "_" & Test.Voornaam & ".pdf"
    report.ExportOptions.DestinationType = crEDTDiskFil

when it reaches that code it does export but first several popups come to ask me where to save to, if I want to save all the pages and what filename it should have..
I want it to export without those questions popping up
anyone have any experience with this ?
thx in advance.

Change The Ttx File In Crystal Reports From VB
How can I through VB point a ttx file to a newly created crystal report and then
set a ado datasource to that report. All of this must be done from VB.
I am using SQL 2000, Crystal reports 8.5 and VB6


How To Make EXE Of .rpt File In Crystal Reports
i am using Crystal Reports version 8.0 for developing reports.
i have developed .rpt files.
now i want that files to distribute to client...
i want to make exe of .rpt file.
please send reply if any one knows this...


Print PDF File (when Created By Crystal Reports)
I have a project which uses a database, takes some values, creates a report (using crystal reports) and then stores the report in a PDF file.

I would like to be able to print this PDF file when it is created as an automation.

I am using VB 6.0 and never had some printing xperience before, so if someone could guide me through the process i'd be grateful.

ps: while searching past posts, i encountered some things about Acrobat Writer. Is it essentian to have Acrobat Writer in order to achieve my goal? I didn't quite get it..

ps2: i wasn't quite sure where to post this thread. General or Database n Reporting. I figured out it is a printing issue so i ended up here. I 'd like to apologize if i misplaced it..

Thanxs in advance

Printing File Using Crystal Reports In Nlq Format
How to print a file using crystal report in a quick format
The print should be as fast as printed through a DOS editor.
Please provide a solution for this (my client wants his report to print as faster as his Tally package prints)
How to print a file using crystal report in a quick format

Using A Query File (.qry) In Crystal Reports As The Source
I've created a query file (.qry) with Seagate Crystal
SQL Designer. Because the query had a several where
clauses, nested queries and a compute by and compute
(for grand total) clauses, I wrote the query in the
query editor dialog captioned 'Enter SQL Statement'. I
fired the query and it worked successfully.

Now when I wish to create a report using this query in
Crystal Reports, I use the Standard Report Expert and
in that I choose 'Crystal SQL Query' as the source
instead of the 'Database' option. Meanwhile, in the
Crystal Reports SQL Designer (where I created the
query), I have the 'Save Data With Query' option
turned 'On' (I guess this is not what I want as I
understand I only need the query and not a snapshot of
the data, yet as a hueristic endeavour, I let it be
on, I am going to toggle it later if it does not
work). In the fields tab of the Standard Report
Expert, I choose all fields, (I dont want any extra
grouping here as all the grouping and ordering and
sub-totalling and grand-totalling has been done in the
query) and when I finally hit the finish button, it
arranges all the query fields as specified in the
Query File correctly in the Designer window, but in
the Preview window, it says "Physical database not
I turn off the menu option 'Save Data with Query' in
the Crystal SQL Designer' though I guess it has not
much to do with the database not being found
physically. I am using MS Access as the database. As I
guess, the problem might be with the Crystal SQL
Designer Software not being compatible with my Windows
ME. I might need some SP for it to work properly or
may be change some settings, because when I open the
query file (.qry) file with notepad to investigate the
possible problem areas, I see one possible problem
area -
Although the file is binary, as I've read, binary
files retain the String literals with embedded spaces,
so I search for the database path in the query file
(.qry) and see it has been written as "C:Temp"
instead of "C:Temp.mdb". Since there is a folder
called Temp also, I change the name of my Access DB to
PM.mdb and go back all over again to redo the query
and then use it in Crystal Reports, but the error does
not go.
Please help.

Sathyaish Chakravarthy.

How To Print Many CRYSTAL REPORTS Into A Single PDF File
Dear VB & PDF experts,

I am having 6 types of reports for a single salesman. I am able to
print these reports individually. My problem is that I need to print
these 6 reports for a salesman in a Singly PDF file. This means I want
to print first report and next report is to be added into the same file.
I have this basic code but can any one has some thoughts or codes in
this type of work...

I am using these versions VB6, CR 8.5 and having PDF writer/Distiller.

Report.DisplayProgressDialog = False

With Report.ExportOptions
.DestinationType = crEDTDiskFile
.FormatType = crEFTPortableDocFormat
.DiskFileName = "C:My DocumentsMyPDFFile.pdf"
End With
Report.Export False

Best Regards,

Arun Kumar Rodrigues
Mohamed AbdulRahman Al-Bahar
P.O. Box 6038
Sharjah - U.A.E.
Tel.:+971 6 5433 555 - Ext. 343
Direct:+971 6 5141 343
Fax:+971 6 5432 555
E-mail: email@removed

Crystal Reports: Error In File Links
I tried to insert fields from two table which has the same structure and data.Actually they are created by the command COPY STRUCTURE from another table.
It is giving error:
Error in file links.
Warning:Fields in the report from the file "XXXX" could not be linked.

I have not created any indexes on tables.

Please give solution for this. Is there any alternative for this.

Crystal Reports Export File Problem
I am working with Crystal Reports 9. I am using RDC and Report viewer control in VB to Preview and save my crystal Reports.

Here is the piece of code for exporting the report to a file:
The following code works fine

report.ExportOptions.DestinationType = crEDTDiskFile
report.ExportOptions.DiskFileName = "c:sample.txt"
report.ExportOptions.FormatType = crEFTText

report.export False

Problem comes with this code:

report.ExportOptions.DestinationType = crEDTDiskFile
report.ExportOptions.DiskFileName = "c:sample.txt"
report.ExportOptions.FormatType = crEFTTabSeparatedValues

report.export False

Whenever I user some other format type other than crEFTText. I get the following error:

Run time Error ........
Error in file? or
Missing or out-of-date export DLL

Can anyone help in this regard. Why i am getting this error. I need to save the report in many format types.

Pls. do help me with this.

suresh gade

Reading Text File In Crystal Reports For VB
I am trying to use Crystal Reports in Visual Basic to print a report, whose layout I have already created in Crystal Reports.

How can i code this in VB 6?

In the tool BAR there is Crystal Report icon, but how can i use this
to print a report based on data in a text file?

Any help would be appreciated

Exporting From Crystal Reports Creates An Empty File
I have a VB 6.0 application which creates dynamic reports using crystal reports' Craxdrt.dll and crviewer.dll. I am trying to make use of the crystal files u2ddisk.dll and u2fText.dll to enable to reports to be exported to the disk file in the Text format.

After supplying the filename and path Crystal reports creates an empty text file in the path. Sometimes the application crashes while trying to export.

Can anyone help me with this issue.

Thanks a lot.

Changing ODBC Driver File Location @ Run Time (Crystal Reports)
I have two reports written in Crystal Reports version 8.0 that use the MS Text ODBC driver as their database. The formatting is appropriate and the reports work fine. However, I am on a mission from my boss to see if I can change the location of the text file on the fly. For example, if it is designed to point to H:Reports and I want to change it to C:Software on the driver, how would I do that? I've explored the Set Location option, but didn't find anything helpful. It appears that the change would have to be on the DSN.

Your assistance is greatly appreciated!

Crystal Reports 9: “Choose/Save Export File” Dialog Box
I would like to use the Report object Export method to provide a simple mechanism for exporting reports. My only problem is that I would like to initialize the “Choose/Save export file” dialog box to a specific directory before it is displayed. Somewhat like setting the visual basic CommonDialog.InitDir property.

Is this possible?

Edited by - AlanG on 11/17/2003 12:18:56 PM

Data Reports Active Reports Or Crystal Reports
Hi all

I am really stuck here and i need help urgently
I have to call three tables in a row to print a single invoice entry
noe the problem is if the do it by calling single tables then there is a problem that it is nopt going to print the last order which is filled.Is there is any way it can be done through using sql command or something.
Secondly if i use max order in sql then i would not be in a position to print order after searching for it


In Crystal Reports, How To Display Financial Reports (P & L, Balance Sheet Etc.) In Columnar Format
Dear All,

I am developing a Financial application using VB6, MS-Access & Crystal Reports 8.5. I am facing problems in certain reports. Some of the reports like Profit & Loss and Balance Sheet require the output to be printed in columnar format.

I have tried giving subreports for each section, i.e.; Assets & Liabilities, but then, the output is not coming in order as per the groups. The problem is even more where there are sub-sections in the right side column & left side column for example in Profit & Loss, where there are sub-sections for Gross Profit/Loss and Net Profit/Loss. In such cases, how to bring the total amount fields at the same horizontal level.
I hope someone can help me how to do the above.

Thanks in advance.

Best Regards

Change The Database Location In Crystal Reports Sub Reports From VB During Runtime
I have several reports that were designed in Crystal Reports that have the DB location changed during runtime. When I move my database, or choose another copy of the DB that has a lot of records in it, my reports don't fire. I need to be able to Verify the database during runtime. I'm usiung VB6.0 and CrystalReports8.5 I've tried using Crystal's "Verify On Every Print" function, but I haven't had any luck. Here is the code I am using.

MyLocation = "C:mydatabase.mdb"
CRPE321.ReportFileName = "c:aptcom
eports eninfo.rpt"
CRPE321.DataFiles(0) = MyLocation
CRPE321.ParameterFields(0) = "ThisKey;" & Who.Text & ";true"

Also, does anyone know if changing the DataFiles location during runtime also effects the subreports. I don't think it does, but any input would be appreciative.

Need To Understand Data Reports - Heard That Crystal Reports Were Slow
I have two questions:

1.) I was going to take a step forward to learn how to use crystal reports but I heard that on a website they are viciously slow. Is that true or is there a way around that with coding?

2.) I have been using Access reports through Visual Basic 6.0 with the following code - thanks for the tremondous help of everyone on this website:

appAccess.OpenCurrentDatabase SERVER & "disp-1_be.mdb"
appAccess.DoCmd.OpenReport "oalog", acPreview
appAccess.Visible = True

The reports work great UNTIL I came accross a situation where the report is based off of the data entry of the user. oalog is a monthly report and in the query it automatically pulls the current month with the following query:

SELECT oalogallmonths.ctsbranch, Count(oalogallmonths.Amount) AS [Total Of Amount], oalogallmonths.GivebyName, oalogallmonths.United, oalogallmonths.Mayflower, oalogallmonths.Other, oalogallmonths.Tord, oalogallmonths.CURRENTDATE, oalogallmonths.Amount, oalogallmonths.Month1, oalogallmonths.ORDER
FROM months, oalogallmonths
WHERE (((months.monthID)=[oalogallmonths].[Amount]))
GROUP BY oalogallmonths.ctsbranch, oalogallmonths.GivebyName, oalogallmonths.United, oalogallmonths.Mayflower, oalogallmonths.Other, oalogallmonths.Tord, oalogallmonths.CURRENTDATE, oalogallmonths.Amount, oalogallmonths.Month1, oalogallmonths.ORDER
HAVING (((oalogallmonths.Amount)=11;

If you notice the records are pulled HAVING the 11th month in there.

If I want the user to ENTER the month I know that I must change the last line to:

HAVING (((oalogallmonths.Amount)=[ENTER MONTH]));

But a user might type January or 12/2003, etc...

so I made a combobox named ListMonth of the 12 months.
Then I made the change from:

HAVING (((oalogallmonths.Amount)=11;

HAVING (((oalogallmonths.Amount)=ListMonth.ListIndex + 1));

The only problem is that I keep getting a message box asking for ListMonth.ListIndex + 1.

My question is in the above code that defines appAccess.DoCmd.OpenReport "oalog"...
is there a way to change the RecordSource of the report to pull from my own query instead of the Access Query?


Crystal Reports - Upgraded To 8.5, Now Reports Written In 8.0 Wont't Work!!!
My reports are crashing when I run them on a machine with CR8.5, but they work fine on cr8.0. They crash inside the .DiscardSavedData Routine.

Does anyone know why or what I can do...

I call the report.Printout routine and right after I call the
.DiscardSavedData. The report is still printing out in debug mode.

Please help. Is my syntax wrong. The help file says I can only use Printout and DislcardSavedData in "formatting idle" mode. I don't know what this this???? The .PrintOut routine works but not the discardsaveddata.


Any help is appreciated.


How To Use Crystal Reports To Make The Dynamic Reports?(I Can't Use The Design Expert To D
  How to use Crystal Reports to make the dynamic reports?(I can't use the design expert to design the report,because the data source with different fields is unknown in design time.)
     Hello all!
     I use the dynamic generating MS Access table as the Data Source of Crystal Report.
How to use the Crystal Reports to display the data of the dynamic generating MS Access table?
     Thanks All!

Edited by - on 12/17/2003 9:37:59 PM

Change The Database Location In Crystal Reports Sub Reports From VB During Runtime
I've created a Report Viewer that displays Crystal Reports 8.5 reports. I have the DB location in Crystal Reports changed during runtime, but I can't get the location to change in the subreports at runtime as well. Also, by using my method of calling the reports, I can't get VB to pass any parameters to the Main report. Below is the code that I am using. I'm using VB 6.0 and CR 8.5

Dim MyNewKey
MyNewKey = Who.Text

' On Error GoTo KeepGoing

MyLocation = GetStringValue("HKEY_LOCAL_MACHINESoftwareAptCom", "AptCom DB Path")
strReportFile = "c:aptcom
eports eninfo.rpt"

Set CRReport = New CRAXDRT.Report
Set CrxApp = CreateObject("crystalruntime.application")
Set CRReport = CrxApp.OpenReport(strReportFile)
' Set CRReport.ParameterFields(0) = "ThisKey;" & MyNewKey & ";true"

' KeepGoing:

For Each dbTable In CRReport.Database.Tables
dbTable.SetLogOnInfo "", MyLocation, "", ""
dbTable.Location = MyLocation
dbTable.SetDataSource MyLocation
Next dbTable

CRReport.SQLQueryString = strSQL

frmReportViewer.CRViewer1.ReportSource = CRReport

Set CRReport = Nothing
Set CrxApp = Nothing
Set CRReport = Nothing

I've tried using this method:

MyLocation = "C:mydatabase.mdb"
CRPE321.ReportFileName = "c:aptcom
eports eninfo.rpt"
CRPE321.DataFiles(0) = MyLocation
CRPE321.ParameterFields(0) = "ThisKey;" & Who.Text & ";true"

But, I can't get Crystal Reports to verify the database during runtime. The first way verifies the DB, but won't change the DB location of the subreports or pass parameters to the reports.

Any help would be appriciative.

Crystal Reports- I Need Help Running Reports With A Shared Database.
I am trying to figure out how to use a shared database in crystal reports. I have it set up for my application were I use: App.Path +
"databaseWMdbase.mdb" But in crystal reports it makes you use a drive name. I am trying to use the UNC but when I run it on the computer without the physical database it tells me Database not found... is there a way to set the Location of the database in the form load like you do with ADO? Any help or Ideas would be great.

I Hate Reports. Trash Crystal Reports, Access Instead?
I am creating an app which requires a copius amount of complicated reports. These reports would be an absolute breeze to do in access, simply create a query that does all the work then base the report on that. Instead of wasting time with Crystal Reports, I'd love to be able to create an access query and then run an access report based on that query from within my VB app. Now I have code that allows me to run an access report, but it seems to require that access is open on the users machine at that time. Is there any way I can achieve what I need without opening access each time ?

Export Reports Created Using Crystal Reports 8.5 To MS Excel
i would like to know if there is a way out to export reports created using Crystal reports 8.5 to MS Excel directly with out the user doing it manually, by coding in VB6.0.
If yes please give me the codes.

Crystal Reports Using ActiveX Viewer For URL Linked Reports

We have a IIS service that broadcasts a virtual directory of reports so that they can be viewed using the crystal reports ActiveX viewer through an IE browser.

I am now trying to replicate this setup on another server, the IIS service is setup and URL's created for our reports.  When they are selected the browser defaults to the Crystal Enterprise logon screen.  Where do i change the settings so that the ActiveX viewer is used in the browser to view the report?

Many thanks,


Retrieving Images In Crystal Reports And Data Reports
I am saving the image path in the database and retrieving it for display but the problem is when I want to print the image for that particular record when I am only saving the image path in the database.

If I embed the image in the database it increases the size of the database but can be used in the reports in a bounded image control.

If somebody can help me retrieve the image in a data report/crystal report by using the image path in the database that did be great.


Grouping Records In Data Reports / Crystal Reports

I want to group records in my Data Report based on 2 particular fields. Just see the example below.

Below is the Table Structure and its values

UnitID Part Quantity
1 xx 5
1 xy 10
2 xx 5
2 xy 10

Now I want to result to show the summation of quantities based on the part only.

so the result should be

Part Quantity
xx 10
xy 20

It would be fine if someone can tell me how to do this in Crystal report/ VB data reports


Anybody Know How To Get Crystal Reports 10 Reports Working In VB Studio 6?
It seems that there are a few posts regarding Crystal Reports 10...few from me. However there are 0 responses dealing with any really developer issues. Has anybody moved to using CR10 or are you people still using 8.5 or another version. Could you tell me what version you guys are using so that I will stop posting issues about CR10

Crystal Reports, Printing Data Reports
how do you filter records in Crystal Reports using a variable? I'm using Crystal Reports ver. 4.6.1 Why does a time field shown as mm/dd/yy when it should be hh:mm? Is there an easy way to print data reports with filtering or conditions in vb?

Problem Accessing Reports In Crystal Reports 9.0 From VB
Hi.  I use the following code in a number of VB apps to execute Crystal Reports.  It has worked fine with CR 7.0 and CR 8.0.  Now, with upgrade to 9.0, code will not work.  Error message is "Unable to load report".

I've played around with some of the references and componenets for 9.0, but haven't had any success.  Anyone encountering same problem?  Any workaround without incorporating the crystal viewer?  Any help would be greatly appreciated.

Thanks.  TM.

Public Sub PrintCrystalReport(CrystalReport As Object, _
                              Optional ReportName As String, _
                              Optional criteria As String)
On Error GoTo problems
    Dim i As Integer
    Dim n As Integer
    Dim a As Integer
    Dim response As Integer
    With CrystalReport
       .Connect = "DSN=" & strCurrentServer & ";UID = crystalreports;PWD=crystalreports;DSQ=" & strCurrentDatabase
       .ReportFileName = App.Path & "Reports" & ReportName
       For i = 0 To .GetNSubreports - 1
            .SubreportToChange = .GetNthSubreportName(i)
            .Connect = "DSN = " & strCurrentServer & ";UID = crystalreports;PWD =crystalreports;DSQ = " & strCurrentDatabase & ""
       .SelectionFormula = criteria
       .WindowState = crptMaximized
       response = MsgBox("Would you like this report sent to the printer?", vbYesNo, "Send Report To Printer")
       If response = vbYes Then
          .Destination = crptToPrinter  'Print to the Screen
          .Destination = crptToWindow    'Print to the window
       End If
       .Action = 1
    End With
    Exit Sub
    MsgBox "There was an error trying to print this report.", vbCritical, "CRYSTAL REPORT ERROR"
    MsgBox Err.Description
End Sub

Problem With Crystal Reports 8.5 Chart Reports
Hi All,

I had a problem with crystal reports 8.5 chart reports.
Iam using chart reports and included in the setup. The application shows all other reports except the chart reports.
Can anyone help me in solving this problem.
Are there any specific dlls to be included into the setup for crystal report chart graphs?

Thanls & Regards

Crystal Reports : Page Total In Sub-Reports
I have Main-Report like this
The columns 1-3 are Sub-Report(1), Column 4 is Sub-Report(2) and Column 5 is field of Main Report only.

Sl.No. Name Gross(Nov) Gross(Oct) Difference




.. ..... .... ....


Total C/F Rs. .......???........???........

I want the Difference Amount of Column(3) and Column(4)for every Record. How to achieve this?

At the same time I also want the Page Total of Column(3) and (4)at the page footer of Main Report(not the Grand Total).


Copyright 2005-08, All rights reserved