home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / repease / dmo_vbx.frm (.txt) < prev    next >
Visual Basic Form  |  1995-07-19  |  17KB  |  370 lines

  1. Demo - ReportEase Plus
  2. Form15K
  3. Picture1
  4. ReportEasePlus
  5. &Edit
  6. &Exit
  7. edit_Click
  8. tempX
  9. FormEdit<
  10.     Form_Load:
  11. hBuffer!
  12. DemoFile
  13. iFile?
  14. BufLen
  15. FileString
  16.     ErrorCode4
  17. ErrorHandlerW
  18. FileName(
  19. CurWnd
  20. StrToHandle
  21. DemoText|
  22. FielLen
  23.     FormParam_
  24. TypeFormB
  25. width
  26. height
  27. DataSetName
  28. ShowMenu
  29. ShowHorBar
  30. ShowVerBar
  31.     hParenWnd
  32. Rep1_Click
  33. Rep14
  34. hInst
  35.     hPrevInst
  36. hFrWnd
  37. styleX
  38. WS_OVERLAPPEDWINDOWU
  39. FontTypeFaceu
  40. RvbFormb
  41. hParentWnd
  42. screen
  43. TwipsPerPixelX
  44. TwipsPerPixelY
  45. Rep1_SelectField
  46. field
  47.     TypeField
  48. RvbGetCurField
  49. RvbSetCurField'
  50.     SortLevel
  51. FormParmw
  52. RepParm
  53. SwapDir
  54. DataFilec
  55.     MAX_FILES
  56. ReadFields
  57. FileNo
  58.     FieldName
  59. TextLine
  60. CharReturn<
  61. CurLeno
  62. CurFieldo
  63. LineIdx
  64. DataFiel
  65.     READ_LINE
  66.     DataField
  67.     ShortName]
  68. FullName7
  69.     FieldType
  70.     DecPlaces
  71. FieldNo
  72.     TYPE_TEXT1
  73. TYPE_NUM
  74. TYPE_DBL
  75.     TYPE_DATE
  76. TYPE_LOGICALi
  77. TotalFieldsG
  78. OpenNo
  79. iFileNo
  80. Message
  81. MessageBox
  82. GetFormSelection@
  83. TotalForms
  84. GetFormFiles
  85. EditingForm-
  86. report
  87. template]
  88. wildcard    
  89. ATTR_NORMALy
  90. FormHdr 
  91. TypeFormHdr4
  92. ErrorGetFormFiles
  93. FormSign
  94.     FORM_SIGNV
  95. FormNameI
  96.     MAX_FORMSN
  97.     selection<
  98.     NewReportH
  99. FormFile
  100.     DlgResult
  101.     FormaEdit
  102. Sshow
  103.     FormEdit1
  104. Rep1_Unload
  105. CurFile
  106. result
  107.     FormField
  108. DlgRe
  109. ParaChar
  110. FileIdx
  111. FieldId
  112. FrmEdit
  113. FrmFile
  114. FrmField
  115. Rep1_VerifyField
  116. MaxFilesk
  117. DiscardNull
  118. Exit_Click
  119.     Run_Click
  120. SubFormParm
  121. RvbInit
  122. device
  123. RepP>
  124. PrepareFile
  125. PrintRecords
  126. RvbExit
  127. RvbGetFormFieldS
  128. RvbSetFormField
  129. SortFieldNo#
  130. SalesFileUsed
  131. SortCommand^    
  132. TempString
  133. JoinCommand/    
  134. TotalSortFieldsf
  135. RvbGetSortField
  136. RvbGetDataField
  137. break
  138. RecoNo
  139. PrintRecordHandler
  140. PrintRecordsHandler
  141. READ_RECORD;    
  142.     TempValueL    
  143. value
  144. RvbSetTextField
  145. RvbSetNumFieldi
  146. source
  147. SRC_APPL,
  148.     DataValueH
  149. RvbSetDblField
  150. RvbRec
  151. RvbSetDoubleField
  152. RepParam
  153.     TYPE_PICT
  154. Rep1_DrawPicture
  155. hDCv    
  156. PictId
  157.     PictWidth
  158. RectHeight
  159. RectX
  160. RextY
  161. RvbGetPictureInfo
  162. RectY
  163.     RectWidthj    
  164. context
  165. Picture
  166.     rectangle
  167. Picture1_Click
  168. Picture1
  169. RvbDrawBitmapU    
  170. image
  171. PictX
  172. PictInfo
  173. TypePict
  174. PictFieldId
  175. PictY
  176. PictHeight
  177. FileSort
  178. SortFields
  179. SortFielNo
  180. FileJoin
  181. KeyFieldNo
  182.     KeyFielNo
  183. edit_Click
  184.  check if ReportEase already active!
  185. A Form Editor Window Already Open!
  186. select a report template to edit
  187.  A form selected
  188.  specify the file name
  189. Error calling the Form Editor!
  190. Exit_Click
  191. Form_Load
  192.  Initialize the form editor input structurei
  193.  form editor not yet openo
  194.  x position in pixel units
  195.  y position in pixel units
  196.  width and height in pixel units
  197.  no file name yet 
  198. CUSTOMER
  199.  data set name
  200.  show menu bar
  201.  show horizontal scroll baro
  202.  show vertical scroll bars
  203.  RvbForm function fills in the editor window handlet
  204.  Handle of the RE control window
  205.  editor window style
  206.  use default type face
  207.  Initialize the report input parameter structure
  208.  control window handle
  209.  window stylew
  210.  default swap directorye
  211.  set the demo data file names and read the field names
  212. CUSTOMER
  213. SALES
  214.  load the customer logo bitmap
  215. LOGO.BMP
  216. GetFormFiles
  217.   This function returns the form files found in the 
  218.   current directory.  It also reads each file to get
  219.   the report description from the file
  220.  file number
  221.  oprn and read the file header
  222.  add to the list
  223.  get the next file
  224.  get the next file
  225. GetFormSelection
  226.   This routine displays the report template available in
  227.   the current directory and lets use select a file to 
  228.   edit.u
  229.  initialize the file namee
  230.  total form filesz
  231.  accumulate the files with the .FP extension
  232.  add new report option to form selection
  233.  index of the new report optionn
  234. New Report Form
  235. PrepareFile
  236.  This routine sorts the CUSTOMER file.  It also creates 
  237.  a combined by joining the sorted CUSTOMER file and the 
  238.  SALES file 
  239.  sort the customer filee
  240.  Get the sort fields
  241. get the sort field namee
  242.       KeyFieldNo(i) = field.FieldId + 1
  243.  The sorted records are stored in the CUSTOMER.SRT file
  244.  Check if the SALES file is used for this report
  245.  get the field information
  246.  do not need to join the sales filei
  247.  Join the SALES.DB file to the CUSTOMER.SRT file
  248.  These two files have the first common field (customer id)
  249.  The output records are stored in the CUSTOMER.SRT filei
  250. PrintRecords
  251.   This routine reads each record from the sorted data file
  252.   (CUSTOMER.SRT) and fills the values for the report fields
  253.   and calls the RvbRec function pass the data to the
  254.   report executor.
  255.  open the sorted data file
  256.  Check if SALES data file is usedX
  257.  Initialize the field structuret
  258.  read fields values for the next record*
  259.  Pass this data field to the VBX
  260.  pass picture id
  261.  Print the record
  262.  user aborted the report
  263. ReadFields
  264.   This routine reads the field definition file for the
  265.   specified file and extracts the individual field names
  266.   and field properties.t
  267.  open the field definition file
  268. field definition filef
  269.  construct other fields
  270.  increment the field no=
  271. Rep1_DrawPicture
  272.  This event is fired by the ReportExecutor when it needs
  273.  your application to draw a picture.  This routine calls
  274.  the RvbGetPictureInfo function to get the report device
  275.  context, picture id, and rectangle locaton and size where
  276.  the picture is to be drawn. This function also returnse
  277.  the file and field id for the picture field (this demoe
  278.  program does not use these two fields).
  279.  This demo program draw different part of the same bitmap
  280.  for different picture id.
  281.  get the report device context and picture rectangle
  282.  specify part of the bitmap to print as a percentage of the width and height
  283. starting X location*
  284. always print only 10 percent of the bitmap
  285.  print the entire height
  286.  The following statment uses the RvbDrawBitmap functiont
  287.  to draw a part of the logo.bmp file.  The logo.bmpt
  288.  bitmap file is loaded into the 'Picture1' control.t
  289.  The 'AutoSize' property of the picture control MUST
  290.  be TRUE so that the control does not clip the
  291.  bitmap.
  292.    temp = RvbDrawBitmap(Rep1.hWnd, Picture1.hWnd,Picture1.image, PictX, PictY, PictWidth, PictHeight)
  293. Rep1_SelectField
  294.   This function responds to the field selection event.
  295.   This routine can be programmed by your application in
  296.   any way as long as it returns the data about the selected*
  297.   field using the RvbGetFormField/RvbSetFormField functions.
  298.   In this routine we will allow the user to first select a file and then
  299.   select a field from the chosen file.  The required data about the selected
  300.   field is filled into the 'field' structure variable and passed over to
  301.   ReportEase using the RvbSetFormField function.
  302.   The 'SortLevel' parameter of the RvbGetFormField funtion
  303.   specified the sort level if this field will be used for 
  304.   a section break.  If your application will not sort on all
  305.   fields, you can restrict the fields that can be selected by the user.e
  306.   For a non-sort field, this parameter is set to 0.  In this
  307.   demo program, we will allow only the fields from the primary
  308.   file (CUSTOMER) to be used as sort fields.
  309.  get the input field structure
  310.  select regular data field
  311.  select a data file 
  312.  select a data field
  313.  select sort field
  314.  sort field from the CUSTOMER file onlyi
  315.  select a data field
  316.  return the result
  317.  pass the basic field informationn
  318.  NULL terminate a string
  319.  specify new paragraph indicator field.  Use only 
  320.  for a word-wrapped text type fields
  321.  Fill up these OPTIONAL fields also.  This information
  322.  will be used by our report generator demo program
  323.  to identify the fields quickly.
  324. Rep1_Unload
  325.  indicate the ReportEase as closed
  326. Rep1_VerifyField
  327.  This event is fired by the VBX to validate a field. The
  328.  field data should be retrieved by using the g
  329.  RvbGetFormField function call. The field name in then
  330.  'field' structure contains the file prefix (if your  
  331.  application allows it).  The field name is always in 
  332.  the upper case.  This routine should fill the requirede
  333.  data about the field.  Your program may also fill the
  334.  remaining 'field' structure variables.y
  335.  The RvbGetFormField function also returns the sort leveln
  336.  for the field, if the field is being used for sort break.
  337.  The value of 1 indicates the first sort field, 2 the second, ...a
  338.  The 0 value for SortLevel indicates that the field is
  339.  not used for sort break. 
  340.  In this demo program, we will allow only the fields from
  341.  the primary file (CUSTOMER) to be used as sort fields.r
  342.  This routine returns a True value using the RvbSetFormField
  343.  if the field is valid.  Otherwise it returns a FALSE value.
  344.  discard the NULL character from the field name*
  345.  test every file
  346.  test every field for a file
  347.  note that 'name' in the 'field' structure ise
  348.  terminated by a NULL characterc
  349.  specify new paragraph indicator field.  Use only.
  350.  for a word-wrapped text type fields
  351.  Fill up these OPTIONAL fields also.  This information
  352.  will be used by our report generator demo program
  353.  to identify the fields quickly.
  354. Run_Click
  355.  check if ReportEase already active*
  356. A Form Editor Window Already Open!
  357. select a report template to edit
  358.  a form not selected
  359.  fill the report parameter structure
  360.  specify the file name
  361.  output device, A = Ask User
  362.  output window location 
  363.  output window width
  364.  output window height
  365.  Initialize the report executor 
  366.  initialize the report
  367.  prepare the datafile for output
  368.  Feed the records to the report executor
  369.  Close the report executor
  370.