home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / crpedemo / section.frm < prev    next >
Text File  |  1994-12-14  |  25KB  |  775 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. End
  308.  
  309. Sub Command1_Click ()
  310.   'Set the formatting options depending for various sections
  311.      
  312.     If Jobnum = 0 Then
  313.         MsgBox "No job open."
  314.         Exit Sub
  315.     End If
  316.  
  317.     Dim SectionOptions As PESectionOptions
  318.     SectionOptions.StructSize = Len(SectionOptions)
  319.     'SectionOptions.Visible = -(Check3D1.Value)
  320.     'SectionOptions.newPageBefore = -(Check3D2.Value)
  321.     'SectionOptions.newPageAfter = -(Check3D3.Value)
  322.     'SectionOptions.keepTogether = -(Check3D4.Value)
  323.     'SectionOptions.suppressBlankLines = -(Check3D5.Value)
  324.     'SectionOptions.resetPageNAfter = -(Check3D6.Value)
  325.     'SectionOptions.printAtBottomOfPage = -(Check3D7.Value)
  326.  
  327.    If PESetSectionFormat(Jobnum, SectionCode, SectionOptions) = False Then
  328.       RCode = GetErrorString(Jobnum)
  329.       MsgBox "PESetSectionFormat Error #: " + Str(ErrorCode) + " - " + RCode
  330.    End If
  331.    Exit Sub
  332.    
  333.  
  334. End Sub
  335.  
  336. Sub Command2_Click ()
  337.  Unload Me
  338. End Sub
  339.  
  340. Sub Command3_Click ()
  341.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  342.  If RCode = False Then
  343.    MsgBox ("RedPoint cannot find the Crystal Help file in C:\CRW directory")
  344.  End If
  345.   
  346. End Sub
  347.  
  348. Sub Form_Load ()
  349.  
  350. 'declare variables
  351.  
  352. Dim NGroups As Integer
  353.  
  354. 'Check if jobnumber is open
  355.  
  356. If Jobnum = 0 Then
  357.   MsgBox "No Job Open"
  358.   Exit Sub
  359. End If
  360.  
  361. 'Get the Number of groups in Report
  362.  
  363. NGroups = PEGetNGroups(Jobnum)
  364.  
  365. ' Populate combo list box depending on the number of groups in the report
  366.  
  367. If NGroups = 0 Then
  368.   
  369.   SectionCombo.AddItem "Title"
  370.   SectionCombo.AddItem "Page Header"
  371.   SectionCombo.AddItem "Details"
  372.   SectionCombo.AddItem "Page Footer"
  373.   SectionCombo.AddItem "Grand Total"
  374.   SectionCombo.AddItem "Summary"
  375. Else
  376.   If NGroups = 1 Then
  377.     
  378.     SectionCombo.AddItem "Title"
  379.     SectionCombo.AddItem "Page Header"
  380.     SectionCombo.AddItem "Group Header 1"
  381.     SectionCombo.AddItem "Details"
  382.     SectionCombo.AddItem "Group Footer 1"
  383.     SectionCombo.AddItem "Page Footer"
  384.     SectionCombo.AddItem "Grand Total"
  385.     SectionCombo.AddItem "Summary"
  386.   Else
  387.     If NGroups = 2 Then
  388.       
  389.       SectionCombo.AddItem "Title"
  390.       SectionCombo.AddItem "Page Header"
  391.       SectionCombo.AddItem "Group Header 1"
  392.       SectionCombo.AddItem "Group Header 2"
  393.       SectionCombo.AddItem "Details"
  394.       SectionCombo.AddItem "Group Footer 1"
  395.       SectionCombo.AddItem "Group Header 2"
  396.       SectionCombo.AddItem "Grand Total"
  397.       SectionCombo.AddItem "Page Footer"
  398.       SectionCombo.AddItem "Summary"
  399.     Else
  400.       If NGroups = 3 Then
  401.         
  402.         SectionCombo.AddItem "Title"
  403.         SectionCombo.AddItem "Page Header"
  404.         SectionCombo.AddItem "Group Header 1"
  405.         SectionCombo.AddItem "Group Header 2"
  406.         SectionCombo.AddItem "Group Header 3"
  407.         SectionCombo.AddItem "Details"
  408.         SectionCombo.AddItem "Group Footer 1"
  409.         SectionCombo.AddItem "Group Header 2"
  410.         SectionCombo.AddItem "Group Header 3"
  411.         SectionCombo.AddItem "Grand Total"
  412.         SectionCombo.AddItem "Page Footer"
  413.         SectionCombo.AddItem "Summary"
  414.       Else
  415.         If NGroups = 4 Then
  416.          
  417.          SectionCombo.AddItem "Title"
  418.          SectionCombo.AddItem "Page Header"
  419.          SectionCombo.AddItem "Group Header 1"
  420.          SectionCombo.AddItem "Group Header 2"
  421.          SectionCombo.AddItem "Group Header 3"
  422.          SectionCombo.AddItem "Group Header 4"
  423.          SectionCombo.AddItem "Details"
  424.          SectionCombo.AddItem "Group Footer 1"
  425.          SectionCombo.AddItem "Group Header 2"
  426.          SectionCombo.AddItem "Group Header 3"
  427.          SectionCombo.AddItem "Group Header 4"
  428.          SectionCombo.AddItem "Grand Total"
  429.          SectionCombo.AddItem "Page Footer"
  430.          SectionCombo.AddItem "Summary"
  431.         End If
  432.       End If
  433.     End If
  434.   End If
  435. End If
  436.  
  437.  
  438.  
  439.  
  440.  
  441. End Sub
  442.  
  443. Sub LineHCheck_Click (Value As Integer)
  444. If LineHCheck.Value = True Then
  445.   Label4.Visible = True
  446.   SectionText3.Visible = True
  447. End If
  448.  
  449. End Sub
  450.  
  451. Sub MenuFileExit_Click ()
  452.  Unload Me
  453. End Sub
  454.  
  455. Sub SectionCombo_Change ()
  456. MsgBox "Please Choose from the Drop Down list Provided"
  457. Exit Sub
  458.  
  459.  
  460.  
  461. End Sub
  462.  
  463. Sub SectionCombo_Click ()
  464.  
  465. 'Declare Variables
  466.  
  467. Dim MinHeight As Integer
  468. Dim LHeight As Integer
  469. Dim NLine As Integer
  470. Dim Ascent As Integer
  471.  
  472.  
  473. 'Assign Variables
  474.  
  475. NLine = 0
  476. SectionText3.Text = NLine
  477.  
  478. 'Enable Set format and Set font Buttons
  479.  
  480. SetFont.Enabled = True
  481. SetFormat.Enabled = True
  482.  
  483. If SectionCombo.Text = "Title" Then
  484.   SectionCode = 1000
  485.   SectionCheck1.Enabled = True
  486.   SectionCheck2.Enabled = True
  487.   SectionCheck3.Enabled = True
  488.   SectionCheck4.Enabled = True
  489.   SectionCheck5.Enabled = True
  490.   SectionCheck6.Enabled = True
  491.   SectionCheck7.Enabled = True
  492. Else
  493.   If SectionCombo.Text = "Page Header" Then
  494.     SectionCode = 2000
  495.     SectionCheck1.Enabled = True
  496.     SectionCheck2.Enabled = False
  497.     SectionCheck3.Enabled = False
  498.     SectionCheck4.Enabled = False
  499.     SectionCheck5.Enabled = True
  500.     SectionCheck6.Enabled = False
  501.     SectionCheck7.Enabled = False
  502.   Else
  503.     If SectionCombo.Text = "Group Header 1" Then
  504.       SectionCode = 3000
  505.       SectionCheck1.Enabled = True
  506.       SectionCheck2.Enabled = True
  507.       SectionCheck3.Enabled = True
  508.       SectionCheck4.Enabled = True
  509.       SectionCheck5.Enabled = True
  510.       SectionCheck6.Enabled = True
  511.       SectionCheck7.Enabled = True
  512.  
  513.     Else
  514.       If SectionCombo.Text = "Group Header 2" Then
  515.         SectionCode = 3001
  516.         SectionCheck1.Enabled = True
  517.         SectionCheck2.Enabled = True
  518.         SectionCheck3.Enabled = True
  519.         SectionCheck4.Enabled = True
  520.         SectionCheck5.Enabled = True
  521.         SectionCheck6.Enabled = True
  522.         SectionCheck7.Enabled = True
  523.  
  524.       Else
  525.         If SectionCombo.Text = "Group Header 3" Then
  526.           SectionCode = 3002
  527.           SectionCheck1.Enabled = True
  528.           SectionCheck2.Enabled = True
  529.           SectionCheck3.Enabled = True
  530.           SectionCheck4.Enabled = True
  531.           SectionCheck5.Enabled = True
  532.           SectionCheck6.Enabled = True
  533.           SectionCheck7.Enabled = True
  534.            
  535.         Else
  536.           If SectionCombo.Text = "Group Header 4" Then
  537.             SectionCode = 3003
  538.             SectionCheck1.Enabled = True
  539.             SectionCheck2.Enabled = True
  540.             SectionCheck3.Enabled = True
  541.             SectionCheck4.Enabled = True
  542.             SectionCheck5.Enabled = True
  543.             SectionCheck6.Enabled = True
  544.             SectionCheck7.Enabled = True
  545.  
  546.           Else
  547.             If SectionCombo.Text = "Details" Then
  548.               SectionCode = 4000
  549.               SectionCheck1.Enabled = True
  550.               SectionCheck2.Enabled = True
  551.               SectionCheck3.Enabled = True
  552.               SectionCheck4.Enabled = True
  553.               SectionCheck5.Enabled = True
  554.               SectionCheck6.Enabled = True
  555.               SectionCheck7.Enabled = True
  556.  
  557.             Else
  558.               If SectionCombo.Text = "Group Footer 1" Then
  559.                 SectionCode = 5000
  560.                 SectionCheck1.Enabled = True
  561.                 SectionCheck2.Enabled = True
  562.                 SectionCheck3.Enabled = True
  563.                 SectionCheck4.Enabled = True
  564.                 SectionCheck5.Enabled = True
  565.                 SectionCheck6.Enabled = True
  566.                 SectionCheck7.Enabled = True
  567.  
  568.               Else
  569.                 If SectionCombo.Text = "Group Footer 2" Then
  570.                   SectionCode = 5001
  571.                   SectionCheck1.Enabled = True
  572.                   SectionCheck2.Enabled = True
  573.                   SectionCheck3.Enabled = True
  574.                   SectionCheck4.Enabled = True
  575.                   SectionCheck5.Enabled = True
  576.                   SectionCheck6.Enabled = True
  577.                   SectionCheck7.Enabled = True
  578.  
  579.                 Else
  580.                   If SectionCombo.Text = "Group Footer 3" Then
  581.                     SectionCode = 5002
  582.                     SectionCheck1.Enabled = True
  583.                     SectionCheck2.Enabled = True
  584.                     SectionCheck3.Enabled = True
  585.                     SectionCheck4.Enabled = True
  586.                     SectionCheck5.Enabled = True
  587.                     SectionCheck6.Enabled = True
  588.                     SectionCheck7.Enabled = True
  589.  
  590.                   Else
  591.                     If SectionCombo.Text = "Group Footer 4" Then
  592.                       SectionCode = 5003
  593.                       SectionCheck1.Enabled = True
  594.                       SectionCheck2.Enabled = True
  595.                       SectionCheck3.Enabled = True
  596.                       SectionCheck4.Enabled = True
  597.                       SectionCheck5.Enabled = True
  598.                       SectionCheck6.Enabled = True
  599.                       SectionCheck7.Enabled = True
  600.                            
  601.                     Else
  602.                       If SectionCombo.Text = "Grand Total" Then
  603.                         SectionCode = 6000
  604.                         SectionCheck1.Enabled = True
  605.                         SectionCheck2.Enabled = True
  606.                         SectionCheck3.Enabled = True
  607.                         SectionCheck4.Enabled = True
  608.                         SectionCheck5.Enabled = True
  609.                         SectionCheck6.Enabled = True
  610.                         SectionCheck7.Enabled = True
  611.  
  612.                       Else
  613.                         If SectionCombo.Text = "Page Footer" Then
  614.                           SectionCode = 7000
  615.                           SectionCheck1.Enabled = True
  616.                           SectionCheck2.Enabled = False
  617.                           SectionCheck3.Enabled = False
  618.                           SectionCheck4.Enabled = False
  619.                           SectionCheck5.Enabled = True
  620.                           SectionCheck6.Enabled = False
  621.                           SectionCheck7.Enabled = False
  622.  
  623.                         Else
  624.                           If SectionCombo.Text = "Summary" Then
  625.                             SectionCode = 8000
  626.                             SectionCheck1.Enabled = True
  627.                             SectionCheck2.Enabled = True
  628.                             SectionCheck3.Enabled = True
  629.                             SectionCheck4.Enabled = True
  630.                             SectionCheck5.Enabled = True
  631.                             SectionCheck6.Enabled = True
  632.                             SectionCheck7.Enabled = True
  633.  
  634.                           End If
  635.                         End If
  636.                       End If
  637.                     End If
  638.                   End If
  639.                 End If
  640.               End If
  641.             End If
  642.           End If
  643.         End If
  644.       End If
  645.     End If
  646.   End If
  647. End If
  648.  
  649.  
  650.  
  651. 'Populate Check boxes depending on which section was chosen from Combo list box
  652.  
  653.     Dim SectionOptions As PESectionOptions
  654.     SectionOptions.StructSize = Len(SectionOptions)
  655.     SectionOptions.Visible = 0
  656.     SectionOptions.newpagebefore = 0
  657.     SectionOptions.newpageafter = 0
  658.     SectionOptions.keeptogether = 0
  659.     SectionOptions.suppressblanklines = 0
  660.     SectionOptions.resetPageNAfter = 0
  661.     SectionOptions.printatBottomOfPage = 0
  662.  
  663. 'Get the Section formats and populate the Check Boxes
  664.    If PEGetSectionFormat(Jobnum, SectionCode, SectionOptions) = False Then
  665.       RCode = GetErrorString(Jobnum)
  666.       MsgBox "PEGetSectionFormat Error #: " + Str(ErrorCode) + " - " + RCode
  667.       MsgBox "You may not actually have the chosen section in your report!"
  668.       Exit Sub
  669.    Else
  670.         SectionCheck1.Value = SectionOptions.Visible
  671.         SectionCheck2.Value = SectionOptions.newpagebefore
  672.         SectionCheck3.Value = SectionOptions.newpageafter
  673.         SectionCheck4.Value = SectionOptions.keeptogether
  674.         SectionCheck5.Value = SectionOptions.suppressblanklines
  675.         SectionCheck6.Value = SectionOptions.resetPageNAfter
  676.         SectionCheck7.Value = SectionOptions.printatBottomOfPage
  677.         Main!StatusBar.Caption = "Retrieved the Section Formats"
  678.    End If
  679.  
  680.    If PEGetMinimumSectionHeight(Jobnum, SectionCode, MinHeight) = False Then
  681.       RCode = GetErrorString(Jobnum)
  682.       MsgBox "PEGetMinimumSectionHeight Error #: " + Str(ErrorCode) + " - " + RCode
  683.    Else
  684.       SectionText1.Text = Str(MinHeight)
  685.    End If
  686.       
  687.    
  688.    If PEGetLineHeight(Jobnum, SectionCode, NLine, LHeight, Ascent) = False Then
  689.       RCode = GetErrorString(Jobnum)
  690.       MsgBox "PEGetMinimumSectionHeight Error #: " + Str(ErrorCode) + " - " + RCode
  691.    Else
  692.      SectionText2.Text = Str(LHeight)
  693.    End If
  694.       
  695.  
  696. End Sub
  697.  
  698. Sub SectionDone_Click ()
  699.  Unload Me
  700.  
  701.  
  702. End Sub
  703.  
  704. Sub SectionFileExit_Click ()
  705.  Unload Me
  706. End Sub
  707.  
  708. Sub SectionHelp_Click ()
  709.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  710.  If RCode = False Then
  711.    MsgBox ("CRPE Demo cannot find the Crystal Help file in C:\CRW directory")
  712.  End If
  713.  
  714. End Sub
  715.  
  716. Sub SetFont_Click ()
  717.  Font.Show 1
  718.   
  719. End Sub
  720.  
  721. Sub SetFormat_Click ()
  722.  
  723. ' Declarations
  724.  
  725. Dim NLine As Integer
  726.  
  727. 'Set the formatting options depending for various sections
  728.      
  729.     If Jobnum = 0 Then
  730.         MsgBox "No job open."
  731.         Exit Sub
  732.     End If
  733.  
  734.     Dim SectionOptions As PESectionOptions
  735.     SectionOptions.StructSize = Len(SectionOptions)
  736.     SectionOptions.Visible = -(SectionCheck1.Value)
  737.     SectionOptions.newpagebefore = -(SectionCheck2.Value)
  738.     SectionOptions.newpageafter = -(SectionCheck3.Value)
  739.     SectionOptions.keeptogether = -(SectionCheck4.Value)
  740.     SectionOptions.suppressblanklines = -(SectionCheck5.Value)
  741.     SectionOptions.resetPageNAfter = -(SectionCheck6.Value)
  742.     SectionOptions.printatBottomOfPage = -(SectionCheck7.Value)
  743.  
  744.    If PESetSectionFormat(Jobnum, SectionCode, SectionOptions) = False Then
  745.       RCode = GetErrorString(Jobnum)
  746.       MsgBox "PESetSectionFormat Error #: " + Str(ErrorCode) + " - " + RCode
  747.    Else
  748.         Main!StatusBar.Caption = "Section Format has been set!"
  749.    End If
  750.  
  751.    If PESetMinimumSectionHeight(Jobnum, SectionCode, SectionText1.Text) = False Then
  752.       RCode = GetErrorString(Jobnum)
  753.       MsgBox "PESetMinimumSectionHeight Error #: " + Str(ErrorCode) + " - " + RCode
  754.    Else
  755.         Main!StatusBar.Caption = "Minimum Section Height has been set!"
  756.    End If
  757.  
  758.    If LineHCheck.Value = False Then
  759.      NLine = -1
  760.    Else
  761.      NLine = SectionText3.Text
  762.    End If
  763.  
  764.    If PESetLineHeight(Jobnum, SectionCode, NLine, SectionText2.Text, SectionText2.Text) = False Then
  765.       RCode = GetErrorString(Jobnum)
  766.       MsgBox "PESetLineHeight Error #: " + Str(ErrorCode) + " - " + RCode
  767.    Else
  768.         Main!StatusBar.Caption = "Line Height has been set!"
  769.    End If
  770.    
  771.  
  772.   
  773. End Sub
  774.  
  775.