首页 开发技术 C#     /    C#万能打印--winform中打印dataGridView表格

C#万能打印--winform中打印dataGridView表格

上传者: zjlovety | 上传时间:2022/9/3 1:56:26 | 文件大小:149KB | 文件类型:rar
C#万能打印--winform中打印dataGridView表格
1.vs2008,在处理方案中添加现有项目DLLFullPrint,然后在主工程中添加引用,引用这个项目。
2.在界面设计中,添加按钮PrintButton,双击它进入代码界面;
在代码文件中,首先使用usingDLLFullPrint;然后按钮点击事件中写入以下代码:privatevoidprintButton_Click(objectsender,EventArgse){System.Data.DataTabledt=newSystem.Data.DataTable();DataRowdr;//设置列表头foreach(DataGridViewColumnheaderCellindataGridView1.Columns){dt.Columns.Add(headerCell.HeaderText);}foreach(DataGridViewRowitemindataGridView1.Rows){dr=dt.NewRow();for(inti=0;i<dt.Columns.Count;i++){dr[i]=item.Cells[i].Value.ToString();}dt.Rows.Add(dr);}DataSetdy=newDataSet();dy.Tables.Add(dt);MyDLL.TakeOver(dy);}3.运行程序,点击打印按钮,弹出打印界面,调节界面,打印预览,需安装打印机。
本软件ID:6440135

文件下载

资源详情

[{"title":"(60个子文件149KB)C#万能打印--winform中打印dataGridView表格","children":[{"title":"DLLFullPrint","children":[{"title":"DLLFullPrint.sln <span style='color:#111;'>925B</span>","children":null,"spread":false},{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":true},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>338B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>548B</span>","children":null,"spread":false},{"title":"prop-base","children":[{"title":"DLLFullPrint.suo.svn-base <span style='color:#111;'>53B</span>","children":null,"spread":false}],"spread":true},{"title":"text-base","children":[{"title":"DLLFullPrint.suo.svn-base <span style='color:#111;'>15.00KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.sln.svn-base <span style='color:#111;'>925B</span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"DLLFullPrint","children":[{"title":"DLLFullPrint.csproj <span style='color:#111;'>2.65KB</span>","children":null,"spread":false},{"title":"Frm_PrintSet.cs <span style='color:#111;'>17.33KB</span>","children":null,"spread":false},{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":true},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>925B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>1.16KB</span>","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":[{"title":"DLLFullPrint.csproj.svn-base <span style='color:#111;'>2.65KB</span>","children":null,"spread":false},{"title":"Frm_PrintSet.cs.svn-base <span style='color:#111;'>17.33KB</span>","children":null,"spread":false},{"title":"MyDLL.cs.svn-base <span style='color:#111;'>997B</span>","children":null,"spread":false},{"title":"PrintClass.cs.svn-base <span style='color:#111;'>22.79KB</span>","children":null,"spread":false},{"title":"Frm_PrintSet.Designer.cs.svn-base <span style='color:#111;'>37.92KB</span>","children":null,"spread":false},{"title":"Frm_PrintSet.resx.svn-base <span style='color:#111;'>6.07KB</span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Frm_PrintSet.Designer.cs <span style='color:#111;'>37.92KB</span>","children":null,"spread":false},{"title":"Properties","children":[{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":true},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>260B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>390B</span>","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":[{"title":"AssemblyInfo.cs.svn-base <span style='color:#111;'>1.29KB</span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"AssemblyInfo.cs <span style='color:#111;'>1.29KB</span>","children":null,"spread":false}],"spread":true},{"title":"Frm_PrintSet.resx <span style='color:#111;'>6.07KB</span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Debug","children":[{"title":"DLLFullPrint.Frm_PrintSet.resources <span style='color:#111;'>180B</span>","children":null,"spread":false},{"title":"Refactor","children":[{"title":"DLLFullPrint.dll <span style='color:#111;'>8.50KB</span>","children":null,"spread":false}],"spread":true},{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":false},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>989B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>1.10KB</span>","children":null,"spread":false},{"title":"prop-base","children":[{"title":"DLLFullPrint.pdb.svn-base <span style='color:#111;'>53B</span>","children":null,"spread":false},{"title":"DLLFullPrint.dll.svn-base <span style='color:#111;'>53B</span>","children":null,"spread":false},{"title":"DLLFullPrint.Frm_PrintSet.resources.svn-base <span style='color:#111;'>53B</span>","children":null,"spread":false},{"title":"DLLFullPrint.csproj.GenerateResource.Cache.svn-base <span style='color:#111;'>53B</span>","children":null,"spread":false}],"spread":false},{"title":"text-base","children":[{"title":"DLLFullPrint.pdb.svn-base <span style='color:#111;'>49.50KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.dll.svn-base <span style='color:#111;'>32.00KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.csproj.FileListAbsolute.txt.svn-base <span style='color:#111;'>3.73KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.Frm_PrintSet.resources.svn-base <span style='color:#111;'>180B</span>","children":null,"spread":false},{"title":"DLLFullPrint.csproj.GenerateResource.Cache.svn-base <span style='color:#111;'>781B</span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"DLLFullPrint.csproj.FileListAbsolute.txt <span style='color:#111;'>9.70KB</span>","children":null,"spread":false},{"title":"TempPE","children":[{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":false},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>120B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>244B</span>","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"DLLFullPrint.pdb <span style='color:#111;'>47.50KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.dll <span style='color:#111;'>32.00KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.csproj.GenerateResource.Cache <span style='color:#111;'>781B</span>","children":null,"spread":false}],"spread":true},{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":true},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>470B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>588B</span>","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":[{"title":"DLLFullPrint.csproj.FileList.txt.svn-base <span style='color:#111;'>255B</span>","children":null,"spread":false},{"title":"DLLFullPrint.csproj.FileListAbsolute.txt.svn-base <span style='color:#111;'>2.97KB</span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"DLLFullPrint.csproj.FileListAbsolute.txt <span style='color:#111;'>2.97KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.csproj.FileList.txt <span style='color:#111;'>255B</span>","children":null,"spread":false}],"spread":true},{"title":"PrintClass.cs <span style='color:#111;'>22.79KB</span>","children":null,"spread":false},{"title":"bin","children":[{"title":"Debug","children":[{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":false},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>407B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>567B</span>","children":null,"spread":false},{"title":"prop-base","children":[{"title":"DLLFullPrint.pdb.svn-base <span style='color:#111;'>53B</span>","children":null,"spread":false},{"title":"DLLFullPrint.dll.svn-base <span style='color:#111;'>53B</span>","children":null,"spread":false}],"spread":false},{"title":"text-base","children":[{"title":"DLLFullPrint.pdb.svn-base <span style='color:#111;'>49.50KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.dll.svn-base <span style='color:#111;'>32.00KB</span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"DLLFullPrint.pdb <span style='color:#111;'>47.50KB</span>","children":null,"spread":false},{"title":"DLLFullPrint.dll <span style='color:#111;'>32.00KB</span>","children":null,"spread":false}],"spread":true},{"title":".svn","children":[{"title":"tmp","children":[{"title":"props","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":false},{"title":"props","children":null,"spread":false},{"title":"all-wcprops <span style='color:#111;'>107B</span>","children":null,"spread":false},{"title":"entries <span style='color:#111;'>243B</span>","children":null,"spread":false},{"title":"prop-base","children":null,"spread":false},{"title":"text-base","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"MyDLL.cs <span style='color:#111;'>997B</span>","children":null,"spread":false}],"spread":true},{"title":"DLLFullPrint.suo <span style='color:#111;'>15.00KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • allenyushuo:
    不能自定义建议还是使用第三方的例如grid++2017-11-27
  • never222:
    不能自定义建议还是使用第三方的例如grid++2017-11-27
  • a229013811:
    还可以吧,但是不能排版啊2017-11-01
  • a229013811:
    还可以吧,但是不能排版啊2017-11-01
  • go2sleep:
    什么东西啊,骗分的吧2017-07-14
  • go2sleep:
    什么东西啊,骗分的吧2017-07-14
  • l_u__:
    不错,功能可以2017-06-02
  • 昨夜冷风依旧:
    不错,功能可以2017-06-02
  • wpf520hq:
    不错,自定义内容和排版不知道能不能实现2017-03-22
  • wpf520hq:
    不错,自定义内容和排版不知道能不能实现2017-03-22

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明