水晶报表图形化设计不能产生Where语句吗(我不是说关联)?
比如:
select * from Sysobjects where id = 1
再如:
我想实现参数,
比如(例子)
select * from Sysobjects where id = {?@ID}
可是怎么通不过呢?
正确的用法应该怎么样呢?
...全文
10312打赏收藏
水晶报表(Crystal Report)中带参数的
水晶报表图形化设计不能产生Where语句吗(我不是说关联)? 比如: select * from Sysobjects where id = 1 再如: 我想实现参数, 比如(例子) select * from Sysobjects where id = {?@ID} 可是怎么通不过呢? 正确的用法应该怎么样呢?
参数是你很多传进sql语句,然后得到数据后再打印出来,效果一样:
CrpRepairRpt crp = new CrpRepairRpt();
System.Data.DataSet dt = new System.Data.DataSet();
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("server=localhost;database =hos;uid=sa;pwd=");
conn.Open();
System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter("select * from temp where id='1'",conn);
//参数在上面的sql语句中下,如
da.Fill(dt,"temp");
crp.SetDataSource(dt);
this.crystalReportViewer1.ReportSource = crp;
private void btnCancel_Click(object sender, System.EventArgs e)
{
//Close Form
this.Close();
}
private void CreateImage()
{
//My original idea is to draw grid on panel.But ...
int iWidth = (iCols + 2) * iRectSize;
int iHeight = (iRows + 2) * iRectSize;
Graphics pGraphic = panel1.CreateGraphics();
memoryImage = new Bitmap(iWidth,iHeight,pGraphic);
DrawGrid(pGraphic);