vb.net 编辑 .rpt 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15574397/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 12:55:49  来源:igfitidea点击:

Editing an .rpt file

vb.netvisual-studio-2010.net-4.0crystal-reports

提问by etm124

A company developed a small web interface written in VB.net to query a database and produce reports. The interface uses CrystalDecisions.Sharedlibrary. In the code, it references this:

一家公司开发了一个用 VB.net 编写的小型 Web 界面来查询数据库并生成报告。接口使用CrystalDecisions.Shared库。在代码中,它引用了这个:

 If rbExportType.SelectedValue = "PDF" Then
    Dim sda As New DB2DataAdapter(cmd)
    ReportName = "Reports/R002.rpt"
    rpt.Load(Server.MapPath(ReportName), CrystalDecisions.[Shared].OpenReportMethod.OpenReportByTempCopy)
    sda.Fill(ds.tbl_R002)
    rpt.SetDataSource(ds)
    rpt.SetParameterValue(0, ddDatabase.SelectedItem.Text)
    ExporttoPDF()
 Else

Now, the users have asked me to add a simple field to the report, Date. I've edited the query to pull this data, but when I run the report the Datefield is not shown on the report. I'm assuming that the actual .rpt file has to be edited to include this field on the report.

现在,用户要求我在报告中添加一个简单的字段Date. 我已编辑查询以提取此数据,但是当我运行报告时,该Date字段未显示在报告中。我假设必须编辑实际的 .rpt 文件才能在报告中包含此字段。

When trying to edit Reports/R002.rptin a text editor, there are just numbers/symbols.

尝试Reports/R002.rpt在文本编辑器中进行编辑时,只有数字/符号。

How can I edit this .rpt file? The version of Visual Studio 2010 has past it's trial.

如何编辑这个 .rpt 文件?Visual Studio 2010 的版本已经过试用期。

回答by Joel Coehoorn

Visual Studio has (or had) a Crystal Reports editor built in. I couldn't find it just now in my Visual Studio 2012 install, so it's possible they dropped it in favor of their own Reporting Services platform, but I might just have missed it. If you can't find the editor in your Visual Studio 2010 copy, try downloading an older version of Visual Studio.

Visual Studio 有(或有)一个内置的 Crystal Reports 编辑器。我刚才在我的 Visual Studio 2012 安装中找不到它,所以有可能他们放弃了它以支持他们自己的 Reporting Services 平台,但我可能只是错过了它。如果在 Visual Studio 2010 副本中找不到编辑器,请尝试下载旧版本的 Visual Studio。

Update:

更新:

A quick Google search indicates that it's simply distributed separately now.
Here's the VS2012 version: http://scn.sap.com/docs/DOC-35074
Here's the VS2010 version: http://scn.sap.com/docs/DOC-7824

快速谷歌搜索表明它现在只是单独分发。
这是VS2012版本:http://scn.sap.com/docs/DOC-35074
这是VS2010版本:http://scn.sap.com/docs/DOC-7824

回答by George

CrystalReports is a proprietary software and wouldn't be part of the default VS package.

CrystalReports 是一个专有软件,不会成为默认 VS 包的一部分。

And yes, in order to add a field to the report, you would have to edit the report itself. Its not that big of a deal, if you have a copy of the CrystalReport software.

是的,为了向报告添加字段,您必须编辑报告本身。如果您有 CrystalReport 软件的副本,这没什么大不了的。