高分求助!!C# 打印panel中的全部内容,panel有滚动条,panel中有一个DataGridView控件也有滚动条. 如题!最好是成熟可用代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void btnPrint_Click(object sender, EventArgs e) { btnPrint.Focus(); if (!ScreenCheck()) return; clsSale cs = new clsSale(); clsParameter cp = new clsParameter(); DataSet ds = new DataSet(); cs.itemcd = txtItemCD.Value; //cs.typecd = txtTypeCD.Value; cs.trade = cmbTradeMark.Value;//add by hu 20100720 商标 switch (ComLibrary.GetRadioButton(pnlList)) //add by hu 20100705 { case "0": //报价单打印 switch (ComLibrary.GetRadioButton(pnlPrintType)) { case "0": //进售价单打印 int rtn = 0; rtn = cp.GetdataDetail(1); if (rtn == ComConst.FAILED) { ComLibrary.getMsg(cp.sqlmsg, "E", "错误"); return; } if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印 { if (cp.num1 == 0) { ds = cs.GetDataList(10);//实际进价 } if (cp.num1 == 1) { ds = cs.GetDataList(12);//虚拟进价 } } if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印 { ds = cs.GetDataList(11); } try { if (ds.Tables[0].Rows.Count == 0) { lblMsg.Text = cm.GetMessage("E00009"); lblMsg.ForeColor = Color.Red; return; } //打印 this.Cursor = Cursors.WaitCursor; CsReport.CS038CLS report = new LMS.CsReport.CS038CLS(); report.Viewer = true; report.ZoomLevel = 100; report.FormWindowState = FormWindowState.Maximized; report.SetDataSource(ds.Tables[0]); report.Publish(); DataTable a = ds.Tables[0]; } catch (Exception ew) { ComLibrary.getMsg(ew.Message, "E", "错误"); } finally { this.Cursor = Cursors.Default; } break; case "1": //进价单打印 if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印 { ds = cs.GetDataList(12);//进价 } if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印 { ds = cs.GetDataList(11); } try { if (ds.Tables[0].Rows.Count == 0) { lblMsg.Text = cm.GetMessage("E00009"); lblMsg.ForeColor = Color.Red; return; } //打印 this.Cursor = Cursors.WaitCursor; CsReport.CS0381CLS report = new LMS.CsReport.CS0381CLS(); report.Viewer = true; report.ZoomLevel = 100; report.FormWindowState = FormWindowState.Maximized; report.SetDataSource(ds.Tables[0]); report.Publish(); } catch (Exception ew) { ComLibrary.getMsg(ew.Message, "E", "错误"); } finally { this.Cursor = Cursors.Default; } break; case "2": //售价单打印 if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印 { ds = cs.GetDataList(12);//售价 } if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印 { ds = cs.GetDataList(11); } try { if (ds.Tables[0].Rows.Count == 0) { lblMsg.Text = cm.GetMessage("E00009"); lblMsg.ForeColor = Color.Red; return; } //打印 this.Cursor = Cursors.WaitCursor; CsReport.CS0382CLS report = new LMS.CsReport.CS0382CLS(); report.Viewer = true; report.ZoomLevel = 100; report.FormWindowState = FormWindowState.Maximized; report.SetDataSource(ds.Tables[0]); report.Publish(); } catch (Exception ew) { ComLibrary.getMsg(ew.Message, "E", "错误"); } finally { this.Cursor = Cursors.Default; } break; case "3": //商品目录单打印 if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印 { ds = cs.GetDataList(16);//售价 } if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印 { ds = cs.GetDataList(11); } try { if (ds.Tables[0].Rows.Count == 0) { lblMsg.Text = cm.GetMessage("E00009"); lblMsg.ForeColor = Color.Red; return; } //打印 this.Cursor = Cursors.WaitCursor; CsReport.CS0383CLS report = new LMS.CsReport.CS0383CLS(); report.Viewer = true; report.ZoomLevel = 100; report.FormWindowState = FormWindowState.Maximized; report.SetDataSource(ds.Tables[0]); report.Publish(); } catch (Exception ew) { ComLibrary.getMsg(ew.Message, "E", "错误"); } finally { this.Cursor = Cursors.Default; } break; } break; } } 【算法】多线程发送数据,查找空闲的发送线程? 大区省市问题. c#怎么读写Excel文件? 怎么在C# 中用代码控制打开或者关闭浏览器的一个标签? 如何设置comboBox和数据源绑定后的默认值 C#中如何给状态栏组件上添加一个动态的时间? c#操作word问题 第一次写程序,验证登录出错,请大家帮我看看 动态计算列 c#中,怎么得到系统目录? 求助!directx,opengl高手请进 新手求教
private void btnPrint_Click(object sender, EventArgs e)
{
btnPrint.Focus();
if (!ScreenCheck()) return;
clsSale cs = new clsSale();
clsParameter cp = new clsParameter();
DataSet ds = new DataSet();
cs.itemcd = txtItemCD.Value;
//cs.typecd = txtTypeCD.Value;
cs.trade = cmbTradeMark.Value;//add by hu 20100720 商标 switch (ComLibrary.GetRadioButton(pnlList)) //add by hu 20100705
{
case "0": //报价单打印 switch (ComLibrary.GetRadioButton(pnlPrintType))
{
case "0": //进售价单打印
int rtn = 0;
rtn = cp.GetdataDetail(1);
if (rtn == ComConst.FAILED)
{
ComLibrary.getMsg(cp.sqlmsg, "E", "错误");
return;
}
if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印
{
if (cp.num1 == 0)
{
ds = cs.GetDataList(10);//实际进价
}
if (cp.num1 == 1)
{
ds = cs.GetDataList(12);//虚拟进价
}
}
if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印
{
ds = cs.GetDataList(11);
}
try
{
if (ds.Tables[0].Rows.Count == 0)
{
lblMsg.Text = cm.GetMessage("E00009");
lblMsg.ForeColor = Color.Red;
return;
}
//打印
this.Cursor = Cursors.WaitCursor;
CsReport.CS038CLS report = new LMS.CsReport.CS038CLS();
report.Viewer = true;
report.ZoomLevel = 100;
report.FormWindowState = FormWindowState.Maximized;
report.SetDataSource(ds.Tables[0]);
report.Publish();
DataTable a = ds.Tables[0];
}
catch (Exception ew)
{
ComLibrary.getMsg(ew.Message, "E", "错误");
}
finally
{
this.Cursor = Cursors.Default;
}
break;
case "1": //进价单打印 if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印
{
ds = cs.GetDataList(12);//进价
}
if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印
{
ds = cs.GetDataList(11);
}
try
{
if (ds.Tables[0].Rows.Count == 0)
{
lblMsg.Text = cm.GetMessage("E00009");
lblMsg.ForeColor = Color.Red;
return;
}
//打印
this.Cursor = Cursors.WaitCursor;
CsReport.CS0381CLS report = new LMS.CsReport.CS0381CLS();
report.Viewer = true;
report.ZoomLevel = 100;
report.FormWindowState = FormWindowState.Maximized;
report.SetDataSource(ds.Tables[0]);
report.Publish();
}
catch (Exception ew)
{
ComLibrary.getMsg(ew.Message, "E", "错误");
}
finally
{
this.Cursor = Cursors.Default;
}
break;
case "2": //售价单打印 if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印
{
ds = cs.GetDataList(12);//售价
}
if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印
{
ds = cs.GetDataList(11);
}
try
{
if (ds.Tables[0].Rows.Count == 0)
{
lblMsg.Text = cm.GetMessage("E00009");
lblMsg.ForeColor = Color.Red;
return;
}
//打印
this.Cursor = Cursors.WaitCursor;
CsReport.CS0382CLS report = new LMS.CsReport.CS0382CLS();
report.Viewer = true;
report.ZoomLevel = 100;
report.FormWindowState = FormWindowState.Maximized;
report.SetDataSource(ds.Tables[0]);
report.Publish();
}
catch (Exception ew)
{
ComLibrary.getMsg(ew.Message, "E", "错误");
}
finally
{
this.Cursor = Cursors.Default;
}
break;
case "3": //商品目录单打印 if (ComLibrary.GetRadioButton(pnlType) == "0") //单品打印
{
ds = cs.GetDataList(16);//售价
}
if (ComLibrary.GetRadioButton(pnlType) == "1") //套餐打印
{
ds = cs.GetDataList(11);
}
try
{
if (ds.Tables[0].Rows.Count == 0)
{
lblMsg.Text = cm.GetMessage("E00009");
lblMsg.ForeColor = Color.Red;
return;
}
//打印
this.Cursor = Cursors.WaitCursor;
CsReport.CS0383CLS report = new LMS.CsReport.CS0383CLS();
report.Viewer = true;
report.ZoomLevel = 100;
report.FormWindowState = FormWindowState.Maximized;
report.SetDataSource(ds.Tables[0]);
report.Publish();
}
catch (Exception ew)
{
ComLibrary.getMsg(ew.Message, "E", "错误");
}
finally
{
this.Cursor = Cursors.Default;
} break;
}
break;
}
}