DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   showing report groupwise in a data report (http://www.daniweb.com/forums/thread168249.html)

firoz.raj Jan 14th, 2009 2:36 am
showing report groupwise in a data report
 
Can any one tell me how should i generate report on the basis of groupwise since right know i placed department,job centre,cost centre ,requested by, delivery point, delivery date req, suggested
vendor on the detail section1. but it is comming two times kindly
see the attachment if not understand.
here is the code what i written
 Private Sub Command4_Click()
 Set rs = New ADODB.Recordset
 RECORDSQL = "SELECT MR.dept_name,MR.job_no,MR.cost_centre, MR.emp_name,MR.del_point, MR.del_time,MR.sug_vendor,MR.mr_date,MR.manager,MR.item_code,MR.productname,MR.unit,MR.qty, Count(*) AS NoOfEntries From MR Group by MR.dept_name,MR.job_no,MR.cost_centre, MR.emp_name,MR.del_point, MR.del_time,MR.sug_vendor,MR.mr_date,MR.manager,MR.item_code,MR.productname,MR.unit,MR.qty,MR.req_no HAVING (((MR.Req_no)=" & Text12.Text & "));"
  rs.Open RECORDSQL, con, adOpenDynamic, adLockOptimistic
  If Not rs.EOF Then
  With DataReport2.Sections("section1").Controls
  .Item("text1").DataField = rs.Fields("productname").Name
  .Item("text2").DataField = rs.Fields("qty").Name
  .Item("text3").DataField = rs.Fields("unit").Name
  .Item("text4").DataField = rs.Fields("dept_name").Name
  .Item("text5").DataField = rs.Fields("job_no").Name
  .Item("text6").DataField = rs.Fields("cost_centre").Name
  .Item("Text7").DataField = rs.Fields("Emp_name").Name
  .Item("text8").DataField = rs.Fields("mr_date").Name
  .Item("text9").DataField = rs.Fields("del_point").Name
  .Item("TEXT10").DataField = rs.Fields("MANAGER").Name
  .Item("Text11").DataField = rs.Fields("sug_vendor").Name
' .Item("text11").DataField = rs.Fields("Req_no").Name
  End With
  Set DataReport2.DataSource = rs
  DataReport2.Orientation = rptOrientLandscape
  DataReport2.Refresh
  DataReport2.Show vbModeless
  End If
  End Sub


All times are GMT -4. The time now is 6:34 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC