水晶报表绑定 [英] crystal report binding

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

问题描述

在水晶报表绑定中,我编写了代码:

In crystal report binding I wrote code:

SqlDataAdapter da = new SqlDataAdapter("select * from customer where strdate BETWEEN ''" + txtfrom.Text + "'' AND  ''"+txtto.Text +"''",  (SqlConnection)Application.Get("IS"));
DataSet ds = new DataSet();
da.Fill(ds);
string strReportPath;        
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("vendorreport.rpt"));       
CrystalReportViewer1.ReportSource = crystalReport;


crystalReport.Load(Server.MapPath("vendorreport.rpt"));显示错误:加载报告失败


crystalReport.Load(Server.MapPath("vendorreport.rpt")); is showing error: Load report failed

Can anybody please help me?

推荐答案

看看这些文章:
在ASP.NET 2.0中为Crystal Reports创建动态数据集 [愚蠢的Crystal Reports指南,第二部分-Web Apps [
Look at these articles:
Creating Dynamic DataSets for Crystal Reports in ASP.NET 2.0[^]
Idiot''s Guide to Crystal Reports, Part II - Web Apps[^]


下面的文章展示了如何可以将Crystal报表绑定到数据集.这是Windows应用程序文章,它仍然可以帮助您比较步骤.

使用带有数据集的C#创建Crystal报表 [
This article below shows how crystal report binding can be done to a dataset.This is a windows application article,still it may help you to compare your steps.

Creating Crystal Reports using C# with Datasets[^]


您是否检查了水晶报表所在的路径..可能是路径不正确..
如果报告位于根文件夹中,请使用以下代码
crystalReport.Load(Server.MapPath("~/vendorreport.rpt"));
Have you checked the path in which your crystal report is there..may be path is not correct..
if report is in root folder use following code
crystalReport.Load(Server.MapPath("~/vendorreport.rpt"));


这篇关于水晶报表绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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