问题描述
亲爱的所有人,
现在正在使用C#Windows应用程序.我这里有一个组合框和
我表单中的一个按钮.在我的组合框中有3个项Table1,Table2,Table3.在我的
数据库有一张表ALLTABLE(该表的列是
TableName,CustomerName,Datetime),将所有3个表数据保存在ALLTABLE中.现在我
想仅从ALLTABLE获取Table2报告.所以我在组合框选择Table2,然后
按下按钮.这是我的问题吗?我做了整个桌子的报告,但这是我的
这种类型的问题的经验.欢迎所有答复.
谢谢与问候
Dhinesh Kumar.V
Dear All,
Now am working at c# windows application. Here i have one combobox and
one button in my form. In my combobox have 3 items Table1,Table2,Table3. In my
database have one table ALLTABLE(column of this table is
TableName,CustomerName,Datetime), am save all the 3 tables data at ALLTABLE. Now i
wanna to get Table2 report only from ALLTABLE . So i select Table2 at combobox and
press button. is this my problem. Am did report for whole table but this is my
experience for this type of problem. All replies are welcome.
Thanks & Regards
Dhinesh Kumar.V
推荐答案
private void frm_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Your Connection String Here";
con.Open();
SqlDataAdapter da3 = new SqlDataAdapter("Select * from ALLTABLE where TableName='"+combobox1.Text+"'", con);
DataSet ds3 = new DataSet();
da3.Fill(ds3, "TableName");
CrystalReportName abc = new CrystalReportName();
abc.SetDataSource(ds3.Tables[0]);
crystalReportViewer1.ReportSource = abc;
crystalReportViewer1.Refresh();
con.Close();
}
任何问题都退回
any problem revert back
这篇关于根据给定的细节生成水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!