home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / crpedemo / section.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-15  |  24.0 KB  |  693 lines

  1. VERSION 2.00
  2. Begin Form Section 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Section Formats"
  6.    ClientHeight    =   4230
  7.    ClientLeft      =   1140
  8.    ClientTop       =   1575
  9.    ClientWidth     =   7215
  10.    Height          =   4635
  11.    Left            =   1080
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4230
  16.    ScaleWidth      =   7215
  17.    Top             =   1230
  18.    Width           =   7335
  19.    Begin SSCheck LineHCheck 
  20.       Caption         =   "Set Line Height for a Line #"
  21.       Font3D          =   0  'None
  22.       Height          =   285
  23.       Left            =   4140
  24.       TabIndex        =   4
  25.       Top             =   1800
  26.       Width           =   2625
  27.    End
  28.    Begin TextBox SectionText3 
  29.       Height          =   375
  30.       Left            =   5580
  31.       TabIndex        =   5
  32.       Top             =   2205
  33.       Visible         =   0   'False
  34.       Width           =   1185
  35.    End
  36.    Begin CommandButton SectionHelp 
  37.       Caption         =   "Help"
  38.       Height          =   375
  39.       Left            =   5190
  40.       TabIndex        =   9
  41.       Top             =   3465
  42.       Width           =   1275
  43.    End
  44.    Begin CommonDialog CMDialog1 
  45.       Left            =   6240
  46.       Top             =   120
  47.    End
  48.    Begin TextBox SectionText2 
  49.       Height          =   375
  50.       Left            =   5580
  51.       TabIndex        =   3
  52.       Top             =   1350
  53.       Width           =   1215
  54.    End
  55.    Begin TextBox SectionText1 
  56.       Height          =   375
  57.       Left            =   5580
  58.       TabIndex        =   2
  59.       Top             =   810
  60.       Width           =   1215
  61.    End
  62.    Begin CommandButton SetFont 
  63.       Caption         =   "Set Font..."
  64.       Enabled         =   0   'False
  65.       Height          =   375
  66.       Left            =   3780
  67.       TabIndex        =   6
  68.       Top             =   2925
  69.       Width           =   1215
  70.    End
  71.    Begin ComboBox SectionCombo 
  72.       BackColor       =   &H00C0C0C0&
  73.       ForeColor       =   &H00404000&
  74.       Height          =   300
  75.       Left            =   990
  76.       Style           =   2  'Dropdown List
  77.       TabIndex        =   1
  78.       Top             =   225
  79.       Width           =   2775
  80.    End
  81.    Begin CommandButton SectionDone 
  82.       Caption         =   "Done"
  83.       Height          =   375
  84.       Left            =   3780
  85.       TabIndex        =   8
  86.       Top             =   3465
  87.       Width           =   1185
  88.    End
  89.    Begin CommandButton SetFormat 
  90.       Caption         =   "Set Formats"
  91.       Enabled         =   0   'False
  92.       Height          =   375
  93.       Left            =   5190
  94.       TabIndex        =   7
  95.       Top             =   2925
  96.       Width           =   1275
  97.    End
  98.    Begin SSCheck SectionCheck7 
  99.       Caption         =   "Print at Bottom of Page"
  100.       Font3D          =   0  'None
  101.       Height          =   375
  102.       Left            =   360
  103.       TabIndex        =   17
  104.       Top             =   3240
  105.       Width           =   2415
  106.    End
  107.    Begin SSCheck SectionCheck6 
  108.       Caption         =   "Reset Page # After"
  109.       Font3D          =   0  'None
  110.       Height          =   375
  111.       Left            =   360
  112.       TabIndex        =   16
  113.       Top             =   2880
  114.       Width           =   2295
  115.    End
  116.    Begin SSCheck SectionCheck5 
  117.       Caption         =   "Suppress Blank Lines"
  118.       Font3D          =   0  'None
  119.       Height          =   375
  120.       Left            =   360
  121.       TabIndex        =   15
  122.       Top             =   2520
  123.       Width           =   2295
  124.    End
  125.    Begin SSCheck SectionCheck4 
  126.       Caption         =   "Keep Sections Together"
  127.       Font3D          =   0  'None
  128.       Height          =   375
  129.       Left            =   360
  130.       TabIndex        =   14
  131.       Top             =   2160
  132.       Width           =   2415
  133.    End
  134.    Begin SSCheck SectionCheck3 
  135.       Caption         =   "New Page After"
  136.       Font3D          =   0  'None
  137.       Height          =   375
  138.       Left            =   360
  139.       TabIndex        =   13
  140.       Top             =   1800
  141.       Width           =   1815
  142.    End
  143.    Begin SSCheck SectionCheck2 
  144.       Caption         =   "New Page Before"
  145.       Font3D          =   0  'None
  146.       Height          =   375
  147.       Left            =   360
  148.       TabIndex        =   12
  149.       Top             =   1440
  150.       Width           =   1815
  151.    End
  152.    Begin SSCheck SectionCheck1 
  153.       Caption         =   "Show Section"
  154.       Font3D          =   0  'None
  155.       Height          =   375
  156.       Left            =   360
  157.       TabIndex        =   11
  158.       Top             =   1080
  159.       Width           =   1815
  160.    End
  161.    Begin SSPanel Panel3D2 
  162.       Alignment       =   1  'Left Justify - MIDDLE
  163.       BackColor       =   &H00C0C0C0&
  164.       BevelInner      =   1  'Inset
  165.       BevelWidth      =   2
  166.       BorderWidth     =   1
  167.       Font3D          =   0  'None
  168.       Height          =   4695
  169.       Left            =   8280
  170.       TabIndex        =   0
  171.       Top             =   4275
  172.       Width           =   3255
  173.       Begin SSFrame Frame3D2 
  174.          Font3D          =   0  'None
  175.          ForeColor       =   &H00000000&
  176.          Height          =   3165
  177.          Left            =   270
  178.          TabIndex        =   10
  179.          Top             =   360
  180.          Width           =   2715
  181.          Begin SSOption Option3D1 
  182.             Caption         =   "Grand Total"
  183.             Font3D          =   0  'None
  184.             Height          =   285
  185.             Index           =   6
  186.             Left            =   180
  187.             TabIndex        =   24
  188.             TabStop         =   0   'False
  189.             Top             =   2655
  190.             Width           =   1275
  191.          End
  192.          Begin SSOption Option3D1 
  193.             Caption         =   "Page Footer"
  194.             Font3D          =   0  'None
  195.             Height          =   240
  196.             Index           =   5
  197.             Left            =   180
  198.             TabIndex        =   23
  199.             TabStop         =   0   'False
  200.             Top             =   2250
  201.             Width           =   1455
  202.          End
  203.          Begin SSOption Option3D1 
  204.             Caption         =   "Group Footer"
  205.             Font3D          =   0  'None
  206.             Height          =   285
  207.             Index           =   4
  208.             Left            =   180
  209.             TabIndex        =   22
  210.             TabStop         =   0   'False
  211.             Top             =   1845
  212.             Width           =   1455
  213.          End
  214.          Begin SSOption Option3D1 
  215.             Caption         =   "Details"
  216.             Font3D          =   0  'None
  217.             Height          =   285
  218.             Index           =   3
  219.             Left            =   180
  220.             TabIndex        =   21
  221.             TabStop         =   0   'False
  222.             Top             =   1440
  223.             Width           =   1635
  224.          End
  225.          Begin SSOption Option3D1 
  226.             Caption         =   "Group Header"
  227.             Font3D          =   0  'None
  228.             Height          =   240
  229.             Index           =   2
  230.             Left            =   180
  231.             TabIndex        =   20
  232.             TabStop         =   0   'False
  233.             Top             =   1080
  234.             Width           =   1635
  235.          End
  236.          Begin SSOption Option3D1 
  237.             Caption         =   "Page Header"
  238.             Font3D          =   0  'None
  239.             Height          =   240
  240.             Index           =   1
  241.             Left            =   180
  242.             TabIndex        =   19
  243.             TabStop         =   0   'False
  244.             Top             =   675
  245.             Width           =   1455
  246.          End
  247.          Begin SSOption Option3D1 
  248.             Caption         =   "All Sections"
  249.             Font3D          =   0  'None
  250.             Height          =   285
  251.             Index           =   0
  252.             Left            =   180
  253.             TabIndex        =   18
  254.             Top             =   270
  255.             Value           =   -1  'True
  256.             Width           =   1725
  257.          End
  258.       End
  259.    End
  260.    Begin SSFrame Frame3D1 
  261.       Caption         =   "Format"
  262.       Font3D          =   0  'None
  263.       ForeColor       =   &H00000000&
  264.       Height          =   3135
  265.       Left            =   240
  266.       TabIndex        =   26
  267.       Top             =   720
  268.       Width           =   2775
  269.    End
  270.    Begin Label Label4 
  271.       BackColor       =   &H00C0C0C0&
  272.       Caption         =   "Specify Line #:"
  273.       Height          =   240
  274.       Left            =   4140
  275.       TabIndex        =   29
  276.       Top             =   2250
  277.       Visible         =   0   'False
  278.       Width           =   1365
  279.    End
  280.    Begin Label Label3 
  281.       BackColor       =   &H00C0C0C0&
  282.       Caption         =   "Line Height(Twips):"
  283.       Height          =   255
  284.       Left            =   3780
  285.       TabIndex        =   28
  286.       Top             =   1395
  287.       Width           =   1725
  288.    End
  289.    Begin Label Label1 
  290.       BackColor       =   &H00C0C0C0&
  291.       Caption         =   "Min Section Height(Twips):"
  292.       Height          =   390
  293.       Left            =   3240
  294.       TabIndex        =   27
  295.       Top             =   840
  296.       Width           =   2355
  297.    End
  298.    Begin Label Label2 
  299.       BackColor       =   &H00C0C0C0&
  300.       Caption         =   "Section:"
  301.       Height          =   255
  302.       Left            =   240
  303.       TabIndex        =   25
  304.       Top             =   270
  305.       Width           =   855
  306.    End
  307. Sub Command1_Click ()
  308.   'Set the formatting options depending for various sections
  309.      
  310.     If Jobnum = 0 Then
  311.         MsgBox "No job open."
  312.         Exit Sub
  313.     End If
  314.     Dim SectionOptions As PESectionOptions
  315.     SectionOptions.StructSize = Len(SectionOptions)
  316.     'SectionOptions.Visible = -(Check3D1.Value)
  317.     'SectionOptions.newPageBefore = -(Check3D2.Value)
  318.     'SectionOptions.newPageAfter = -(Check3D3.Value)
  319.     'SectionOptions.keepTogether = -(Check3D4.Value)
  320.     'SectionOptions.suppressBlankLines = -(Check3D5.Value)
  321.     'SectionOptions.resetPageNAfter = -(Check3D6.Value)
  322.     'SectionOptions.printAtBottomOfPage = -(Check3D7.Value)
  323.    If PESetSectionFormat(Jobnum, SectionCode, SectionOptions) = False Then
  324.       RCode = GetErrorString(Jobnum)
  325.       MsgBox "PESetSectionFormat Error #: " + Str(ErrorCode) + " - " + RCode
  326.    End If
  327.    Exit Sub
  328. End Sub
  329. Sub Command2_Click ()
  330.  Unload Me
  331. End Sub
  332. Sub Command3_Click ()
  333.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  334.  If RCode = False Then
  335.    MsgBox ("RedPoint cannot find the Crystal Help file in C:\CRW directory")
  336.  End If
  337. End Sub
  338. Sub Form_Load ()
  339. 'declare variables
  340. Dim NGroups As Integer
  341. 'Check if jobnumber is open
  342. If Jobnum = 0 Then
  343.   MsgBox "No Job Open"
  344.   Exit Sub
  345. End If
  346. 'Get the Number of groups in Report
  347. NGroups = PEGetNGroups(Jobnum)
  348. ' Populate combo list box depending on the number of groups in the report
  349. If NGroups = 0 Then
  350.   SectionCombo.AddItem "Title"
  351.   SectionCombo.AddItem "Page Header"
  352.   SectionCombo.AddItem "Details"
  353.   SectionCombo.AddItem "Page Footer"
  354.   SectionCombo.AddItem "Grand Total"
  355.   SectionCombo.AddItem "Summary"
  356.   If NGroups = 1 Then
  357.     SectionCombo.AddItem "Title"
  358.     SectionCombo.AddItem "Page Header"
  359.     SectionCombo.AddItem "Group Header 1"
  360.     SectionCombo.AddItem "Details"
  361.     SectionCombo.AddItem "Group Footer 1"
  362.     SectionCombo.AddItem "Page Footer"
  363.     SectionCombo.AddItem "Grand Total"
  364.     SectionCombo.AddItem "Summary"
  365.   Else
  366.     If NGroups = 2 Then
  367.       
  368.       SectionCombo.AddItem "Title"
  369.       SectionCombo.AddItem "Page Header"
  370.       SectionCombo.AddItem "Group Header 1"
  371.       SectionCombo.AddItem "Group Header 2"
  372.       SectionCombo.AddItem "Details"
  373.       SectionCombo.AddItem "Group Footer 1"
  374.       SectionCombo.AddItem "Group Header 2"
  375.       SectionCombo.AddItem "Grand Total"
  376.       SectionCombo.AddItem "Page Footer"
  377.       SectionCombo.AddItem "Summary"
  378.     Else
  379.       If NGroups = 3 Then
  380.         
  381.         SectionCombo.AddItem "Title"
  382.         SectionCombo.AddItem "Page Header"
  383.         SectionCombo.AddItem "Group Header 1"
  384.         SectionCombo.AddItem "Group Header 2"
  385.         SectionCombo.AddItem "Group Header 3"
  386.         SectionCombo.AddItem "Details"
  387.         SectionCombo.AddItem "Group Footer 1"
  388.         SectionCombo.AddItem "Group Header 2"
  389.         SectionCombo.AddItem "Group Header 3"
  390.         SectionCombo.AddItem "Grand Total"
  391.         SectionCombo.AddItem "Page Footer"
  392.         SectionCombo.AddItem "Summary"
  393.       Else
  394.         If NGroups = 4 Then
  395.          
  396.          SectionCombo.AddItem "Title"
  397.          SectionCombo.AddItem "Page Header"
  398.          SectionCombo.AddItem "Group Header 1"
  399.          SectionCombo.AddItem "Group Header 2"
  400.          SectionCombo.AddItem "Group Header 3"
  401.          SectionCombo.AddItem "Group Header 4"
  402.          SectionCombo.AddItem "Details"
  403.          SectionCombo.AddItem "Group Footer 1"
  404.          SectionCombo.AddItem "Group Header 2"
  405.          SectionCombo.AddItem "Group Header 3"
  406.          SectionCombo.AddItem "Group Header 4"
  407.          SectionCombo.AddItem "Grand Total"
  408.          SectionCombo.AddItem "Page Footer"
  409.          SectionCombo.AddItem "Summary"
  410.         End If
  411.       End If
  412.     End If
  413.   End If
  414. End If
  415. End Sub
  416. Sub LineHCheck_Click (Value As Integer)
  417. If LineHCheck.Value = True Then
  418.   Label4.Visible = True
  419.   SectionText3.Visible = True
  420. End If
  421. End Sub
  422. Sub MenuFileExit_Click ()
  423.  Unload Me
  424. End Sub
  425. Sub SectionCombo_Change ()
  426. MsgBox "Please Choose from the Drop Down list Provided"
  427. Exit Sub
  428. End Sub
  429. Sub SectionCombo_Click ()
  430. 'Declare Variables
  431. Dim MinHeight As Integer
  432. Dim LHeight As Integer
  433. Dim NLine As Integer
  434. Dim Ascent As Integer
  435. 'Assign Variables
  436. NLine = 0
  437. SectionText3.Text = NLine
  438. 'Enable Set format and Set font Buttons
  439. SetFont.Enabled = True
  440. SetFormat.Enabled = True
  441. If SectionCombo.Text = "Title" Then
  442.   SectionCode = 1000
  443.   SectionCheck1.Enabled = True
  444.   SectionCheck2.Enabled = True
  445.   SectionCheck3.Enabled = True
  446.   SectionCheck4.Enabled = True
  447.   SectionCheck5.Enabled = True
  448.   SectionCheck6.Enabled = True
  449.   SectionCheck7.Enabled = True
  450.   If SectionCombo.Text = "Page Header" Then
  451.     SectionCode = 2000
  452.     SectionCheck1.Enabled = True
  453.     SectionCheck2.Enabled = False
  454.     SectionCheck3.Enabled = False
  455.     SectionCheck4.Enabled = False
  456.     SectionCheck5.Enabled = True
  457.     SectionCheck6.Enabled = False
  458.     SectionCheck7.Enabled = False
  459.   Else
  460.     If SectionCombo.Text = "Group Header 1" Then
  461.       SectionCode = 3000
  462.       SectionCheck1.Enabled = True
  463.       SectionCheck2.Enabled = True
  464.       SectionCheck3.Enabled = True
  465.       SectionCheck4.Enabled = True
  466.       SectionCheck5.Enabled = True
  467.       SectionCheck6.Enabled = True
  468.       SectionCheck7.Enabled = True
  469.     Else
  470.       If SectionCombo.Text = "Group Header 2" Then
  471.         SectionCode = 3001
  472.         SectionCheck1.Enabled = True
  473.         SectionCheck2.Enabled = True
  474.         SectionCheck3.Enabled = True
  475.         SectionCheck4.Enabled = True
  476.         SectionCheck5.Enabled = True
  477.         SectionCheck6.Enabled = True
  478.         SectionCheck7.Enabled = True
  479.       Else
  480.         If SectionCombo.Text = "Group Header 3" Then
  481.           SectionCode = 3002
  482.           SectionCheck1.Enabled = True
  483.           SectionCheck2.Enabled = True
  484.           SectionCheck3.Enabled = True
  485.           SectionCheck4.Enabled = True
  486.           SectionCheck5.Enabled = True
  487.           SectionCheck6.Enabled = True
  488.           SectionCheck7.Enabled = True
  489.            
  490.         Else
  491.           If SectionCombo.Text = "Group Header 4" Then
  492.             SectionCode = 3003
  493.             SectionCheck1.Enabled = True
  494.             SectionCheck2.Enabled = True
  495.             SectionCheck3.Enabled = True
  496.             SectionCheck4.Enabled = True
  497.             SectionCheck5.Enabled = True
  498.             SectionCheck6.Enabled = True
  499.             SectionCheck7.Enabled = True
  500.           Else
  501.             If SectionCombo.Text = "Details" Then
  502.               SectionCode = 4000
  503.               SectionCheck1.Enabled = True
  504.               SectionCheck2.Enabled = True
  505.               SectionCheck3.Enabled = True
  506.               SectionCheck4.Enabled = True
  507.               SectionCheck5.Enabled = True
  508.               SectionCheck6.Enabled = True
  509.               SectionCheck7.Enabled = True
  510.             Else
  511.               If SectionCombo.Text = "Group Footer 1" Then
  512.                 SectionCode = 5000
  513.                 SectionCheck1.Enabled = True
  514.                 SectionCheck2.Enabled = True
  515.                 SectionCheck3.Enabled = True
  516.                 SectionCheck4.Enabled = True
  517.                 SectionCheck5.Enabled = True
  518.                 SectionCheck6.Enabled = True
  519.                 SectionCheck7.Enabled = True
  520.               Else
  521.                 If SectionCombo.Text = "Group Footer 2" Then
  522.                   SectionCode = 5001
  523.                   SectionCheck1.Enabled = True
  524.                   SectionCheck2.Enabled = True
  525.                   SectionCheck3.Enabled = True
  526.                   SectionCheck4.Enabled = True
  527.                   SectionCheck5.Enabled = True
  528.                   SectionCheck6.Enabled = True
  529.                   SectionCheck7.Enabled = True
  530.                 Else
  531.                   If SectionCombo.Text = "Group Footer 3" Then
  532.                     SectionCode = 5002
  533.                     SectionCheck1.Enabled = True
  534.                     SectionCheck2.Enabled = True
  535.                     SectionCheck3.Enabled = True
  536.                     SectionCheck4.Enabled = True
  537.                     SectionCheck5.Enabled = True
  538.                     SectionCheck6.Enabled = True
  539.                     SectionCheck7.Enabled = True
  540.                   Else
  541.                     If SectionCombo.Text = "Group Footer 4" Then
  542.                       SectionCode = 5003
  543.                       SectionCheck1.Enabled = True
  544.                       SectionCheck2.Enabled = True
  545.                       SectionCheck3.Enabled = True
  546.                       SectionCheck4.Enabled = True
  547.                       SectionCheck5.Enabled = True
  548.                       SectionCheck6.Enabled = True
  549.                       SectionCheck7.Enabled = True
  550.                            
  551.                     Else
  552.                       If SectionCombo.Text = "Grand Total" Then
  553.                         SectionCode = 6000
  554.                         SectionCheck1.Enabled = True
  555.                         SectionCheck2.Enabled = True
  556.                         SectionCheck3.Enabled = True
  557.                         SectionCheck4.Enabled = True
  558.                         SectionCheck5.Enabled = True
  559.                         SectionCheck6.Enabled = True
  560.                         SectionCheck7.Enabled = True
  561.                       Else
  562.                         If SectionCombo.Text = "Page Footer" Then
  563.                           SectionCode = 7000
  564.                           SectionCheck1.Enabled = True
  565.                           SectionCheck2.Enabled = False
  566.                           SectionCheck3.Enabled = False
  567.                           SectionCheck4.Enabled = False
  568.                           SectionCheck5.Enabled = True
  569.                           SectionCheck6.Enabled = False
  570.                           SectionCheck7.Enabled = False
  571.                         Else
  572.                           If SectionCombo.Text = "Summary" Then
  573.                             SectionCode = 8000
  574.                             SectionCheck1.Enabled = True
  575.                             SectionCheck2.Enabled = True
  576.                             SectionCheck3.Enabled = True
  577.                             SectionCheck4.Enabled = True
  578.                             SectionCheck5.Enabled = True
  579.                             SectionCheck6.Enabled = True
  580.                             SectionCheck7.Enabled = True
  581.                           End If
  582.                         End If
  583.                       End If
  584.                     End If
  585.                   End If
  586.                 End If
  587.               End If
  588.             End If
  589.           End If
  590.         End If
  591.       End If
  592.     End If
  593.   End If
  594. End If
  595. 'Populate Check boxes depending on which section was chosen from Combo list box
  596.     Dim SectionOptions As PESectionOptions
  597.     SectionOptions.StructSize = Len(SectionOptions)
  598.     SectionOptions.Visible = 0
  599.     SectionOptions.newpagebefore = 0
  600.     SectionOptions.newpageafter = 0
  601.     SectionOptions.keeptogether = 0
  602.     SectionOptions.suppressblanklines = 0
  603.     SectionOptions.resetPageNAfter = 0
  604.     SectionOptions.printatBottomOfPage = 0
  605. 'Get the Section formats and populate the Check Boxes
  606.    If PEGetSectionFormat(Jobnum, SectionCode, SectionOptions) = False Then
  607.       RCode = GetErrorString(Jobnum)
  608.       MsgBox "PEGetSectionFormat Error #: " + Str(ErrorCode) + " - " + RCode
  609.       MsgBox "You may not actually have the chosen section in your report!"
  610.       Exit Sub
  611.    Else
  612.         SectionCheck1.Value = SectionOptions.Visible
  613.         SectionCheck2.Value = SectionOptions.newpagebefore
  614.         SectionCheck3.Value = SectionOptions.newpageafter
  615.         SectionCheck4.Value = SectionOptions.keeptogether
  616.         SectionCheck5.Value = SectionOptions.suppressblanklines
  617.         SectionCheck6.Value = SectionOptions.resetPageNAfter
  618.         SectionCheck7.Value = SectionOptions.printatBottomOfPage
  619.         Main!StatusBar.Caption = "Retrieved the Section Formats"
  620.    End If
  621.    If PEGetMinimumSectionHeight(Jobnum, SectionCode, MinHeight) = False Then
  622.       RCode = GetErrorString(Jobnum)
  623.       MsgBox "PEGetMinimumSectionHeight Error #: " + Str(ErrorCode) + " - " + RCode
  624.    Else
  625.       SectionText1.Text = Str(MinHeight)
  626.    End If
  627.       
  628.    If PEGetLineHeight(Jobnum, SectionCode, NLine, LHeight, Ascent) = False Then
  629.       RCode = GetErrorString(Jobnum)
  630.       MsgBox "PEGetMinimumSectionHeight Error #: " + Str(ErrorCode) + " - " + RCode
  631.    Else
  632.      SectionText2.Text = Str(LHeight)
  633.    End If
  634.       
  635. End Sub
  636. Sub SectionDone_Click ()
  637.  Unload Me
  638. End Sub
  639. Sub SectionFileExit_Click ()
  640.  Unload Me
  641. End Sub
  642. Sub SectionHelp_Click ()
  643.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  644.  If RCode = False Then
  645.    MsgBox ("CRPE Demo cannot find the Crystal Help file in C:\CRW directory")
  646.  End If
  647. End Sub
  648. Sub SetFont_Click ()
  649.  Font.Show 1
  650. End Sub
  651. Sub SetFormat_Click ()
  652. ' Declarations
  653. Dim NLine As Integer
  654. 'Set the formatting options depending for various sections
  655.      
  656.     If Jobnum = 0 Then
  657.         MsgBox "No job open."
  658.         Exit Sub
  659.     End If
  660.     Dim SectionOptions As PESectionOptions
  661.     SectionOptions.StructSize = Len(SectionOptions)
  662.     SectionOptions.Visible = -(SectionCheck1.Value)
  663.     SectionOptions.newpagebefore = -(SectionCheck2.Value)
  664.     SectionOptions.newpageafter = -(SectionCheck3.Value)
  665.     SectionOptions.keeptogether = -(SectionCheck4.Value)
  666.     SectionOptions.suppressblanklines = -(SectionCheck5.Value)
  667.     SectionOptions.resetPageNAfter = -(SectionCheck6.Value)
  668.     SectionOptions.printatBottomOfPage = -(SectionCheck7.Value)
  669.    If PESetSectionFormat(Jobnum, SectionCode, SectionOptions) = False Then
  670.       RCode = GetErrorString(Jobnum)
  671.       MsgBox "PESetSectionFormat Error #: " + Str(ErrorCode) + " - " + RCode
  672.    Else
  673.         Main!StatusBar.Caption = "Section Format has been set!"
  674.    End If
  675.    If PESetMinimumSectionHeight(Jobnum, SectionCode, SectionText1.Text) = False Then
  676.       RCode = GetErrorString(Jobnum)
  677.       MsgBox "PESetMinimumSectionHeight Error #: " + Str(ErrorCode) + " - " + RCode
  678.    Else
  679.         Main!StatusBar.Caption = "Minimum Section Height has been set!"
  680.    End If
  681.    If LineHCheck.Value = False Then
  682.      NLine = -1
  683.    Else
  684.      NLine = SectionText3.Text
  685.    End If
  686.    If PESetLineHeight(Jobnum, SectionCode, NLine, SectionText2.Text, SectionText2.Text) = False Then
  687.       RCode = GetErrorString(Jobnum)
  688.       MsgBox "PESetLineHeight Error #: " + Str(ErrorCode) + " - " + RCode
  689.    Else
  690.         Main!StatusBar.Caption = "Line Height has been set!"
  691.    End If
  692. End Sub
  693.