我已经使用SHAPE命令创建了ADO记录集。现在如何将数据报表文本框与vb6中的结果集字段绑定?

巴尔万特·贾特

我的记录集已成功使用ADO填充。但是现在如何将其与vb6中的数据报告文本字段连接起来?请帮忙?我的查询如下。

   str = "SHAPE {select * from sale where sale_from_id='" & firmName &
         "' and ret_id='" & Trim(txtRetId) & "' and date >=#" &
       Format(dtpFrom.value, "MM-DD-YYYY") & "# and date <= #" &
       Format(dtpTo.value, "MM-DD-YYYY") & "#}" _
                   & " APPEND ((SHAPE {select  sd.sale_id,sd.sdet_id,sd.item_id,i.item_name,sd.qty,sd.sdet_price,sd.sub_total
       from sale_detail sd, item i where i.item_id = sd.item_id}" _
                          & " APPEND({select * from sale_serial} AS sale_serial" _
                                  & " RELATE sdet_id TO sdet_id )) AS sale_detail" _
                         & " RELATE sale_id TO sale_id ) AS sale"
尼兰詹(Niranjan Dharmarajan)

以表格形式编写此代码,在此放置我的代码

       InvSql = "   SHAPE {SELECT * FROM `sales`}  AS salesgroup COMPUTE  salesgroup,   COUNT(salesgroup.'units') AS Aggregate1, <br/>SUM(salesgroup.'price') AS    Aggregate2, SUM(salesgroup.'total') AS Aggregate3 BY 'mname'" 


Set invReport = New ADODB.Recordset
 invReport.Open InvSql, cn
    invReport.Requery
Set rssum = New ADODB.Recordset
sumSql = "select amount  from credit where billno='BL001'"
rssum.Open sumSql, cn
rssum.Requery
 rptdealer.Sections("Section5").Controls.Item("Label5").Caption = "Rs." & rssum(0).Value
    Set rptdealer.DataSource = invReport
rptdealer.Show

 goto report page and insert group footer and group header place ur texbox and lables
get into code behind page of report page 

Private Sub DataReport_Initialize()
On Error Resume Next
   Move 0, 0
   Me.Caption = "Invoice Report"
   Me.Width = 11600
   Me.Height = 9000
   Me.ReportWidth = 8520
   Me.BottomMargin = 1440
   Me.TopMargin = 1440
   Me.LeftMargin = 1440
   Me.RightMargin = 1440
  SetSection6
End Sub
Private Sub SetSection6() 'parent credit
  Sections("Section6").Controls("txtbillno").DataField = "mname"
End Sub

 for other controls place controls and in datafield five the column name in database 
<strong>thats it now run !!!</strong>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档