如何将asp.net页面的值显示到Crystal Report页面中.

问题描述:

尊敬的先生,

如何将asp.net页的值显示到水晶报表页中.
带有整洁的示例.
通过mohan

dear sir,

how to display asp.net page value into crystal report page.
with neat example.
by mohan

尝试一下.

使用其功能组,图形,交叉表和子报表逐步创建Crystal报表 [ ^ ]
Try this.

Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report[^]


首先在报告中添加一个参数.
并将其拖动以进行报告.

如果您使用的是报表的另一页,则使用查询字符串发送页面值.

将查询字符串放在表单上并将其存储在变量中,例如

First add one parameter in your report.
and drag it to report.

if you are using another page of report then send the page value using query string.

get that query string on form to and store it in variable like

string TYP = Request.QueryString["TYP"];



然后将值传递给这样的参数



and then pass value to parameter like this

crystalReport.SetDataSource(dt);
                 crystalReport.SetParameterValue("TYPE", TYPE);
                CrystalReportViewer1.ReportSource = crystalReport;



crystalReport是ReportDocument的对象.
TYPE是在报表上声明的参数的名称.


我希望你明白了.



crystalReport is an object of ReportDocument.
TYPE is name of parameter declare on report.


I hope you got it.