asp.net Web应用程序的水晶报表 [英] crystal reports for asp.net web application

查看:73
本文介绍了asp.net Web应用程序的水晶报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为asp.net Web应用程序尝试Crystal Reports.

我已经使用Windows应用程序完成了此操作,但是对于Web应用程序,我不知道如何使用命名和引用.
我无法从系统获取参考.我确实有一个疑问,例如是否只有添加一些dll才能在Web应用程序中执行Crystal Reports?
是否需要vs2010在Web应用程序中添加Crystal Reports?
所以我很困惑,没有任何想法.

如果可能,请尝试给我一些示例代码,并提供清晰的说明.

我尝试了Google搜索,但不足以找到答案

谢谢
问候
velu

I would like to try Crystal Reports for asp.net web applications.

I have done it with Windows application, but for Web application i don''t know how to use naming and reference.
I am not able to get reference from system. I do have question like whether we will be able to do Crystal Reports in Web application only if we add some dll or not?
Whether we need to have vs2010 for adding Crystal Reports in web application?
So I am confused, not getting any idea.

If possible please try to give me some sample code with clear explanations.

I tried Googling, but its not enough to find an answers

Thanks
Regards
velu

推荐答案

此代码在我的Web应用程序中正常运行.
This code is working in my web application try it.
rpt = new ReportDocument();
CrystalReportViewer1.Enabled = true;
string str = "rptInvoiceDetails.rpt";
rpt.Load(Server.MapPath(str));

DataTable dt = new DataTable();
string strConn = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection MyCon = new SqlConnection(strConn);
SqlDataAdapter adp = new SqlDataAdapter("ProcedureName", MyCon);

adp.SelectCommand.CommandType = CommandType.StoredProcedure;
adp.SelectCommand.Parameters.Add("@Param1", SqlDbType.Int).Value = ParamValue1;
adp.SelectCommand.Parameters.Add("@Param2", SqlDbType.Int).Value = ParamValue2;
adp.SelectCommand.Parameters.Add("@Param3", SqlDbType.Int).Value = ParamValue3;
adp.SelectCommand.Parameters.Add("@Param4", SqlDbType.Date).Value = ParamValue4;
adp.Fill(dt);

rpt.SetDatabaseLogon(SqlUser, SqlPassword, SqlServer, SqlDatabase);
rpt.SetDataSource(dt);
CrystalReportViewer1.ReportSource = rpt;
CrystalReportViewer1.Visible = true;


^ ]


对于Web应用程序,只需阅读tarun发布的帖子,请参阅此-

在Visual Studio 2010中使用Crystal Reports生成报告 [ ^ ]

从根本上讲,您需要具有类型化数据集",报表查看器"和报表"文档才能显示报表...
请参阅上面的文档,它肯定会有所帮助,

最好的:-)
For Web Applications just go through the post posted by tarun, Refer this-

Generate a Report using Crystal Reports in Visual Studio 2010[^]

At the basic,you need to have Typed Dataset, A Report Viewer, Report document to display the Report...
Refer the above document, It will surely Help,

All the Best:-)


这篇关于asp.net Web应用程序的水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆