请教VB中数据报表的问题(100分)

  • 主题发起人 主题发起人 flybird21cn
  • 开始时间 开始时间
F

flybird21cn

Unregistered / Unconfirmed
GUEST, unregistred user!
请教:1,使用DRD设计报表,dataenvironment的command对象的结果是否可以根据参数来生成.如果可以,如何做?
2,是否有办法实现页标头中的显示的内容动态改变?
3,在VB中有没有好用的报表设计控件?
 
1、 说明:rs为 recordset
Set rs = objperst.Query(sqlStr)'查询得到recordset
‘repfrmToTal为报表名
Set repfrmToTal.DataSource = rs
2、
repfrmToTal.Sections("SecTitle").Controls("lblDate").Caption = “内容”
“”号中为section名和控件名
我想你应知道了吧!
 
1、可以。下例中,i_id是参数,CmdContract是command对象名
If DE.rsCmdContract.State = adStateOpen then
DE.rsCmdContract.close
DE.CmdContract i_id
2、
DRcontract2.Sections.Item("SectionName").Controls.Item("LabelName").Caption = name
3.data report简单实用,水晶报表功能强大
If DE.rsCmdContract.State = adStateOpen then
DE.rsCmdContract.close
DE.CmdContract i_id
Select Case eachcount
Case 1
DRcontract1.Sections.Item("section2").Controls.Item("label9").Caption = ContractNo
DRcontract1.Sections.Item("section2").Controls.Item("label8").Caption = Date
DRcontract1.Sections.Item("section2").Controls.Item("label7").Caption = INV_NO
DRcontract1.Sections.Item("section2").Controls.Item("label19").Caption = name
DRcontract1.Sections.Item("section2").Controls.Item("label17").Caption = "TEL: " &
phone
DRcontract1.Sections.Item("section2").Controls.Item("label18").Caption = "FAX: " &
fax
DRcontract1.Sections.Item("section3").Controls.Item("label30").Caption = name
If method = 1 then
DRcontract1.Show
If method = 2 then
DRcontract1.PrintReport
Case 2
DRcontract2.Sections.Item("section2").Controls.Item("label9").Caption = ContractNo
DRcontract2.Sections.Item("section2").Controls.Item("label8").Caption = Date
DRcontract2.Sections.Item("section2").Controls.Item("label7").Caption = INV_NO
DRcontract2.Sections.Item("section2").Controls.Item("label19").Caption = name
DRcontract2.Sections.Item("section2").Controls.Item("label17").Caption = "TEL: " &
phone
DRcontract2.Sections.Item("section2").Controls.Item("label18").Caption = "FAX: " &
fax
DRcontract2.Sections.Item("section3").Controls.Item("label30").Caption = name
If method = 1 then
DRcontract2.Show
If method = 2 then
DRcontract2.PrintReport
Case 3
DRcontract3.Sections.Item("section2").Controls.Item("label9").Caption = ContractNo
DRcontract3.Sections.Item("section2").Controls.Item("label8").Caption = Date
DRcontract3.Sections.Item("section2").Controls.Item("label7").Caption = INV_NO
DRcontract3.Sections.Item("section2").Controls.Item("label19").Caption = name
DRcontract3.Sections.Item("section2").Controls.Item("label17").Caption = "TEL: " &
phone
DRcontract3.Sections.Item("section2").Controls.Item("label18").Caption = "FAX: " &
fax
DRcontract3.Sections.Item("section3").Controls.Item("label30").Caption = name
If method = 1 then
DRcontract3.Show
If method = 2 then
DRcontract3.PrintReport
Case 4
DRcontract4.Sections.Item("section2").Controls.Item("label9").Caption = ContractNo
DRcontract4.Sections.Item("section2").Controls.Item("label8").Caption = Date
DRcontract4.Sections.Item("section2").Controls.Item("label7").Caption = INV_NO
DRcontract4.Sections.Item("section2").Controls.Item("label19").Caption = name
DRcontract4.Sections.Item("section2").Controls.Item("label17").Caption = "TEL: " &
phone
DRcontract4.Sections.Item("section2").Controls.Item("label18").Caption = "FAX: " &
fax
DRcontract4.Sections.Item("section3").Controls.Item("label30").Caption = name
If method = 1 then
DRcontract4.Show
If method = 2 then
DRcontract4.PrintReport
End Select
 
要么你用水晶报表,要么你得忍受vb 的dataReport.
 
好不容易看到一个VB的,一看,来晚了!
 
多人接受答案了。
 
后退
顶部