上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:17k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  4. Object = "{54850C51-14EA-4470-A5E4-8C5DB32DC853}#1.0#0"; "vsprint8.ocx"
  5. Begin VB.Form DY_Tybbyldy 
  6.    Caption         =   "报表预览"
  7.    ClientHeight    =   7755
  8.    ClientLeft      =   1725
  9.    ClientTop       =   990
  10.    ClientWidth     =   10755
  11.    Icon            =   "系统_打印预览.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   7755
  14.    ScaleWidth      =   10755
  15.    Begin VSPrinter8LibCtl.VSPrinter Tydy 
  16.       Height          =   6615
  17.       Left            =   0
  18.       TabIndex        =   10
  19.       Top             =   675
  20.       Width           =   10665
  21.       _cx             =   18812
  22.       _cy             =   11668
  23.       Appearance      =   1
  24.       BorderStyle     =   1
  25.       Enabled         =   -1  'True
  26.       MousePointer    =   0
  27.       BackColor       =   -2147483643
  28.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  29.          Name            =   "Arial"
  30.          Size            =   11.25
  31.          Charset         =   0
  32.          Weight          =   400
  33.          Underline       =   0   'False
  34.          Italic          =   0   'False
  35.          Strikethrough   =   0   'False
  36.       EndProperty
  37.       BeginProperty HdrFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  38.          Name            =   "Courier New"
  39.          Size            =   14.25
  40.          Charset         =   0
  41.          Weight          =   400
  42.          Underline       =   0   'False
  43.          Italic          =   0   'False
  44.          Strikethrough   =   0   'False
  45.       EndProperty
  46.       AutoRTF         =   -1  'True
  47.       Preview         =   -1  'True
  48.       DefaultDevice   =   0   'False
  49.       PhysicalPage    =   -1  'True
  50.       AbortWindow     =   -1  'True
  51.       AbortWindowPos  =   0
  52.       AbortCaption    =   "Printing..."
  53.       AbortTextButton =   "Cancel"
  54.       AbortTextDevice =   "on the %s on %s"
  55.       AbortTextPage   =   "Now printing Page %d of"
  56.       FileName        =   ""
  57.       MarginLeft      =   1440
  58.       MarginTop       =   1440
  59.       MarginRight     =   1440
  60.       MarginBottom    =   1440
  61.       MarginHeader    =   0
  62.       MarginFooter    =   0
  63.       IndentLeft      =   0
  64.       IndentRight     =   0
  65.       IndentFirst     =   0
  66.       IndentTab       =   720
  67.       SpaceBefore     =   0
  68.       SpaceAfter      =   0
  69.       LineSpacing     =   100
  70.       Columns         =   1
  71.       ColumnSpacing   =   180
  72.       ShowGuides      =   2
  73.       LargeChangeHorz =   300
  74.       LargeChangeVert =   300
  75.       SmallChangeHorz =   30
  76.       SmallChangeVert =   30
  77.       Track           =   0   'False
  78.       ProportionalBars=   -1  'True
  79.       Zoom            =   34.4919786096257
  80.       ZoomMode        =   3
  81.       ZoomMax         =   400
  82.       ZoomMin         =   10
  83.       ZoomStep        =   25
  84.       EmptyColor      =   -2147483636
  85.       TextColor       =   0
  86.       HdrColor        =   0
  87.       BrushColor      =   0
  88.       BrushStyle      =   0
  89.       PenColor        =   0
  90.       PenStyle        =   0
  91.       PenWidth        =   0
  92.       PageBorder      =   0
  93.       Header          =   ""
  94.       Footer          =   ""
  95.       TableSep        =   "|;"
  96.       TableBorder     =   7
  97.       TablePen        =   0
  98.       TablePenLR      =   0
  99.       TablePenTB      =   0
  100.       NavBar          =   3
  101.       NavBarColor     =   -2147483633
  102.       ExportFormat    =   0
  103.       URL             =   ""
  104.       Navigation      =   3
  105.       NavBarMenuText  =   "Whole &Page|Page &Width|&Two Pages|Thumb&nail"
  106.       AutoLinkNavigate=   0   'False
  107.       AccessibleName  =   ""
  108.       AccessibleDescription=   ""
  109.       AccessibleValue =   ""
  110.       AccessibleRole  =   9
  111.       Begin VB.Image Image1 
  112.          Height          =   1140
  113.          Left            =   0
  114.          Picture         =   "系统_打印预览.frx":1042
  115.          Top             =   0
  116.          Visible         =   0   'False
  117.          Width           =   1065
  118.       End
  119.    End
  120.    Begin VB.PictureBox Picture1 
  121.       Appearance      =   0  'Flat
  122.       BorderStyle     =   0  'None
  123.       ForeColor       =   &H80000008&
  124.       Height          =   225
  125.       Left            =   7020
  126.       ScaleHeight     =   225
  127.       ScaleWidth      =   3795
  128.       TabIndex        =   5
  129.       Top             =   60
  130.       Width           =   3795
  131.       Begin VB.Label label1 
  132.          BackStyle       =   0  'Transparent
  133.          Caption         =   "显示比例"
  134.          ForeColor       =   &H00000000&
  135.          Height          =   300
  136.          Left            =   120
  137.          TabIndex        =   9
  138.          Top             =   30
  139.          Width           =   825
  140.       End
  141.       Begin VB.Label Label2 
  142.          BackStyle       =   0  'Transparent
  143.          Caption         =   "当前页号:"
  144.          ForeColor       =   &H00000000&
  145.          Height          =   270
  146.          Left            =   1200
  147.          TabIndex        =   8
  148.          Top             =   30
  149.          Width           =   855
  150.       End
  151.       Begin VB.Label Gjyh 
  152.          ForeColor       =   &H00000000&
  153.          Height          =   300
  154.          Left            =   2640
  155.          TabIndex        =   7
  156.          Top             =   30
  157.          Width           =   975
  158.       End
  159.       Begin VB.Label Dqyh 
  160.          ForeColor       =   &H00FF0000&
  161.          Height          =   300
  162.          Left            =   2010
  163.          TabIndex        =   6
  164.          Top             =   30
  165.          Width           =   615
  166.       End
  167.    End
  168.    Begin MSComctlLib.ImageList ImageList1 
  169.       Left            =   4740
  170.       Top             =   60
  171.       _ExtentX        =   1005
  172.       _ExtentY        =   1005
  173.       BackColor       =   -2147483643
  174.       ImageWidth      =   16
  175.       ImageHeight     =   16
  176.       MaskColor       =   12632256
  177.       _Version        =   393216
  178.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  179.          NumListImages   =   5
  180.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  181.             Picture         =   "系统_打印预览.frx":1B00
  182.             Key             =   "dy"
  183.          EndProperty
  184.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  185.             Picture         =   "系统_打印预览.frx":1E9A
  186.             Key             =   "sy"
  187.          EndProperty
  188.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  189.             Picture         =   "系统_打印预览.frx":2234
  190.             Key             =   "xy"
  191.          EndProperty
  192.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  193.             Picture         =   "系统_打印预览.frx":25CE
  194.             Key             =   "bz"
  195.          EndProperty
  196.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  197.             Picture         =   "系统_打印预览.frx":2968
  198.             Key             =   "tc"
  199.          EndProperty
  200.       EndProperty
  201.    End
  202.    Begin VSFlex8Ctl.VSFlexGrid DyylGrid 
  203.       Height          =   705
  204.       Left            =   2850
  205.       TabIndex        =   4
  206.       Top             =   -30
  207.       Visible         =   0   'False
  208.       Width           =   2775
  209.       _ExtentX        =   4895
  210.       _ExtentY        =   1244
  211.       Appearance      =   1
  212.       BorderStyle     =   1
  213.       Enabled         =   -1  'True
  214.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  215.          Name            =   "宋体"
  216.          Size            =   9
  217.          Charset         =   134
  218.          Weight          =   400
  219.          Underline       =   0   'False
  220.          Italic          =   0   'False
  221.          Strikethrough   =   0   'False
  222.       EndProperty
  223.       MousePointer    =   0
  224.       BackColor       =   -2147483643
  225.       ForeColor       =   -2147483640
  226.       BackColorFixed  =   -2147483633
  227.       ForeColorFixed  =   -2147483630
  228.       BackColorSel    =   -2147483635
  229.       ForeColorSel    =   -2147483634
  230.       BackColorBkg    =   -2147483636
  231.       BackColorAlternate=   -2147483643
  232.       GridColor       =   -2147483633
  233.       GridColorFixed  =   -2147483632
  234.       TreeColor       =   -2147483632
  235.       FloodColor      =   192
  236.       SheetBorder     =   -2147483642
  237.       FocusRect       =   1
  238.       HighLight       =   1
  239.       AllowSelection  =   -1  'True
  240.       AllowBigSelection=   -1  'True
  241.       AllowUserResizing=   0
  242.       SelectionMode   =   0
  243.       GridLines       =   1
  244.       GridLinesFixed  =   2
  245.       GridLineWidth   =   1
  246.       Rows            =   50
  247.       Cols            =   10
  248.       FixedRows       =   1
  249.       FixedCols       =   0
  250.       RowHeightMin    =   0
  251.       RowHeightMax    =   0
  252.       ColWidthMin     =   0
  253.       ColWidthMax     =   0
  254.       ExtendLastCol   =   0   'False
  255.       FormatString    =   ""
  256.       ScrollTrack     =   0   'False
  257.       ScrollBars      =   3
  258.       ScrollTips      =   0   'False
  259.       MergeCells      =   0
  260.       MergeCompare    =   0
  261.       AutoResize      =   -1  'True
  262.       AutoSizeMode    =   0
  263.       AutoSearch      =   0
  264.       MultiTotals     =   -1  'True
  265.       SubtotalPosition=   1
  266.       OutlineBar      =   0
  267.       OutlineCol      =   0
  268.       Ellipsis        =   0
  269.       ExplorerBar     =   0
  270.       PicturesOver    =   0   'False
  271.       FillStyle       =   0
  272.       RightToLeft     =   0   'False
  273.       PictureType     =   0
  274.       TabBehavior     =   0
  275.       OwnerDraw       =   0
  276.       Editable        =   0   'False
  277.       ShowComboButton =   -1  'True
  278.       WordWrap        =   0   'False
  279.       TextStyle       =   0
  280.       TextStyleFixed  =   0
  281.       OleDragMode     =   0
  282.       OleDropMode     =   0
  283.       DataMode        =   0
  284.       VirtualData     =   -1  'True
  285.    End
  286.    Begin MSComctlLib.StatusBar DYStatus 
  287.       Align           =   2  'Align Bottom
  288.       Height          =   405
  289.       Left            =   0
  290.       TabIndex        =   2
  291.       Top             =   7350
  292.       Width           =   10755
  293.       _ExtentX        =   18971
  294.       _ExtentY        =   714
  295.       _Version        =   393216
  296.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  297.          NumPanels       =   3
  298.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  299.             AutoSize        =   2
  300.          EndProperty
  301.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  302.             AutoSize        =   2
  303.          EndProperty
  304.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  305.             AutoSize        =   1
  306.             Object.Width           =   13309
  307.          EndProperty
  308.       EndProperty
  309.    End
  310.    Begin VB.HScrollBar PageHScroll 
  311.       Height          =   300
  312.       Left            =   8025
  313.       TabIndex        =   1
  314.       Top             =   345
  315.       Width           =   2715
  316.    End
  317.    Begin VB.ComboBox Xsbl 
  318.       Height          =   300
  319.       Left            =   7080
  320.       Style           =   2  'Dropdown List
  321.       TabIndex        =   0
  322.       Top             =   345
  323.       Width           =   885
  324.    End
  325.    Begin MSComctlLib.Toolbar YlToolbar 
  326.       Align           =   1  'Align Top
  327.       Height          =   615
  328.       Left            =   0
  329.       TabIndex        =   3
  330.       Top             =   0
  331.       Width           =   10755
  332.       _ExtentX        =   18971
  333.       _ExtentY        =   1085
  334.       ButtonWidth     =   979
  335.       ButtonHeight    =   926
  336.       AllowCustomize  =   0   'False
  337.       Appearance      =   1
  338.       ImageList       =   "ImageList1"
  339.       _Version        =   393216
  340.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  341.          NumButtons      =   7
  342.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  343.             Caption         =   "打 印"
  344.             Key             =   "dy"
  345.             ImageKey        =   "dy"
  346.          EndProperty
  347.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  348.             Style           =   3
  349.          EndProperty
  350.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  351.             Caption         =   "上 页"
  352.             Key             =   "sy"
  353.             ImageKey        =   "sy"
  354.          EndProperty
  355.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  356.             Caption         =   "下 页"
  357.             Key             =   "xy"
  358.             ImageKey        =   "xy"
  359.          EndProperty
  360.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  361.             Style           =   3
  362.          EndProperty
  363.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  364.             Caption         =   "帮 助"
  365.             Key             =   "bz"
  366.             ImageKey        =   "bz"
  367.          EndProperty
  368.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  369.             Caption         =   "返 回"
  370.             Key             =   "fh"
  371.             ImageKey        =   "tc"
  372.          EndProperty
  373.       EndProperty
  374.    End
  375. End
  376. Attribute VB_Name = "DY_Tybbyldy"
  377. Attribute VB_GlobalNameSpace = False
  378. Attribute VB_Creatable = False
  379. Attribute VB_PredeclaredId = True
  380. Attribute VB_Exposed = False
  381. '*******************************************************
  382. '*    模 块 名 称 :报表打印预览
  383. '*    功 能 描 述 :实现对报表按各种比例的模拟显示
  384. '*    程序员姓名  :张建忠
  385. '*    最后修改人  :张建忠
  386. '*    最后修改时间:2001/06/23
  387. '*    备        注:封版
  388. '*******************************************************
  389. Dim Ylzybl As Double, ylms As Integer                 '预 览 整 页 比 例
  390. Dim Changelock As Boolean                             '程 序 改 变 值 控 制 锁
  391. Private Sub PageHScroll_Change()                      '利用滚动条改变页号
  392.     With Tydy
  393.         If Not Changelock Then
  394.             .PreviewPage = PageHScroll.Value
  395.             If .PreviewPage = 1 Then
  396.                 YlToolbar.Buttons("sy").Enabled = False
  397.             Else
  398.                 YlToolbar.Buttons("sy").Enabled = True
  399.             End If
  400.             If .PreviewPage < .Pagecount Then
  401.                 YlToolbar.Buttons("xy").Enabled = True
  402.             Else
  403.                 YlToolbar.Buttons("xy").Enabled = False
  404.             End If
  405.         End If
  406.         Dqyh = Trim(Str(.PreviewPage))
  407.         Gjyh = "(共计:" + Trim(Str(.Pagecount)) + "页)"
  408.     End With
  409. End Sub
  410. Private Sub Tydy_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
  411.     With Tydy
  412.         If .Zoom <> 100 Then
  413.             .Zoom = 100
  414.             Xsbl.Text = "100%"
  415.         Else
  416.             Changelock = True
  417.             .ZoomMode = ylms
  418.             Select Case .ZoomMode
  419.                 Case zmPageWidth
  420.                     Xsbl.Text = "页宽"
  421.                 Case zmWholePage
  422.                     Xsbl.Text = "整页"
  423.                 Case zmThumbnail
  424.                     Xsbl.Text = "双页"
  425.             End Select
  426.             Changelock = False
  427.         End If
  428.     End With
  429. End Sub
  430. Private Sub Xsbl_Click()                  '调 整 预 览 比 例
  431.     If Changelock Then
  432.         Exit Sub
  433.     End If
  434.     With Tydy
  435.         Select Case Xsbl.Text
  436.             Case "页宽"
  437.                 .ZoomMode = zmPageWidth
  438.                 ylms = .ZoomMode
  439.             Case "整页"
  440.                 .ZoomMode = zmWholePage
  441.                 ylms = .ZoomMode
  442.             Case "双页"
  443.                 .ZoomMode = zmThumbnail
  444.                 ylms = .ZoomMode
  445.             Case Else
  446.                 .Zoom = Val(Mid(Xsbl.Text, 1, Len(Xsbl.Text) - 1))
  447.         End Select
  448.     End With
  449. End Sub
  450. Private Sub Form_Load()
  451.    
  452.   
  453.     With Tydy
  454.         Ylzybl = .Zoom
  455.         .ZoomMax = 400
  456.         .ZoomMin = 25
  457.     End With
  458.     With Xsbl
  459.         .AddItem "页宽"
  460.         .AddItem "整页"
  461.         .AddItem "双页"
  462.         .AddItem "10%"
  463.         .AddItem "25%"
  464.         .AddItem "50%"
  465.         .AddItem "75%"
  466.         .AddItem "100%"
  467.         .AddItem "150%"
  468.         .AddItem "200%"
  469.         .AddItem "400%"
  470.         Changelock = True
  471.         .Text = "整页"
  472.         ylms = Tydy.ZoomMode
  473.         Changelock = False
  474.     End With
  475.     
  476.     Me.HelpContextID = 2418006
  477. End Sub
  478. Private Sub Qpage()                             '向 前 翻 页
  479.     With Tydy
  480.         If .PreviewPage > 1 Then
  481.             .PreviewPage = .PreviewPage - 1
  482.             If .PreviewPage = 1 Then
  483.                 YlToolbar.Buttons("sy").Enabled = False
  484.             End If
  485.             If .PreviewPage < .Pagecount Then
  486.                 YlToolbar.Buttons("xy").Enabled = True
  487.             End If
  488.             Changelock = True
  489.             PageHScroll.Value = .PreviewPage
  490.             Changelock = False
  491.         End If
  492.     End With
  493. End Sub
  494. Private Sub Hpage()                        '向 后 翻 页
  495.     With Tydy
  496.         If .PreviewPage < .Pagecount Then
  497.             .PreviewPage = .PreviewPage + 1
  498.             If .PreviewPage > 1 Then
  499.                 YlToolbar.Buttons("sy").Enabled = True
  500.             End If
  501.             If .PreviewPage >= .Pagecount Then
  502.                 YlToolbar.Buttons("xy").Enabled = False
  503.             End If
  504.             Changelock = True
  505.             PageHScroll.Value = .PreviewPage
  506.             Changelock = False
  507.         End If
  508.     End With
  509.   
  510. End Sub
  511. Private Sub YlToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)      '点击工具条
  512.     Select Case Button.Key
  513.         Case "dy"
  514.             Call dyscbb
  515.         Case "sy"
  516.             Call Qpage
  517.         Case "xy"
  518.             Call Hpage
  519.         Case "fh"
  520.             Unload Me
  521.         Case "bz"
  522.             Call F1bz
  523.     End Select
  524. End Sub