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

  1. VERSION 2.00
  2. Begin Form GrphData 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Graph Layout"
  5.    ClientHeight    =   3450
  6.    ClientLeft      =   1530
  7.    ClientTop       =   2190
  8.    ClientWidth     =   6165
  9.    Height          =   3855
  10.    Left            =   1470
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3450
  13.    ScaleWidth      =   6165
  14.    Top             =   1845
  15.    Width           =   6285
  16.    Begin CommandButton LayoutClickHelp 
  17.       Caption         =   "Help"
  18.       Height          =   375
  19.       Left            =   3900
  20.       TabIndex        =   11
  21.       Top             =   2835
  22.       Width           =   1245
  23.    End
  24.    Begin CommandButton LayoutClickCancel 
  25.       Caption         =   "Cancel"
  26.       Height          =   375
  27.       Left            =   2490
  28.       TabIndex        =   10
  29.       Top             =   2835
  30.       Width           =   1275
  31.    End
  32.    Begin CommandButton LayoutClickOK 
  33.       Caption         =   "OK"
  34.       Height          =   375
  35.       Left            =   1080
  36.       TabIndex        =   9
  37.       Top             =   2835
  38.       Width           =   1275
  39.    End
  40.    Begin SSFrame Frame3D1 
  41.       Caption         =   "Layout"
  42.       Font3D          =   0  'None
  43.       ForeColor       =   &H00000000&
  44.       Height          =   2310
  45.       Left            =   180
  46.       TabIndex        =   0
  47.       Top             =   225
  48.       Width           =   5805
  49.       Begin CommandButton LayoutClickTip 
  50.          Caption         =   "Tip>>"
  51.          Height          =   330
  52.          Left            =   4110
  53.          TabIndex        =   12
  54.          Top             =   405
  55.          Width           =   1155
  56.       End
  57.       Begin TextBox Text4 
  58.          Height          =   330
  59.          Left            =   2250
  60.          TabIndex        =   4
  61.          Text            =   "Text4"
  62.          Top             =   1620
  63.          Width           =   1395
  64.       End
  65.       Begin TextBox Text3 
  66.          Height          =   330
  67.          Left            =   2250
  68.          TabIndex        =   3
  69.          Text            =   "Text3"
  70.          Top             =   1215
  71.          Width           =   1395
  72.       End
  73.       Begin TextBox Text2 
  74.          Height          =   330
  75.          Left            =   2250
  76.          TabIndex        =   2
  77.          Text            =   "Text2"
  78.          Top             =   810
  79.          Width           =   1395
  80.       End
  81.       Begin TextBox Text1 
  82.          Height          =   330
  83.          Left            =   2250
  84.          TabIndex        =   1
  85.          Text            =   "Text1"
  86.          Top             =   405
  87.          Width           =   1395
  88.       End
  89.       Begin Label Label4 
  90.          BackColor       =   &H00C0C0C0&
  91.          Caption         =   "Graph Direction:"
  92.          Height          =   240
  93.          Left            =   240
  94.          TabIndex        =   8
  95.          Top             =   1665
  96.          Width           =   1905
  97.       End
  98.       Begin Label Label3 
  99.          BackColor       =   &H00C0C0C0&
  100.          Caption         =   "Summarized Field #:"
  101.          Height          =   240
  102.          Left            =   240
  103.          TabIndex        =   7
  104.          Top             =   1260
  105.          Width           =   1905
  106.       End
  107.       Begin Label Label2 
  108.          BackColor       =   &H00C0C0C0&
  109.          Caption         =   "Column Group #:"
  110.          Height          =   240
  111.          Left            =   240
  112.          TabIndex        =   6
  113.          Top             =   855
  114.          Width           =   1905
  115.       End
  116.       Begin Label Label1 
  117.          BackColor       =   &H00C0C0C0&
  118.          Caption         =   "Row Group #:"
  119.          Height          =   240
  120.          Left            =   240
  121.          TabIndex        =   5
  122.          Top             =   450
  123.          Width           =   1875
  124.       End
  125.    End
  126. Sub Form_Load ()
  127. 'Declare Structure
  128.     Dim GraphDataInfo As PEGraphDataInfo
  129.     GraphDataInfo.StructSize = Len(GraphDataInfo)
  130.     GraphDataInfo.RowGroupN = 0
  131.     GraphDataInfo.ColGroupN = 0
  132.     GraphDataInfo.SummarizedFieldN = 0
  133.     GraphDataInfo.GraphDirection = 0
  134. 'Get the Graph Data back from existing graph in RPT file
  135. 'allow user to modify information
  136.     If PEGetGraphData(JobNum, SCode, GraphNo, GraphDataInfo) = 1 Then
  137.         Text1.Text = GraphDataInfo.RowGroupN
  138.         Text2.Text = GraphDataInfo.ColGroupN
  139.         Text3.Text = GraphDataInfo.SummarizedFieldN
  140.         Text4.Text = GraphDataInfo.GraphDirection
  141.     Else
  142.       RCode = GetErrorString(JobNum)
  143.       MsgBox "PEGetGraphData Error #: " + Str(ErrorCode) + " - " + RCode
  144.       Exit Sub
  145.     End If
  146. End Sub
  147. Sub LayoutClickCancel_Click ()
  148.  Unload Me
  149. End Sub
  150. Sub LayoutClickHelp_Click ()
  151.   RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  152. End Sub
  153. Sub LayoutClickOK_Click ()
  154. 'Declare Structure and populate with user input
  155.     Dim GraphDataInfo As PEGraphDataInfo
  156.     GraphDataInfo.StructSize = Len(GraphDataInfo)
  157.     GraphDataInfo.RowGroupN = Val(Text1.Text)
  158.     GraphDataInfo.ColGroupN = Val(Text2.Text)
  159.     GraphDataInfo.SummarizedFieldN = Val(Text3.Text)
  160.     GraphDataInfo.GraphDirection = Val(Text4.Text)
  161. 'Set the Graph Data(Layout) via the user input in the dialogue
  162.     If PESetGraphData(JobNum, SCode, GraphNo, GraphDataInfo) = False Then
  163.       RCode = GetErrorString(JobNum)
  164.       MsgBox "PESetGraphData Error #: " + Str(ErrorCode) + " - " + RCode
  165.       Exit Sub
  166.     Else
  167.       Main!StatusBar.Caption = "Graph Layout Set."
  168.     End If
  169. 'Unload the form
  170.     Unload Me
  171. End Sub
  172. Sub LayoutClickTip_Click ()
  173. 'Declarations
  174.     Dim Response As Integer
  175.     Dim RCode As Integer
  176. 'Allow user to open CRPEDEMO.TXT file if they choose.
  177. 'If the user chooses yes from the message box they will automatically
  178. 'be shelled to notepad with the appropriate text file opened
  179.     Response = MsgBox("A Graph Layout Tip is included in the CRPEDEMO.TXT. Would you like to view the text file now?", 4, "Graph Type Tip")
  180.     If Response = 6 Then
  181.        'shell to notepad
  182.        CRPEDemoPath$ = "NOTEPAD.EXE " & app.Path & "\crpedemo.txt"
  183.        RCode = Shell(CRPEDemoPath$, 3)
  184.        
  185.     Else
  186.       Exit Sub
  187.     End If
  188. End Sub
  189.