本文介绍了导出Crystal报表帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

私有子项BuildReport(ByVal报告为字符串,ByVal ReportDate为字符串,ByVal ConnectionMode为字符串) 尝试 选择病例报告 案例"Bessemer_Scale_Report" '报告 将reportDocument调暗为新的ReportDocument() 将Dim paramField设置为新的ParameterField() 将Dim paramFields设置为新的ParameterFields() 将Dim paramValue设置为新的ParameterDiscreteValue() 昏暗的TestReport为字符串= System.Configuration.ConfigurationManager.ConnectionStrings("BES_Scale_Report_Test").ConnectionString Dim ProdReport As String = System.Configuration.ConfigurationManager.ConnectionStrings("BES_Scale_Report_Prod").ConnectionString Dim reportPath As String = Server.MapPath(CStr(IIf(ConnectionMode ="Test"",TestReport,ProdReport))) 昏暗的dt作为数据表= GetBesReceiptReport(ReportDate) 将BES_Scale_DataSet设置为新的DataSet() Dim Database As String ="ScalePushDB"; Dim PDfPath As String ="c:\ Bessemer SAP Report \" 如果(Not System.IO.Directory.Exists(PDfPath)) System.IO.Directory.CreateDirectory(PDfPath) 万一 BES_Scale_DataSet.Tables.Add(dt) paramField.Name ="@Date"; paramValue.Value = ReportDate paramField.CurrentValues.Add(paramValue) paramFields.Add(paramField) paramFields.Add(paramField) crvReportViewer.ParameterFieldInfo = paramFields reportDocument.Load(reportPath) 'reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat,"c:\ Bessemer SAP Report \ report.pdf") reportDocument.SetDataSource(BES_Scale_DataSet) reportDocument.SetDatabaseLogon(用户,密码,服务器名称,数据库) crvReportViewer.ReportSource = reportDocument ''Dim s为System.IO.MemoryStream = reportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat,"c:\ Bessemer SAP Report \ report.pdf") reportDocument.Close() 结束选择 异常捕获 MsgBox("BuildReport Failed!") 结束尝试 结束Sub

Private Sub BuildReport(ByVal Report As String, ByVal ReportDate As String, ByVal ConnectionMode As String) Try Select Case Report Case "Bessemer_Scale_Report" 'Report Dim reportDocument As New ReportDocument() Dim paramField As New ParameterField() Dim paramFields As New ParameterFields() Dim paramValue As New ParameterDiscreteValue() Dim TestReport As String = System.Configuration.ConfigurationManager.ConnectionStrings("BES_Scale_Report_Test").ConnectionString Dim ProdReport As String = System.Configuration.ConfigurationManager.ConnectionStrings("BES_Scale_Report_Prod").ConnectionString Dim reportPath As String = Server.MapPath(CStr(IIf(ConnectionMode = "Test", TestReport, ProdReport))) Dim dt As DataTable = GetBesReceiptReport(ReportDate) Dim BES_Scale_DataSet As New DataSet() Dim Database As String = "ScalePushDB" Dim PDfPath As String = "c:\Bessemer SAP Report\" If (Not System.IO.Directory.Exists(PDfPath)) Then System.IO.Directory.CreateDirectory(PDfPath) End If BES_Scale_DataSet.Tables.Add(dt) paramField.Name = "@Date" paramValue.Value = ReportDate paramField.CurrentValues.Add(paramValue) paramFields.Add(paramField) paramFields.Add(paramField) crvReportViewer.ParameterFieldInfo = paramFields reportDocument.Load(reportPath) ' reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "c:\Bessemer SAP Report\report.pdf") reportDocument.SetDataSource(BES_Scale_DataSet) reportDocument.SetDatabaseLogon(User, Password, ServerName, Database) crvReportViewer.ReportSource = reportDocument ''Dim s As System.IO.MemoryStream = reportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "c:\Bessemer SAP Report\report.pdf") reportDocument.Close() End Select Catch ex As Exception MsgBox("BuildReport Failed!") End Try End Sub



我收到一条错误消息,缺少参数值.



I'm getting an error message Missing parameter values.

推荐答案

SAP拥有自己的Crystal Reports社区网络.通常,如果将Crystal Reports与Visual Studio一起使用,则需要提供问题帖中使用的Visual Studio版本和年份以及Crystal Reports的年份(可能是版本)(或 他们发布问题),以便偷窥可以帮助您.

SAP has their own community networks for Crystal Reports. Typically if using Crystal Reports with Visual Studio you would need to provide which Visual Studio edition and year and probably version of Crystal Reports being used within a question post (or however they post questions) so peeps can assist you.

您可以尝试SAP Crystal Reports,适用于Visual Studio的版本,在这种情况下,您需要加入我认为需要帮助的社区.

You could try SAP Crystal Reports, version for Visual Studio in which case you would need to join the community I think for asking for help.


这篇关于导出Crystal报表帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 11:41