看MSDN中关于DataEnvironment的部分。

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/556/556642.xml
    主  题:  请问用什么控件来做打印预览呢?   http://www.wzjcw.net/vbgood/code/index.asp?action=read&  id=1199
      一个网友设计的打印预览类和示例,堪称精品!  (有详细的中文注释)
      (录入时间:2001.12.22  阅读次数:559)  推荐  转载不详    
      作者:不详  
      
      所属类别:打印  
      允许环境:VB6.0+Win98  
      内容介绍:暂时没有这代码的摘要  
      下载地址:请点这里  
      注意事项:如下载链接错误,请到论坛  [意见建议]  中报告,谢谢!  
       
    http://www.wzjcw.net/vbgood/code/index.asp?action=read&  id=173
      如何使用VB实现打印预览
      http://www.wzjcw.net/vbgood/code/index.asp?action=read&  id=25
      打印预览
      

  2.   

    DataReport 对象
                DataReport对象是一个可编程对象,代表数据报表设计器(Data Report designer)。语法DataReport说明Data Report使用数据库中的记录生成报表。要使用它: 配置一个数据源,例如Microsoft数据环境,以访问数据库。
    设定DataReport对象的DataSource属性为数据源。
    设定DataReport对象的DataMember属性为数据成员。
    右键单击设计器,并单击“检索结构”。
    向相应的节添加相应的控件。
    为每一个控件设定DataMember和DataField属性。
    运行时,使用Show方法显示数据报表。 
    使用DataReport对象通过更改每一Section对象的布局,来编程改变数据报表的外观和行为。数据报表设计器还有使用ExportReport方法导出报表的功能。这一方法允许从ExportFormats集合中指定一个ExportFormat对象,以用作报表的模板。
      

  3.   

    '参考
    Private Sub sscmdOK_Click(Index As Integer)
        Dim sqlprint As String
        Dim J As Integer
        Dim XX As String
        Dim bb As Integer
        sqlprint = "SELECT * FROM Jc_Shhy WHERE hth='" & Trim(W_Jc_Shhy.Text1(0).Text) & "'"
        ReportPrint "com_jc_shhy", sqlprint, Dr_Jc_Shhy1
        
        DE_Report.Con_report.Close
        OpenDEConnection
        '打印选择
        If SSOption1(0).Value = True Then             '正文
            ReportPrint "com_jc_shhy", sqlprint, Dr_Jc_Shhy1
            Call TaoPrint(Dr_Jc_Shhy1, nPrintMode)
            If W_Jc_Shhy.Text1(9).Text = "TO BE COVERED BY THE BUYERS." Then
               Dr_Jc_Shhy1.Sections(3).Controls("label46").Visible = True
               Dr_Jc_Shhy1.Sections(3).Controls("Label47").Visible = True
               Dr_Jc_Shhy1.Sections(3).Controls("Label48").Visible = True
               Dr_Jc_Shhy1.Sections(3).Controls("Label49").Visible = True
            Else
               Dr_Jc_Shhy1.Sections(3).Controls("Label46").Visible = False
               Dr_Jc_Shhy1.Sections(3).Controls("Label47").Visible = False
               Dr_Jc_Shhy1.Sections(3).Controls("Label48").Visible = False
               Dr_Jc_Shhy1.Sections(3).Controls("Label49").Visible = False
            End If
            Dr_Jc_Shhy1.Show 1
        Else
            If SSOption1(1).Value = True Then         '附页
                XX = mmLine(Rs_Jc_Shhy.Fields("addpage"))
                
                ReportPrint "com_jc_shhy", sqlprint, Dr_Jc_Shhy2
                Call TaoPrint(Dr_Jc_Shhy2, nPrintMode)
                bb = 1
                Dr_Jc_Shhy2.Sections(3).Controls("LABEL2").Caption = bb
                Dr_Jc_Shhy2.Show 1
                If XX > 53 Then
                    bb = 2
                    For I = 1 To Int(XX / 53)
                        ReportPrint "com_jc_shhy", sqlprint, Dr_Jc_Shhy2
                        Dr_Jc_Shhy2.Sections(3).Controls("TXTaddpage").Visible = False
                        Dr_Jc_Shhy2.Sections(3).Controls("LABEL23").Caption = ""
                        For J = I * 53 + 1 To (I + 1) * 53
                            Dr_Jc_Shhy2.Sections(3).Controls("LABEL23").Caption = Dr_Jc_Shhy2.Sections(3).Controls("LABEL23").Caption & Mline(Rs_Jc_Shhy.Fields("addpage"), J) & Chr(10) & Chr(13)
                        Next J
                        Dr_Jc_Shhy2.Sections(3).Controls("LABEL23").Visible = True
                        Dr_Jc_Shhy2.Sections(3).Controls("LABEL2").Caption = bb
                        Dr_Jc_Shhy2.Show 1
                        bb = bb + 1
                    Next I
                End If
            Else
                If SSOption1(2).Value = True Then     '背面
                    ReportPrint "com_jc_shhy", sqlprint, Dr_Jc_Shhy3
                    Call TaoPrint(Dr_Jc_Shhy3, nPrintMode)
                    Dr_Jc_Shhy3.Show 1
                End If
            End If
        End If
        Unload Me
    End Sub
      

  4.   

    假如我已经划了一幅图还有上面有文字(在Picture对象中),如果该图像比较大,假如和A3纸一样大,怎样在A4纸上打印出来