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

企业管理

开发平台:

Visual Basic

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