Hi smile,
Refer below code.
You have to chnage the location of crystal report in Process.Start(@"CrystalReport.exe") in place of CrystalReport.exe you need to give full file location of crystal report.
Namespaces
C#
using CrystalDecisions.CrystalReports.Engine;
using System.Diagnostics;
using System.IO;
VB.Net
Imports System.IO
Imports CrystalDecisions.CrystalReports.Engine
Code
C#
private void OpenCrystalReport(object sender, EventArgs e)
{
Process.Start(@"CrystalReport.exe");
Process notePad = new Process();
notePad.StartInfo.FileName = "crw32.exe";
ReportDocument cryRpt = new ReportDocument();
string reportPath = Path.GetDirectoryName(Application.ExecutablePath);
string reportFullPath = Path.Combine(reportPath, "CrystalReport1.rpt");
notePad.StartInfo.Arguments = reportFullPath;
notePad.Start();
}
VB.Net
Private Sub OpenCrystalReport(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Process.Start("CrystalReport.exe")
Dim notePad As Process = New Process()
notePad.StartInfo.FileName = "crw32.exe"
Dim cryRpt As ReportDocument = New ReportDocument()
Dim reportPath As String = Path.GetDirectoryName(Application.ExecutablePath)
Dim reportFullPath As String = Path.Combine(reportPath, "CrystalReport1.rpt")
notePad.StartInfo.Arguments = reportFullPath
notePad.Start()
End Sub