C#水晶报表

bsetsail 2009-04-20 02:21:19
VS2008
谁能给一个C#写的winform水晶报表例子学习一下,可以运行的
网上的看了都不知所云,根据他们的步骤创建下去就没有可以运行的,
谢谢了
...全文
174 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
whyabc 2009-04-20
  • 打赏
  • 举报
回复
用过,不过都忘了,不是很难的,看看msdn帮助
wujinjian2008n 2009-04-20
  • 打赏
  • 举报
回复
没用过 学习
justin麒麟 2009-04-20
  • 打赏
  • 举报
回复
这个你光看代码没用,起码也给有个图什么的才行
itcrazyman 2009-04-20
  • 打赏
  • 举报
回复
mark up 帮顶
blestcc 2009-04-20
  • 打赏
  • 举报
回复
手上沒這東西,雖然我們現在的系統也是用水晶報表,但覺得這玩意兒不好用。
  • 打赏
  • 举报
回复
我这边 有2005的案例 我用数据库专家选择的是.NET对象

//导入命名空间
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
//写在Page_Load之前的一个方法
protected void page_Init(object sender, EventArgs e)
{
DataSet ds = Cum.GetData();

ArrayList al = new ArrayList();
for (int i = 0; i < ds.Tables["cum"].Rows.Count; i++)
{
Cum cum = new Cum();
cum.CustomerID = ds.Tables["cum"].Rows[i]["CustomerID"].ToString();
cum.CompanyName = ds.Tables["cum"].Rows[i]["CompanyName"].ToString();
cum.Address = ds.Tables["cum"].Rows[i]["Address"].ToString();
al.Add(cum);
}
string path = Server.MapPath("CrystalReport.rpt");
ReportDocument rd = new ReportDocument();
rd.Load(path);
rd.SetDataSource(al);

this.CrystalReportViewer1.ReportSource = rd;
}
/// <summary>
/// Cum 类
/// </summary>
public class Cum
{
public Cum()
{
}
private string _CustomerID;

public string CustomerID
{
get { return _CustomerID; }
set { _CustomerID = value; }
}
private string _CompanyName;
public string CompanyName
{
get { return _CompanyName; }
set { _CompanyName = value; }
}
private string _Address;
public string Address
{
get { return _Address; }
set { _Address = value; }
}


public static DataSet GetData()
{
SqlConnection conn = new SqlConnection("server=.;database=northwind;uid=sa;pwd=;");
SqlDataAdapter sda = new SqlDataAdapter("select CustomerID,CompanyName,Address from Customers",conn);
DataSet ds = new DataSet();
sda.Fill(ds,"cum");
return ds;
}

}
bsetsail 2009-04-20
  • 打赏
  • 举报
回复
我怎么连ReportSource 属性都找不到
还有oRpt.SetDataSource(dt)的时候提示“报表没有资料表”

110,532

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧