home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / Tools / Developers / CRWRAP.BAS < prev    next >
Encoding:
BASIC Source File  |  2002-06-19  |  28.3 KB  |  397 lines

  1. Attribute VB_Name = "crwrap"
  2. '
  3. '               Visual Basic Declarations of crwrap32.DLL
  4. '               =====================================
  5. '
  6. '       File:         crwrap.BAS
  7. '
  8. '       Author:       Seagate Software Information Management Group, Inc.
  9. '
  10. '
  11. '       Language:     Visual Basic for Windows
  12. '
  13. '       Copyright (c) 1992 - 2002 Seagate Software Information Management Group, Inc.
  14. '
  15. '       Revisions:
  16. '       SM- Nov 99, removed obsolete exporting formats
  17. '           Excel 2.1
  18. '            Global Const crUXFXls2Type% = 0
  19. '           Excel 3.0
  20. '            Global Const crUXFXls3Type% = 1
  21. '           Excel 4.0
  22. '            Global Const crUXFXls4Type% = 2
  23. '           HTML 3.0
  24. '            Global Const crUXFHTML3Type% = 0   ' Draft HTML 3.0 tags
  25. '
  26. '       RM - June 02, Changed references to crwrap dll to include full path
  27. '
  28. '
  29. '================================================================================
  30. ' Constants and Function Definitions for Exporting
  31. '================================================================================
  32. '******************
  33. '** Format Types **
  34. '******************
  35.  
  36. 'Separated Values           (DLL: "uxfsepv.dll")
  37. Global Const crUXFCharSeparatedType% = 100
  38. Global Const crUXFCommaSeparatedType% = 200
  39. Global Const crUXFTabSeparatedType% = 300
  40.  
  41. 'Data Interchange Format    (DLL: "uxfdif.dll")
  42. Global Const crUXFDIFType% = 400
  43.  
  44. 'Record Style Format        (DLL: "uxfrec.dll")
  45. Global Const crUXFRecordType% = 500
  46.  
  47.  
  48. 'Crystal Report             (DLL: "uxfcr.dll")
  49. Global Const crUXFCrystalReportType% = 0
  50.  
  51. 'RTF                        (DLL: "uxfrtf.dll")
  52. Global Const crUXFRichTextFormatType% = 0
  53.  
  54. 'Text                       (DLL: "uxftext.dll")
  55. Global Const crUXFTextType% = 0
  56. Global Const crUXFTabbedTextType% = 1
  57. Global Const crUXFPaginatedTextType% = 600
  58.  
  59. 'Lotus                      (DLL: "uxfwks.dll")
  60. Global Const crUXFLotusWksType% = 0 ' Lotus 123 (WKS)
  61. Global Const crUXFLotusWk1Type% = 1 ' Lotus 123(WK1)
  62. Global Const crUXFLotusWk3Type% = 2
  63.  
  64. 'Word for Windows           (DLL: "uxfwordw.dll")
  65. Global Const crUXFWordWinType% = 0
  66.  
  67. 'Excel                      (DLL: "uxfxls.dll")
  68. Global Const crUXFXls5Type% = 3
  69. Global Const crUXFXls5TypeTab% = 700
  70.  
  71. 'Report Definition          (DLL: "uxfrdef.dll")
  72. Global Const crUXFReportDefinitionType = 0
  73.  
  74. #If Win16 Then
  75. 'Word for DOS & WordPerfect (DLL: "uxfdoc.dll")
  76. Global Const crUXFWordDosType% = 1
  77. Global Const crUXFWordPerfectType% = 2
  78.  
  79. 'Quattro Pro                (DLL: "uxfqp.dll")
  80. Global Const crUXFQP5Type% = 0
  81.  
  82. #End If
  83.  
  84. '****************
  85. '** HTML Types **
  86. '****************
  87.  
  88. 'HTML
  89. Global Const crUXFExplorer2Type% = 1             ' Include MS Explorer 2.0 tags
  90. Global Const crUXFNetscape2Type% = 2             ' Include Netscape 2.0 tags
  91. Global Const crUXFHTML32ExtType% = 1             ' HTML 3.2 tags + bg color extensions
  92. Global Const crUXFHTML32StdType% = 2             ' HTML 3.2 tags
  93.  
  94.  
  95. 'DateTime structure
  96. Type crDateTime
  97.     crDate As Long
  98.     crTime As Long
  99. End Type
  100.  
  101.  
  102. 'Devmode structure
  103. Type crDEVMODE
  104.     dmDriverVersion As Integer  ' printer driver version number (usually not required)
  105. #If Win16 Then                  ' add padding so it aligns the same way under both 16-bit and 32-bit environments
  106.     pad1 As Integer
  107. #End If
  108.     dmFields As Long           'flags indicating fields to modify (required)
  109.     dmOrientation As Integer
  110.     dmPaperSize As Integer
  111.     dmPaperLength As Integer
  112.     dmPaperWidth As Integer
  113.     dmScale As Integer
  114.     dmCopies As Integer
  115.     dmDefaultSource As Integer
  116.     dmPrintQuality As Integer
  117.     dmColor As Integer
  118.     dmDuplex As Integer
  119.     dmYResolution As Integer
  120.     dmTTOption As Integer
  121. End Type
  122.  
  123. '/* field selection bits */
  124. Global Const DM_ORIENTATION = &H1
  125. Global Const DM_PAPERSIZE = &H2
  126. Global Const DM_PAPERLENGTH = &H4
  127. Global Const DM_PAPERWIDTH = &H8
  128. Global Const DM_SCALE = &H10
  129. Global Const DM_COPIES = &H100
  130. Global Const DM_DEFAULTSOURCE = &H200
  131. Global Const DM_PRINTQUALITY = &H400
  132. Global Const DM_COLOR = &H800
  133. Global Const DM_DUPLEX = &H1000
  134. Global Const DM_YRESOLUTION = &H2000
  135. Global Const DM_TTOPTION = &H4000
  136.  
  137. '/* orientation selections */
  138. Global Const DMORIENT_PORTRAIT = 1
  139. Global Const DMORIENT_LANDSCAPE = 2
  140.  
  141. '/* paper selections */
  142. '/*  Warning: The PostScript driver mistakingly uses DMPAPER_ values between
  143. ' *  50 and 56.  Don't use this range when defining new paper sizes.
  144. ' */
  145. Global Const DMPAPER_FIRST = 1
  146. Global Const DMPAPER_LETTER = 1               '/* Letter 8 1/2 x 11 in               */
  147. Global Const DMPAPER_LETTERSMALL = 2          '/* Letter Small 8 1/2 x 11 in         */
  148. Global Const DMPAPER_TABLOID = 3              '/* Tabloid 11 x 17 in                 */
  149. Global Const DMPAPER_LEDGER = 4               '/* Ledger 17 x 11 in                  */
  150. Global Const DMPAPER_LEGAL = 5                '/* Legal 8 1/2 x 14 in                */
  151. Global Const DMPAPER_STATEMENT = 6            '/* Statement 5 1/2 x 8 1/2 in         */
  152. Global Const DMPAPER_EXECUTIVE = 7            '/* Executive 7 1/4 x 10 1/2 in        */
  153. Global Const DMPAPER_A3 = 8                   '/* A3 297 x 420 mm                    */
  154. Global Const DMPAPER_A4 = 9                   '/* A4 210 x 297 mm                    */
  155. Global Const DMPAPER_A4SMALL = 10             '/* A4 Small 210 x 297 mm              */
  156. Global Const DMPAPER_A5 = 11                  '/* A5 148 x 210 mm                    */
  157. Global Const DMPAPER_B4 = 12                  '/* B4 250 x 354                       */
  158. Global Const DMPAPER_B5 = 13                  '/* B5 182 x 257 mm                    */
  159. Global Const DMPAPER_FOLIO = 14               '/* Folio 8 1/2 x 13 in                */
  160. Global Const DMPAPER_QUARTO = 15              '/* Quarto 215 x 275 mm                */
  161. Global Const DMPAPER_10X14 = 16               '/* 10x14 in                           */
  162. Global Const DMPAPER_11X17 = 17               '/* 11x17 in                           */
  163. Global Const DMPAPER_NOTE = 18                '/* Note 8 1/2 x 11 in                 */
  164. Global Const DMPAPER_ENV_9 = 19               '/* Envelope #9 3 7/8 x 8 7/8          */
  165. Global Const DMPAPER_ENV_10 = 20              '/* Envelope #10 4 1/8 x 9 1/2         */
  166. Global Const DMPAPER_ENV_11 = 21              '/* Envelope #11 4 1/2 x 10 3/8        */
  167. Global Const DMPAPER_ENV_12 = 22              '/* Envelope #12 4 \276 x 11           */
  168. Global Const DMPAPER_ENV_14 = 23              '/* Envelope #14 5 x 11 1/2            */
  169. Global Const DMPAPER_CSHEET = 24              '/* C size sheet                       */
  170. Global Const DMPAPER_DSHEET = 25              '/* D size sheet                       */
  171. Global Const DMPAPER_ESHEET = 26              '/* E size sheet                       */
  172. Global Const DMPAPER_ENV_DL = 27              '/* Envelope DL 110 x 220mm            */
  173. Global Const DMPAPER_ENV_C5 = 28              '/* Envelope C5 162 x 229 mm           */
  174. Global Const DMPAPER_ENV_C3 = 29              '/* Envelope C3  324 x 458 mm          */
  175. Global Const DMPAPER_ENV_C4 = 30              '/* Envelope C4  229 x 324 mm          */
  176. Global Const DMPAPER_ENV_C6 = 31              '/* Envelope C6  114 x 162 mm          */
  177. Global Const DMPAPER_ENV_C65 = 32             '/* Envelope C65 114 x 229 mm          */
  178. Global Const DMPAPER_ENV_B4 = 33              '/* Envelope B4  250 x 353 mm          */
  179. Global Const DMPAPER_ENV_B5 = 34              '/* Envelope B5  176 x 250 mm          */
  180. Global Const DMPAPER_ENV_B6 = 35              '/* Envelope B6  176 x 125 mm          */
  181. Global Const DMPAPER_ENV_ITALY = 36           '/* Envelope 110 x 230 mm              */
  182. Global Const DMPAPER_ENV_MONARCH = 37         '/* Envelope Monarch 3.875 x 7.5 in    */
  183. Global Const DMPAPER_ENV_PERSONAL = 38        '/* 6 3/4 Envelope 3 5/8 x 6 1/2 in    */
  184. Global Const DMPAPER_FANFOLD_US = 39          '/* US Std Fanfold 14 7/8 x 11 in      */
  185. Global Const DMPAPER_FANFOLD_STD_GERMAN = 40  '/* German Std Fanfold 8 1/2 x 12 in   */
  186. Global Const DMPAPER_FANFOLD_LGL_GERMAN = 41  '/* German Legal Fanfold 8 1/2 x 13 in */
  187.  
  188. Global Const DMPAPER_LAST = DMPAPER_FANFOLD_LGL_GERMAN
  189.  
  190. Global Const DMPAPER_USER = 256
  191.  
  192. '/* bin selections */
  193. Global Const DMBIN_FIRST = 1
  194. Global Const DMBIN_UPPER = 1
  195. Global Const DMBIN_ONLYONE = 1
  196. Global Const DMBIN_LOWER = 2
  197. Global Const DMBIN_MIDDLE = 3
  198. Global Const DMBIN_MANUAL = 4
  199. Global Const DMBIN_ENVELOPE = 5
  200. Global Const DMBIN_ENVMANUAL = 6
  201. Global Const DMBIN_AUTO = 7
  202. Global Const DMBIN_TRACTOR = 8
  203. Global Const DMBIN_SMALLFMT = 9
  204. Global Const DMBIN_LARGEFMT = 10
  205. Global Const DMBIN_LARGECAPACITY = 11
  206. Global Const DMBIN_CASSETTE = 14
  207. Global Const DMBIN_LAST = DMBIN_CASSETTE
  208.  
  209. Global Const DMBIN_USER = 256             '/* device specific bins start here */
  210.  
  211. '/* print qualities */
  212. Global Const DMRES_DRAFT = -1
  213. Global Const DMRES_LOW = -2
  214. Global Const DMRES_MEDIUM = -3
  215. Global Const DMRES_HIGH = -4
  216.  
  217. '/* color enable/disable for color printers */
  218. Global Const DMCOLOR_MONOCHROME = 1
  219. Global Const DMCOLOR_COLOR = 2
  220.  
  221. '/* duplex enable */
  222. Global Const DMDUP_SIMPLEX = 1
  223. Global Const DMDUP_VERTICAL = 2
  224. Global Const DMDUP_HORIZONTAL = 3
  225.  
  226. '/* TrueType options */
  227. Global Const DMTT_BITMAP = 1          '/* print TT fonts as graphics */
  228. Global Const DMTT_DOWNLOAD = 2        '/* download TT fonts as soft fonts */
  229. Global Const DMTT_SUBDEV = 3          '/* substitute device fonts for TT fonts */
  230.  
  231.  
  232.  
  233. '================================================================================
  234. ' Type Declarations for 4-byte aligned functions
  235. '================================================================================
  236. #If Win32 Then
  237.     Type PEJobInfo4
  238.         StructSize As Integer  ' initialize to PE_SIZEOF_JOB_INFO
  239.     
  240.         NumRecordsRead As Long
  241.         NumRecordsSelected As Long
  242.         NumRecordsPrinted As Long
  243.     
  244.         DisplayPageN As Integer
  245.         LatestPageN As Integer
  246.         StartPageN As Integer
  247.     
  248.         PrintEnded As Long
  249.     End Type
  250.     Global Const PE_SIZEOF_JOB_INFO4 = 28
  251.     
  252.     Type PETableType4
  253.         StructSize As Integer   ' initialize to # bytes in PETableType
  254.     
  255.         DLLName As String * PE_DLL_NAME_LEN
  256.         DescriptiveName  As String * PE_FULL_NAME_LEN
  257.     
  258.         DBType As Integer
  259.     End Type
  260.     Global Const PE_SIZEOF_TABLE_TYPE4 = 644
  261.  
  262.     Type PELogOnInfo4
  263.         ' initialize to # bytes in PELogOnInfo
  264.         StructSize As Integer
  265.     
  266.         ' For any of the following values an empty string ("") means to use
  267.         ' the value already set in the report.  To override a value in the
  268.         ' report use a non-empty string (e.g. "Server A").
  269.         '
  270.         ' For Netware SQL, pass the dictionary path name in ServerName and
  271.         ' data path name in DatabaseName.
  272.     
  273.         ServerName As String * PE_SERVERNAME_LEN
  274.         DatabaseName  As String * PE_DATABASENAME_LEN
  275.         UserID As String * PE_USERID_LEN
  276.     
  277.         ' Password is undefined when getting information from report.
  278.     
  279.         Password  As String * PE_PASSWORD_LEN
  280.     End Type
  281.     Global Const PE_SIZEOF_LOGON_INFO4 = 514  ' # bytes in PELogOnInfo
  282.  
  283.  
  284.     Type PESessionInfo4
  285.         'initialize to # bytes in PESessionInfo
  286.         StructSize As Integer
  287.  
  288.         ' Password is undefined when getting information from report.
  289.         UserID As String * PE_SESS_USERID_LEN
  290.         Password As String * PE_SESS_PASSWORD_LEN
  291.  
  292.         ' SessionHandle is undefined when getting information from report.
  293.         ' When setting information, if it is = 0 the UserID and Password
  294.         ' settings are used, otherwise the SessionHandle is used.
  295.         SessionHandle As Long
  296.     End Type
  297.     Global Const PE_SIZEOF_SESSION_INFO4 = 262  ' # bytes in PESessionInfo
  298.  
  299.  
  300.     Type PEGraphOptions4
  301.         StructSize     As Integer  ' initialize to # bytes in PEGraphOptions
  302.         GraphMaxValue  As Double
  303.         GraphMinValue  As Double
  304.         ShowDataValue  As Long  ' Show data values on risers.
  305.         ShowGridLine   As Long
  306.         VerticalBars   As Long
  307.         ShowLegend     As Long
  308.         FontFaceName   As String * PE_GRAPH_TEXT_LEN
  309.     End Type
  310.     Global Const PE_SIZEOF_GRAPH_OPTIONS4 = PE_WORD_LEN + 2 * 8 + 4 * 4 + PE_GRAPH_TEXT_LEN
  311.  
  312. #End If
  313.  
  314. '================================================================================
  315. ' Function Declarations
  316. '================================================================================
  317. #If Win16 Then
  318.     '** new CRPE wrapper Functions
  319.     Declare Function crPELogOnServer Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal DLLName$, ByVal ServerName$, ByVal DBName$, ByVal UserID$, ByVal Password$) As Integer
  320.     Declare Function crPELogOffServer Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal DLLName$, ByVal ServerName$, ByVal DBName$, ByVal UserID$, ByVal Password$) As Integer
  321.     Declare Function crPESetNthTableLogOnInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal TableN%, ByVal ServerName$, ByVal DBName$, ByVal UserID$, ByVal Password$, ByVal PropagateAcrossTables%) As Integer
  322.     Declare Function crPEGetNthTableLogOnInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" Alias "crvbPEGetNthTableLogOnInfo" (ByVal printJob%, ByVal TableN%, ByRef ServerName$, ByRef DBName$, ByRef UserID$) As Integer
  323.     Declare Function crPESetNthTableLocation Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal TableN%, ByVal tableLocation$) As Integer
  324.     Declare Function crPEGetNthTableLocation Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" Alias "crvbPEGetNthTableLocation" (ByVal printJob%, ByVal TableN%, ByRef tableLocation$) As Integer
  325.     Declare Function crPEGetSelectedPrinter Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" Alias "crvbPEGetSelectedPrinter" (ByVal printJob%, ByRef driverName$, ByRef PrinterName$, ByRef PortName$, crmode As crDEVMODE) As Integer
  326.     Declare Function crPESelectPrinter Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal driverName$, ByVal PrinterName$, ByVal PortName$, crmode As crDEVMODE) As Integer
  327.     Declare Function crPESetNthTableSessionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal TableN%, ByVal UserID$, ByVal Password$, ByVal SessionHandle As Long, ByVal PropagateAcrossTables%) As Integer
  328.     Declare Function crPEGetNthTableSessionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" Alias "crvbPEGetNthTableSessionInfo" (ByVal printJob%, ByVal TableN%, ByRef UserID$, ByRef SessionHandle As Long) As Integer
  329.     Declare Function crPESetGraphOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal sectionCode%, ByVal GraphN%, ByVal GraphMaxValue As Double, ByVal GraphMinValue As Double, ByVal ShowDataValue%, ByVal ShowGridLine%, ByVal VerticalBars%, ByVal ShowLegend%, ByRef FontFaceName$) As Integer
  330.     Declare Function crPEGetGraphOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" Alias "crvbPEGetGraphOptions" (ByVal printJob%, ByVal sectionCode%, ByVal GraphN%, ByRef GraphMaxValue As Double, ByRef GraphMinValue As Double, ByRef ShowDataValue%, ByRef ShowGridLine%, ByRef VerticalBars%, ByRef ShowLegend%, ByRef FontFaceName$) As Integer
  331.     Declare Function crPEGetNthParameterType Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal parameterN%) As Integer
  332.     Declare Function crPEGetNthParameterField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" Alias "crvbPEGetNthParameterField" (ByVal printJob%, ByVal parameterN%, ByRef valueType%, ByRef DefaultValueSet%, ByRef CurrentValueSet%, ByRef Name$, ByRef Prompt$, ByRef DefaultValue As Any, ByRef currentValue As Any) As Integer
  333.     Declare Function crPESetNthParameterField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal parameterN%, ByVal valueType%, ByVal DefaultValueSet%, ByVal CurrentValueSet%, ByVal Name$, ByVal Prompt$, ByRef DefaultValue As Any, ByRef currentValue As Any) As Integer
  334.  
  335.     Declare Function crvbHandleToBStr Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByRef BString$, ByVal strHandle%, ByVal strLength%) As Integer
  336.     Declare Function crPEYearMonthDayToDate Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal nYear%, ByVal nMonth%, ByVal nDay%) As Long
  337.     Declare Function crPEDateToYearMonthDay Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal nDate As Long, ByRef nYear%, ByRef nMonth%, ByRef nDay%) As Integer
  338.     Declare Function crPEHourMinuteSecondToTime Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal nHour%, ByVal nMinute%, ByVal nSecond%) As Long
  339.     Declare Function crTimeToHourMinuteSecond Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal nTime As Long, ByRef nHour%, ByRef nMinute%, ByRef nSecond%) As Integer
  340.  
  341.     '** Export Functions **
  342.     Declare Function crPEExportToApp Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal fileName$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  343.     Declare Function crPEExportToDisk Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal fileName$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  344.     Declare Function crPEExportToMapi Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal toList$, ByVal ccList$, ByVal subject$, ByVal message$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  345.     Declare Function crPEExportToExch Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal profile$, ByVal Password$, ByVal folderPath$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  346.     Declare Function crPEExportToODBC Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal dataSourceName$, ByVal dataSourceUserID$, ByVal dataSourcePassword$, ByVal exportTableName$) As Integer
  347.     Declare Function crPEExportToHTML Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal htmlType%, ByVal fileName$) As Integer
  348.     Declare Function crPEExportToVIM Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal toList$, ByVal ccList$, ByVal bccList$, ByVal subject$, ByVal message$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  349.     Declare Function crPEExportToNotes Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap16.dll" (ByVal printJob%, ByVal DBName$, ByVal FormName$, ByVal comments$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  350.  
  351. #ElseIf Win32 Then
  352.     '** new CRPE wrapper Functions
  353.     Declare Function crPELogOnServer Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal DLLName$, ByVal ServerName$, ByVal DBName$, ByVal UserID$, ByVal Password$) As Integer
  354.     Declare Function crPELogOffServer Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal DLLName$, ByVal ServerName$, ByVal DBName$, ByVal UserID$, ByVal Password$) As Integer
  355.     Declare Function crPESetNthTableLogOnInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal TableN%, ByVal ServerName$, ByVal DBName$, ByVal UserID$, ByVal Password$, ByVal PropagateAcrossTables As Long) As Integer
  356.     Declare Function crPEGetNthTableLogOnInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" Alias "crvbPEGetNthTableLogOnInfo" (ByVal printJob%, ByVal TableN%, ByRef ServerName$, ByRef DBName$, ByRef UserID$) As Integer
  357.     Declare Function crPESetNthTableLocation Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal TableN%, ByVal tableLocation$) As Integer
  358.     Declare Function crPEGetNthTableLocation Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" Alias "crvbPEGetNthTableLocation" (ByVal printJob%, ByVal TableN%, ByRef tableLocation$) As Integer
  359.     Declare Function crPEGetSelectedPrinter Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" Alias "crvbPEGetSelectedPrinter" (ByVal printJob%, ByRef driverName$, ByRef PrinterName$, ByRef PortName$, crmode As crDEVMODE) As Integer
  360.     Declare Function crPESelectPrinter Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal driverName$, ByVal PrinterName$, ByVal PortName$, crmode As crDEVMODE) As Integer
  361.     Declare Function crPESetNthTableSessionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal TableN%, ByVal UserID$, ByVal Password$, ByVal SessionHandle As Long, ByVal PropagateAcrossTables As Long) As Integer
  362.     Declare Function crPEGetNthTableSessionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" Alias "crvbPEGetNthTableSessionInfo" (ByVal printJob%, ByVal TableN%, ByRef UserID$, ByRef SessionHandle As Long) As Integer
  363.     Declare Function crPESetGraphOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal GraphN%, ByVal GraphMaxValue As Double, ByVal GraphMinValue As Double, ByVal ShowDataValue As Long, ByVal ShowGridLine As Long, ByVal VerticalBars As Long, ByVal ShowLegend As Long, ByVal FontFaceName$) As Integer
  364.     Declare Function crPEGetGraphOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" Alias "crvbPEGetGraphOptions" (ByVal printJob%, ByVal sectionCode%, ByVal GraphN%, ByRef GraphMaxValue As Double, ByRef GraphMinValue As Double, ByRef ShowDataValue As Long, ByRef ShowGridLine As Long, ByRef VerticalBars As Long, ByRef ShowLegend As Long, ByRef FontFaceName$) As Integer
  365.     Declare Function crPEGetNthParameterType Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal parameterN%) As Integer
  366.     Declare Function crPEGetNthParameterField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" Alias "crvbPEGetNthParameterField" (ByVal printJob%, ByVal parameterN%, ByRef valueType%, ByRef DefaultValueSet%, ByRef CurrentValueSet%, ByRef Name$, ByRef Prompt$, ByRef DefaultValue As Any, ByRef currentValue As Any) As Integer
  367.     Declare Function crPESetNthParameterField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal parameterN%, ByVal valueType%, ByVal DefaultValueSet%, ByVal CurrentValueSet%, ByVal Name$, ByVal Prompt$, ByRef DefaultValue As Any, ByRef currentValue As Any) As Integer
  368.  
  369.     Declare Function crvbHandleToBStr Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByRef BString$, ByVal strHandle As Long, ByVal strLength%) As Integer
  370.     Declare Function crPEYearMonthDayToDate Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal nYear%, ByVal nMonth%, ByVal nDay%) As Long
  371.     Declare Function crPEDateToYearMonthDay Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal nDate As Long, ByRef nYear%, ByRef nMonth%, ByRef nDay%) As Integer
  372.     Declare Function crPEHourMinuteSecondToTime Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal nHour%, ByVal nMinute%, ByVal nSecond%) As Long
  373.     Declare Function crTimeToHourMinuteSecond Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal nTime As Long, ByRef nHour%, ByRef nMinute%, ByRef nSecond%) As Integer
  374.  
  375.     '** Export Functions **
  376.     Declare Function crPEExportToApp Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal fileName$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  377.     Declare Function crPEExportToDisk Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal fileName$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  378.     Declare Function crPEExportToMapi Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal toList$, ByVal ccList$, ByVal subject$, ByVal message$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  379.     Declare Function crPEExportToExch Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal profile$, ByVal Password$, ByVal folderPath$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  380.     Declare Function crPEExportToODBC Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal dataSourceName$, ByVal dataSourceUserID$, ByVal dataSourcePassword$, ByVal exportTableName$) As Integer
  381.     Declare Function crPEExportToHTML Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal htmlType%, ByVal fileName$) As Integer
  382.     Declare Function crPEExportToVIM Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal toList$, ByVal ccList$, ByVal bccList$, ByVal subject$, ByVal message$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  383.     Declare Function crPEExportToNotes Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal DBName$, ByVal FormName$, ByVal comments$, ByVal FormatDLLName$, ByVal formatType As Long, ByVal useNumFormat As Long, ByVal useDateFormat As Long, ByVal StringDelimiter$, ByVal FieldDelimiter$) As Integer
  384.   
  385.     '** Functions which accept VB's native 4-byte aligned "Types"
  386.     Declare Function PEGetJobStatus4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, JobInfo As PEJobInfo4) As Integer
  387.     Declare Function PEGetNthTableType4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal TableN%, TableType As PETableType4) As Integer
  388.     Declare Function PELogOnServer4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal DLLName$, LogOnInfo As PELogOnInfo4) As Integer
  389.     Declare Function PELogOffServer4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal DLLName$, LogOnInfo As PELogOnInfo4) As Integer
  390.     Declare Function PESetNthTableSessionInfo4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal TableN%, SessionInfo As PESessionInfo4, ByVal PropagateAcrossTables As Long) As Integer
  391.     Declare Function PEGetNthTableSessionInfo4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal TableN%, SessionInfo As PESessionInfo4) As Integer
  392.     Declare Function PESetGraphOptions4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal GraphN%, GraphOptions As PEGraphOptions4) As Integer
  393.     Declare Function PEGetGraphOptions4 Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crwrap32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal GraphN%, GraphOptions As PEGraphOptions4) As Integer
  394.  
  395. #End If
  396.  
  397.