De1.COmmands(n).CommandText=StrSQL

解决方案 »

  1.   

    实现不了,Command(n)中的n如何知道啊?好象看不出来,我试过,好象实现不了,请说详细点!
      

  2.   

    set t_datarep= new datarep
    set t_datarep.datasource=ado1.datasource
    t_datarep.show
      

  3.   

    http://www.playyuer.com 提供
    《vb 6之数据报表使用技巧》
    http://media.ccidnet.com/media/ciw/871/b1301.htm
    《VB6之Data Report全面解决方案(1)》
    http://microinfo.top263.net/Txt/DRptPlus.txt
    《巧用 VB6 之 Data Report 实现图片(Picture)、图表(MsChart)的打印及预览》
    http://microinfo.top263.net/Txt/ImageRpt.txt
    下载例程
    http://microinfo.top263.net/Zip/DatGrdRpt.zip
    http://microinfo.top263.net/Zip/ImageRpt.exe
    http://microinfo.top263.net/Zip/FmtDatRpt.zip 
    http://microinfo.top263.net/Zip/ShapeTree.zip 
    http://microinfo.top263.net/Zip/ShapeNew.zip 
      

  4.   

    例:  'drp为datareport,其中放了两个Label和两个Text控件  Dim cn As Object
        Dim rs As Object
        Set cn = CreateObject("adodb.connection")
        Set rs = CreateObject("adodb.recordset")
        cn.open "provider=sqloledb.1;data source=localhost;user id=sa;password=;initial catalog=master;"
        rs.open "select id,name from sysobjects", cn, 1, 1, 1
        
        drp.Sections("section2").Controls("label1").Caption = "Table ID"
        drp.Sections("section2").Controls("label2").Caption = "Table Name"
        
        drp.Sections("section1").Controls("text1").DataField = "ID"
        drp.Sections("section1").Controls("text2").DataField = "Name"
        Set drp.DataSource = rs    drp.Show
      

  5.   

    Random(随便) :请问这段程序放在哪里?见笑了
      

  6.   

    Random(随便) :再请教,如果想一页纸只打印一条记录,如何实现,谢谢!
      

  7.   

    这段程序可以放在窗体或模块中的任何代码中。
    你可以把你email留下,我把源代码发给你看看。
    如果一页只打印一条记录的话,我也没有好得解决方法。不过你可以将报表数据所在的Section拉高(即上面的Section1),高到大约一张纸。