Print Rdlc report without showing preview vb.net -
i made project print invoice i'm trying print report without showing print preview in reportviewer, can me? here code used print:
dim ds new dataset1 dim dt datatable = ds.tables(0) if cn.state = 1 cn.close() if rs.state = 1 rs.close() cn.open(constr) rs.open("select * tbltemp", cn, 1, 2) x = 0 rs.recordcount - 1 dim r datarow = dt.newrow() r("itemcode") = rs.fields("itemcode").value r("itemname") = rs.fields("itemname").value r("itemunit") = rs.fields("itemunit").value r("itemsize") = rs.fields("itemsize").value r("itemqnt") = rs.fields("itemqnt").value r("reqdate") = format(rs.fields("reqdate").value, "dd/mm/yyyy") r("ava1") = rs.fields("ava1").value r("ava2") = rs.fields("ava2").value r("rejust") = rs.fields("rejust").value rs.movenext() dt.rows.add(r) next rs.movefirst() frmreport.reportviewer1.localreport.datasources.clear() frmreport.reportviewer1.localreport.datasources.add(new reportdatasource("dataset1", ds.tables(0))) frmreport.reportviewer1.setdisplaymode(microsoft.reporting.winforms.displaymode.printlayout) frmreport.reportviewer1.refreshreport() cn.close() frmreport.show()
Comments
Post a Comment