"提示", MessageBoxButtons.OK, MessageBoxIcon.Information); 6 return; 7 } 8 9 if (this.printForm... == null) 10 this.printForm = new RDLViewDialog(); 11 12 // 13 System.IO.TextReader textReader...Application.StartupPath, "Reports\\商品字典.rdl"); 17 textReader = new System.IO.StreamReader(fileName); 18 this.printForm.SourceRdl...= null) 23 textReader.Close(); 24 } 25 26 this.printForm.DataObject = this.lvInfo.Tag...; 27 this.printForm.PrintPreview(); 28 } 编译运行程序,看看效果: ?
MessageBoxButtons.OK, MessageBoxIcon.Information); 23: return; 24: } 25: 26: if (this.printForm...== null) 27: this.printForm = new PrintViewDialog(); 28: 29: // 30: System.IO.TextReader...Reports\\商品字典.rdl"); 34: textReader = new System.IO.StreamReader(fileName); 35: this.printForm.SourceRdl...= null) 40: textReader.Close(); 41: } 42: 43: this.printForm.DataObject = dictList...; 44: this.printForm.PrintPreview(); 45: } 46: 接下来看看编辑处理代码: 1: private void dataGridView1
", MessageBoxButtons.OK, MessageBoxIcon.Information); 9 return; 10 } 11 12 if (this.printForm... == null) 13 this.printForm = new RDLViewDialog(); 14 15 // 16 System.IO.TextReader textReader...= null) 26 textReader.Close(); 27 } 28 29 this.printForm.DataObject... = productInList; 30 31 if (this.cbPrinter.Checked) 32 this.printForm.Print(); //直接打印 33 else 34...this.printForm.PrintPreview(); //打印预览 35 } 现在,商品入库单-票据打印就解决了,我们来看一下效果吧: ?
IItemInfoPrintList pl = this.itemList.GetPrintList(); //打印对话框 RDLViewDialog printForm...= new RDLViewDialog(); //绑定报表定义 printForm.Report = this.Report; ...//绑定打印数据 printForm.DataObject = pl; //预览打印 printForm.PrintPreview
MessageBoxButtons.OK, MessageBoxIcon.Information); 6: return; 7: } 8: 9: if (this.printForm...== null) 10: this.printForm = new RDLViewDialog(); 11: 12: // 13: System.IO.TextReader...\\商品库存查询报表.rdl"); 17: textReader = new System.IO.StreamReader(fileName); 18: this.printForm.SourceRdl...= null) 23: textReader.Close(); 24: } 25: 26: this.printForm.DataObject = this.lvInfo.Tag...; 27: this.printForm.PrintPreview(); 28: } 修改程序,控制打印 编译并运行程序,我们看一下运行效果: ?
领取专属 10元无门槛券
手把手带您无忧上云