This is the report that I want to export to pdf
Hi! How can I export this report to PDF without having to go to the report viewer window?
Here is my code. This basically brings me to the report viewer. What I want to do is when I click the export button, it directly downloads the report without going to the report viewer.
Sub DoRep()
Dim truck As String = lblFLPlate.Text
If String.IsNullOrEmpty(truck) Then truck = "-"
Dim db As New wsbl.smwsEntities
Dim rb As New Telerik.Reporting.ReportBook
Dim lstFL = (From p In db.FinalLoadings Where If(p.IsPrinted, False) = False And p.TruckNo = truck And p.FLType = "BST" Order By p.CreatedDate Descending Select p).ToList
For Each fl In lstFL
rb.Reports.Add(getReport(fl.FinalLoadingNumber))
Next
Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = rb
ReportViewer1.ReportSource = instanceReportSource
ShowReport()
For Each fl In lstFL
fl.IsPrinted = True
Next
db.SaveChanges()
End Sub