i having below mentioned table , want display report user can select time interval in below table time interval of 5 minutes want see every 1 hour reading reading @ 9:00-->10:00-->... on should display there chances reading may have skipped want display
date time temperature remark 26/8/2016 09:05:00 2.3 power fail 26/8/2016 09:10:00 2.6 out of limit 26/8/2016 09:15:00 2.8 out of limit 26/8/2016 09:20:00 2.6 out of limit 26/8/2016 09:25:00 2.9 power fail 26/8/2016 09:30:00 3.1 power fail 26/8/2016 09:35:00 4.1 power fail 26/8/2016 09:40:00 5.4 out of limit | | | 26/8/2016 23:50:00 6.7 out of limit 26/8/2016 13:55:00 5.3 out of limit
to excute same tried below mentioned code textbox 1 contents time interval numeric
dim da new sqldataadapter("select * ref_1 date_time between '" & datetimepicker1.value & "' , '" & datetimepicker2.value & "' order date_time asc", conn) dim da1 new sqldataadapter("select * table_1 date_time between '" & dtp1.value & "' , '" & dtp2.value & "' order date_time asc", con) dim ds new dataset() da.fill(ds, "result") dim dt system.data.datatable = ds.tables("result") dim dcol new datacolumn() dcol.caption = "dt" dcol.columnname = "dt" dcol.datatype = system.type.[gettype]("system.int32") dt.columns.add(dcol) dim x integer x = 5 dim xrow integer = convert.toint32(textbox1.text / 5) dim xrow2 integer = textbox1.text / 5 dim k integer while k <> dt.rows.count if xrow2 = xrow dt.rows(k)("dt") = xrow xrow2 = 0 end if xrow2 += 1 k += 1 end while dim dv dataview = new dataview(dt) dv.rowfilter = "dt=" & xrow datagridview1.datasource = dv dim dt1 new datatable dt1 .columns.add("date_time") .columns.add("r_1") .columns.add("remark") end each dr datagridviewrow in me.datagridview1.rows dt1.rows.add(dr.cells("date_time").value, dr.cells("r_1").value, dr.cells("remark").value) next dim rptdoc crystalreports.engine.reportdocument rptdoc = new crystalreport1 rptdoc.setdatasource(dt1) end sub
Comments
Post a Comment