hi, based on the data displayed in the crystal report...
i wanted to automatically make it as pdf report..
codes below is work perfectly.. how could i create a .pdf report when i click create pdf button and save it to c: drive how to do..?
here is my codes:
Please help...Code:Private Sub ConnectionPrint() If cnReport.State = ConnectionState.Closed Then cnReport = New OleDbConnection cnReport.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Data\RSODB.mdb;User Id=admin;Password=;" cnReport.Open() End If End Sub Private Sub GetRecords() '(ByVal myRSONOfilter As String) myRSONOfilterReport = Me.TextBox1.Text dsReport.Clear() dsReport = New DataSet daReport = New OleDbDataAdapter("Select * from FinalReportV2 where RSONO=" & myRSONOfilterReport & "", cnReport) daReport.Fill(dsReport, "FinalReportV2") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Priview.Click ConnectionPrint() GetRecords() ' Fill the DataSet. daReport.Fill(dsReport) ' Make a report and bind the DataSet to it. Dim rpt As New CrystalFinalOff rpt.SetDataSource(dsReport) ' Bind the viewer to the report. CrystalReportViewer1.ReportSource = rpt 'CrystalReportViewer1.PrintReport() End Sub




Reply With Quote