I am new to visual basic 2008. In the past I have used vb6 to display an existing crystal report. I would like to accomplish the same with vb.net. However I am not clear on the syntax to display a crystal report using the crystal report viewer or crystal report document. Here is my code from vb6
And i know we can accomplish it with using Crystal report viewer.the example code is below
my question is is there any way we can display the report in vb 2008 with out the use of Crystal report viewer.
If anyone find any idea please replay it..
thanks in advance.
Firoz.
Code:
Private Sub Form_Load() CrystalReport1.Connect = "DSN=perfection;UID=crystal;PWD=crystal" CrystalReport1.ReportFileName = "e:\Nittany Work Tickets\Nittany Work Tickets.rpt" CrystalReport1.Destination = crptToWindow CrystalReport1.WindowState = crptMaximized CrystalReport1.Action = 1 End Sub Private Sub Form_Unload(Cancel As Integer) Set frm = Nothing End Sub
Code:
Public Class Form1 Dim cryRpt As New ReportDocument Dim pdfFile As String = "c:\ProductReport1.pdf" Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt") CrystalReportViewer1.ReportSource = cryRpt CrystalReportViewer1.Refresh() End Sub
If anyone find any idea please replay it..
thanks in advance.
Firoz.
Comment