尝试在Crystal查看器中调用报表时出错

时间:2015-07-01 18:27:40

标签: vb.net crystal-reports

尝试从VB中的另一个表单在Crystal查看器中调用此报表时,我一直遇到阻塞错误。有人可以帮忙吗?

 Private Sub Command1_Click()
     Dim crlApp As New CRAXDRT.Application
     Dim crlRep As CRAXDRT.Report

     Set crlRep = crlApp.OpenReport("E:\Finesse\vbDev\rpts\peemptime.rpt")
     Set Form1.CRViewer.ReportSource = cr1Rep
     Form1.CRViewer.ViewReport
     Form1.Show
 End Sub

1 个答案:

答案 0 :(得分:0)

    crlApp = New ReportDocument
    crlApp.Load(Server.MapPath("E:\Finesse\vbDev\rpts\peemptime.rpt"))
    crlApp.SetDataSource (Your Data Source)
    CRViewer.ReportSource = crlApp 
    crlApp.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "ExportedReport")

    OR
    crlApp.ExportToHttpResponse(ExportFormatType.WordForWindows, Response, True, "ExportedReport")
    OR
    crlApp.ExportToHttpResponse(ExportFormatType.Excel, Response, True, "ExportedReport")