Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing separate .rpt-files in VB.NET

Status
Not open for further replies.

Flupke

Programmer
Jun 26, 2002
94
BE
Hello everyone,

I am working with Crystal Reports v10 and Visual Basic.NET 2003.

I do not use the integrated Crystal Report from .NET, but a separated installed Crystal reports version 10.

I would like to call reports from my application. I work with separate .rpt files. The reports are not integrated in my application.
My database is Microsoft Access and I would like to show my reports in a Windows form on which I have put a crViewer.
My reports are created using OleDB (ADO) Microsoft Jet 4.0 OLE DB Provider.

Can someone direct me to how to set up code to show the reports. Or are there any links where I can find sample code to do this?

Many thanks and greetings from Brugge (Bruges - Belgium),

Michel
 
All of the examples shown in those files are CrystalReports integrated in the .NET solution. I want to access seperate reports, created by Crystal reports v 10 and not by the build-in Crystal Report generator of Visual Studio .NET.

Greetings from Brugge (Bruges - Belgium),

Michel
 
You mean you want to load the reports at runtime?. I have all my Crystal reports as external files, none of which are embedded in the application. The .NET code to load a report is as follows.

Code:
Public Sub zLoadReport(ByVal sReporttoLoad As String)

Dim bLoad As Boolean = True
Dim s As String = sReporttoLoad
If Not s.EndsWith(".rpt") Then s += ".rpt"

If File.Exists(s) Then
Try
    Me.oReport = New ReportDocument
    Me.oReport.Load(s, OpenReportMethod.OpenReportByTempCopy)
Catch ex As Exception
    bLoad = False
   MsgBox(sReporttoLoad + " Report cannot be Found", MsgBoxStyle.OKOnly, "Error")
End Try

End Sub



Sweep
...if it works dont mess with it
 
When I try to use your code, I get the followng errors:

File.Exists: Name 'File' is not declared

Me.oReport: oReport is not a member of Dienstrooster.frmRapport

New Reportdocument: Reportdocument is not defined

OpenReportMethod: name 'OpenReportMethod' is not declared

So I guess: before using your code, there are a whole set of declarations that must be done. Can you please enlighten me on that.

Many thanks and greetings from Brugge (Bruges - Belgium),

Michel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top