0

我希望用户可以在运行时自由更改水晶报表的布局......但是因为我没有得到任何解决方案。我想将水晶报表放在 exe 文件之外,以便用户可以打开水晶报表并对其进行编辑..但是如何在 exe 之外访问水晶报表。

我使用带有类型数据集的水晶报表。在 Windows 应用程序 vb.net 2008 和 mssql 2005 中

     Dim sql1 As String = "select company_name,pobox,city,address,telephone,fax,website,email,logo,sign,supplier_name,date,created_by,request_id,request_no from company,request where request_id ='" + txtRequestId.Text + "'"
        Dim sql2 As String = "select no,item_name,group_name,description,qty,request_id from request_item where request_id ='" + txtRequestId.Text + "'"

        Dim dbConn As SqlConnection = cl.sqlConn()
        Dim da As New SqlDataAdapter()
        Dim ds As New dsRequest()

        da = New SqlDataAdapter(sql1, dbConn)
         da.Fill(ds, "details")

        da = New SqlDataAdapter(sql2, dbConn)
        da.Fill(ds, "items")

        Dim oRpt As New rptRequest
        oRpt.SetDataSource(ds)

我之前可以使用 rptRequest,因为之前它在项目内部,但现在我将它放在外部......所以如何访问 rptRequest.rpt。请帮助,因为 Idnt 对 rptRequest 了解很多。如果有人知道用于 cyrstal 报告或任何其他报告的运行时布局设计器,请告诉我。我也准备付钱了。请帮忙。

4

1 回答 1

0

我不认识您上面使用的方法,但我会使用以下方法来加载报告:

Dim reportPath as String = "C:\Report.rpt"
Dim ReportDoc As ReportDocument = new ReportDocument()
ReportDoc.Load(reportPath)
于 2013-05-13T13:28:16.657 回答