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

企业管理

开发平台:

Visual Basic

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