【发布时间】:2017-05-05 04:27:15
【问题描述】:
This is the report that I want to export to pdf
嗨!如何在不必转到报表查看器窗口的情况下将此报表导出为 PDF?
这是我的代码。这基本上把我带到了报告查看器。我想要做的是当我点击导出按钮时,它直接下载报表而不去报表查看器。
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
【问题讨论】:
标签: vb.net pdf webforms report reportviewer