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 / CRDELPHI.PAS next >
Encoding:
Pascal/Delphi Source File  |  2002-03-06  |  146.2 KB  |  3,554 lines

  1. (*  Delphi Declarations for CRPE(32).DLL
  2. **  ====================================
  3. **
  4. **  File     : CRDELPHI.PAS
  5. **  Authors  : James Anderson, Andre Couturier, Frank Zimmerman
  6. **  Date     : 14 Oct 1999
  7. **  Purpose  : This file presents the API to the Crystal Reports
  8. **             Print Engine DLL.  This file will compile and execute in
  9. **             Delphi 1, 2, 3, 4 and 5.
  10. **  Language : Delphi 1, 2, 3, 4 and 5.
  11. **  Copyright (c) 1991-1999 Seagate Software Information Management Group, Inc.
  12. **
  13. ** Notes:  This file will create a CRDELPHI.DCU when you use compile and build.
  14. **         To use the CRDELPHI.DCU, you will need to add the following line
  15. **         of code to your 'uses' section of your Delphi application
  16. **            eg.
  17. **            uses
  18. **               Classes, CRDELPHI, ...;
  19. **
  20. ** UPDATES on November 23rd, 2000 
  21. ** Added by Trevor Dubinsky
  22. **
  23. ** Added declarations, types and constants required for following function calls:
  24. ** function PEGetReportVersion
  25. ** function PEGetNReportAlerts
  26. ** function PEGetNthReportAlert
  27. ** function PEGetNthAlertinstanceInfo
  28. ** function PESetNthAlertConditionFormula;
  29. ** function PESetNthAlertMessageFormula;
  30. ** function PESetNthAlertDefaultMessage;
  31. ** function PEEnableNthAlert;
  32. *)
  33.  
  34. unit CRDelphi;
  35. {$X+}
  36. {$A-}
  37.  
  38. interface
  39.  
  40. uses
  41.   WinTypes, WinProcs;
  42.  
  43. const
  44.   { Unchanged constants }
  45.   PE_UNCHANGED       = -1;
  46.   PE_UNCHANGED_COLOR = -2;
  47.   PE_NO_COLOR        = $FFFFFFFF; { unsigned long }
  48.   { Variable sizes }
  49.   PE_WORD_LEN      =  2;
  50.   PE_DWORD_LEN     =  4;
  51.   PE_SMALLINT_LEN  =  2;
  52.   PE_BOOL_LEN       =  1;
  53.   PE_ALLLINES      = -1;
  54.   PE_LONGPTR_LEN   =  4;
  55.  
  56. {******************************************************************************}
  57. { Error Codes returned by the CRPE.DLL                                         }
  58. {******************************************************************************}
  59.   PE_ERR_NOERROR               = 0;
  60.   PE_ERR_NOTENOUGHMEMORY       = 500;
  61.   PE_ERR_INVALIDJOBNO          = 501;
  62.   PE_ERR_INVALIDHANDLE         = 502;
  63.   PE_ERR_STRINGTOOLONG         = 503;
  64.   PE_ERR_NOSUCHREPORT          = 504;
  65.   PE_ERR_NODESTINATION         = 505;
  66.   PE_ERR_BADFILENUMBER         = 506;
  67.   PE_ERR_BADFILENAME           = 507;
  68.   PE_ERR_BADFIELDNUMBER        = 508;
  69.   PE_ERR_BADFIELDNAME          = 509;
  70.   PE_ERR_BADFORMULANAME        = 510;
  71.   PE_ERR_BADSORTDIRECTION      = 511;
  72.   PE_ERR_ENGINENOTOPEN         = 512;
  73.   PE_ERR_INVALIDPRINTER        = 513;
  74.   PE_ERR_PRINTFILEEXISTS       = 514;
  75.   PE_ERR_BADFORMULATEXT        = 515;
  76.   PE_ERR_BADGROUPSECTION       = 516;
  77.   PE_ERR_ENGINEBUSY            = 517;
  78.   PE_ERR_BADSECTION            = 518;
  79.   PE_ERR_NOPRINTWINDOW         = 519;
  80.   PE_ERR_JOBALREADYSTARTED     = 520;
  81.   PE_ERR_BADSUMMARYFIELD       = 521;
  82.   PE_ERR_NOTENOUGHSYSRES       = 522;
  83.   PE_ERR_BADGROUPCONDITION     = 523;
  84.   PE_ERR_JOBBUSY               = 524;
  85.   PE_ERR_BADREPORTFILE         = 525;
  86.   PE_ERR_NODEFAULTPRINTER      = 526;
  87.   PE_ERR_SQLSERVERERROR        = 527;
  88.   PE_ERR_BADLINENUMBER         = 528;
  89.   PE_ERR_DISKFULL              = 529;
  90.   PE_ERR_FILEERROR             = 530;
  91.   PE_ERR_INCORRECTPASSWORD     = 531;
  92.   PE_ERR_BADDATABASEDLL        = 532;
  93.   PE_ERR_BADDATABASEFILE       = 533;
  94.   PE_ERR_ERRORINDATABASEDLL    = 534;
  95.   PE_ERR_DATABASESESSION       = 535;
  96.   PE_ERR_DATABASELOGON         = 536;
  97.   PE_ERR_DATABASELOCATION      = 537;
  98.   PE_ERR_BADSTRUCTSIZE         = 538;
  99.   PE_ERR_BADDATE               = 539;
  100.   PE_ERR_BADEXPORTDLL          = 540;
  101.   PE_ERR_ERRORINEXPORTDLL      = 541;
  102.   PE_ERR_PREVATFIRSTPAGE       = 542;
  103.   PE_ERR_NEXTATLASTPAGE        = 543;
  104.   PE_ERR_CANNOTACCESSREPORT    = 544;
  105.   PE_ERR_USERCANCELLED         = 545;
  106.   PE_ERR_OLE2NOTLOADED         = 546;
  107.   PE_ERR_BADCROSSTABGROUP      = 547;
  108.   PE_ERR_NOCTSUMMARIZEDFIELD   = 548;
  109.   PE_ERR_DESTINATIONNOTEXPORT  = 549;
  110.   PE_ERR_INVALIDPAGENUMBER     = 550;
  111.   PE_ERR_NOTSTOREDPROCEDURE    = 552;
  112.   PE_ERR_INVALIDPARAMETER      = 553;
  113.   PE_ERR_GRAPHNOTFOUND         = 554;
  114.   PE_ERR_INVALIDGRAPHTYPE      = 555;
  115.   PE_ERR_INVALIDGRAPHDATA      = 556;
  116.   PE_ERR_CANNOTMOVEGRAPH       = 557;
  117.   PE_ERR_INVALIDGRAPHTEXT      = 558;
  118.   PE_ERR_INVALIDGRAPHOPT       = 559;
  119.   PE_ERR_BADSECTIONHEIGHT            = 560;
  120.   PE_ERR_BADVALUETYPE                = 561;
  121.   PE_ERR_INVALIDSUBREPORTNAME        = 562;
  122.   PE_ERR_NOPARENTWINDOW              = 564; {dialog parent window}
  123.   PE_ERR_INVALIDZOOMFACTOR           = 565; {zoom factor}
  124.   PE_ERR_PAGESIZEOVERFLOW            = 567;
  125.   PE_ERR_LOWSYSTEMRESOURCES          = 568;
  126.   PE_ERR_BADGROUPNUMBER              = 570;
  127.   PE_ERR_INVALIDOBJECTFORMATNAME     = 571;
  128.   PE_ERR_INVALIDNEGATIVEVALUE        = 572;
  129.   PE_ERR_INVALIDMEMORYPOINTER        = 573;
  130.   PE_ERR_INVALIDOBJECTTYPE           = 574;
  131.   PE_ERR_INVALIDGRAPHDATATYPE        = 577;
  132.   PE_ERR_INVALIDSUBREPORTLINKNUMBER  = 582;
  133.   PE_ERR_SUBREPORTLINKEXIST          = 583;
  134.   PE_ERR_BADROWCOLVALUE              = 584;
  135.   PE_ERR_INVALIDSUMMARYNUMBER        = 585;
  136.   PE_ERR_INVALIDGRAPHDATAFIELDNUMBER = 586;
  137.   PE_ERR_INVALIDSUBREPORTNUMBER      = 587;
  138.   PE_ERR_INVALIDFIELDSCOPE           = 588;
  139.   PE_ERR_FIELDINUSE                  = 590;
  140.   PE_ERR_INVALIDPARAMETERNUMBER      = 594;
  141.   PE_ERR_INVALIDPAGEMARGINS          = 595;
  142.   PE_ERR_REPORTONSECUREQUERY         = 596;
  143.   PE_ERR_CANNOTOPENSECUREQUERY       = 597;
  144.   PE_ERR_INVALIDSECTIONNUMBER        = 598;
  145.   PE_ERR_SQLSERVERNOTOPENED          = 599;
  146.   PE_ERR_TABLENAMEEXIST              = 606;
  147.   PE_ERR_INVALIDCURSOR               = 607;
  148.   PE_ERR_FIRSTPASSNOTFINISHED        = 608;
  149.   PE_ERR_CREATEDATASOURCE            = 609;
  150.   PE_ERR_CREATEDRILLDOWNPARAMETERS   = 610;
  151.   PE_ERR_CHECKFORDATASOURCECHANGES   = 613;
  152.   PE_ERR_STARTBACKGROUNDPROCESSING   = 614;
  153.   PE_ERR_SQLSERVERINUSE              = 619;
  154.   PE_ERR_GROUPSORTFIELDNOTSET        = 620;
  155.   PE_ERR_CANNOTSETSAVESUMMARIES      = 621;
  156.   PE_ERR_LOADOLAPDATABASEMANAGER     = 622;
  157.   PE_ERR_OPENOLAPCUBE                = 623;
  158.   PE_ERR_READOLAPCUBEDATA            = 624;
  159.   PE_ERR_CANNOTSAVEQUERY             = 626;
  160.   PE_ERR_CANNOTREADQUERYDATA         = 627;
  161.   PE_ERR_MAINREPORTFIELDLINKED       = 629;
  162.   PE_ERR_INVALIDMAPPINGTYPEVALUE     = 630;
  163.   PE_ERR_HITTESTFAILED               = 636;
  164.   PE_ERR_BADSQLEXPRESSIONNAME        = 637; { no SQL expression by the specified *name* exists in this report. }
  165.   PE_ERR_BADSQLEXPRESSIONNUMBER      = 638; { no SQL expression by the specified *number* exists in this report. }
  166.   PE_ERR_BADSQLEXPRESSIONTEXT        = 639; { not a valid SQL expression }
  167.   PE_ERR_INVALIDDEFAULTVALUEINDEX    = 641; { invalid index for default value of a parameter. }
  168.   PE_ERR_NOMINMAXVALUE               = 642; { the specified PE_PF_* type does not have min/max values. }
  169.   PE_ERR_INCONSISTANTTYPES           = 643; { if both min and max values are specified in PESetParameterMinMaxValue, }
  170.                                             { the value types for the min and max must be the same. }
  171.   PE_ERR_CANNOTLINKTABLES            = 645;
  172.   PE_ERR_CREATEROUTER                = 646;
  173.   PE_ERR_INVALIDFIELDINDEX           = 647;
  174.   PE_ERR_INVALIDGRAPHTITLETYPE       = 648;
  175.   PE_ERR_INVALIDGRAPHTITLEFONTTYPE   = 649;
  176.   PE_ERR_PARAMTYPEDIFFERENT          = 650; { the type used in a add/set value API for a }
  177.                                             { parameter differs with it's existing type. }
  178.   PE_ERR_INCONSISTANTRANGETYPES      = 651; { the value type for both start & end range }
  179.                                             { values must be the same. }
  180.   PE_ERR_RANGEORDISCRETE             = 652; { an operation was attempted on a discrete parameter that is }
  181.                                             { only legal for range parameters or vice versa. }
  182.   PE_ERR_NOTMAINREPORT               = 654; { an operation was attempted that is disallowed for subreports. }
  183.   PE_ERR_INVALIDCURRENTVALUEINDEX    = 655; { invalid index for current value of a parameter. }
  184.   PE_ERR_LINKEDPARAMVALUE            = 656; { operation illegal on linked parameter. }
  185.   PE_ERR_INVALIDPARAMETERRANGEINFO   = 672; { Invalid PE_RI_* combination}
  186.   PE_ERR_INVALIDSORTMETHODINDEX      = 674; { Invalid sort method index. }
  187.   PE_ERR_INVALIDGRAPHSUBTYPE         = 675; { Invalid PE_GST_* or }
  188.                                             { PE_GST_* does not match PE_GT_* or }
  189.                                             { PE_GST_* current graph type. }
  190.   PE_ERR_BADGRAPHOPTIONINFO          = 676; { one of them members of PEGraphOptionInfo is out of range. }
  191.   PE_ERR_BADGRAPHAXISINFO            = 677; { one of them members of PEGraphAxisInfo is out of range. }
  192.  
  193.   PE_ERR_NOTEXTERNALSUBREPORT        = 680; { the subreport is not imported }
  194.   PE_ERR_INVALIDPARAMETERVALUE       = 687;
  195.   PE_ERR_INVALIDFORMULASYNTAXTYPE    = 688; { specified formula syntax not in PE_FST_* }
  196.   PE_ERR_INVALIDCROPVALUE            = 689;
  197.   PE_ERR_INVALIDCOLLATIONVALUE       = 690;
  198.   PE_ERR_STARTPAGEGREATERSTOPPAGE    = 691;
  199.   PE_ERR_INVALIDEXPORTFORMAT         = 692;
  200.   PE_ERR_READONLYPARAMETEROPTION     = 700; { The parameter option is read only and can not be changed. }
  201.   PE_ERR_MINGREATERTHANMAX           = 702; { The minimum cannot be greater then maximum. }
  202.   PE_ERR_INVALIDSTARTPAGE            = 703; { Specified start page is greater than the last page on the report. }
  203.  
  204.  
  205.   PE_ERR_OTHERERROR                  = 997;
  206.   PE_ERR_INTERNALERROR               = 998; { programming error }
  207.   PE_ERR_NOTIMPLEMENTED              = 999;
  208.  
  209.  
  210. type
  211.   AreaType = Word;
  212.  
  213.  // DWord = LongInt;
  214.  
  215. {******************************************************************************}
  216. { Open and Close Print Engine                                                  }
  217. {******************************************************************************}
  218. function PEOpenEngine: Bool stdcall;
  219.  
  220. {$ifdef VER120}
  221. procedure PECloseEngine() stdcall;
  222. {$else}
  223. procedure PECloseEngine; stdcall;
  224. {$endif VER120}
  225.  
  226. function PECanCloseEngine: Bool stdcall;
  227.  
  228. {******************************************************************************}
  229. { Get Version Info                                                             }
  230. {******************************************************************************}
  231. const
  232.   PE_GV_DLL                  = 100;
  233.   PE_GV_ENGINE               = 200;
  234.  
  235. function PEGetVersion (versionRequested : Smallint): Smallint stdcall;
  236.  
  237.  
  238. {******************************************************************************}
  239. { Open, Print and Close Report                                                 }
  240. {  - used when no changes needed to report - Complete Default                  }
  241. {******************************************************************************}
  242. function PEPrintReport (
  243.   reportFilePath    : PChar;
  244.   toDefaultPrinter  : Bool;
  245.   toWindow          : Bool;
  246.   title             : PChar;
  247.   left              : integer;
  248.   top               : integer;
  249.   width             : integer;
  250.   height            : integer;
  251.   style             : DWord;
  252.   parentWindow      : Hwnd): Smallint stdcall;
  253.  
  254.  
  255. {******************************************************************************}
  256. { Report Options                                                               }
  257. {******************************************************************************}
  258. const
  259.   PE_RPTOPT_CVTDATETIMETOSTR  = 0;
  260.   PE_RPTOPT_CVTDATETIMETODATE = 1;
  261.   PE_RPTOPT_KEEPDATETIMETYPE  = 2;
  262.  
  263.   PE_RPTOPT_PROMPT_NONE   = 0;
  264.   PE_RPTOPT_PROMPT_NORMAL = 1;
  265.   PE_RPTOPT_PROMPT_ALWAYS = 2;
  266.  
  267. type
  268.   PEReportOptions = record
  269.     StructSize                       : Word;        {initialize to PE_SIZEOF_REPORT_OPTIONS}
  270.     saveDataWithReport               : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  271.     saveSummariesWithReport          : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  272.     useIndexForSpeed                 : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  273.     translateDOSStrings              : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  274.     translateDOSMemos                : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  275.     convertDateTimeType              : Smallint;  {a PE_RPTOPT_ value, except use PE_UNCHANGED for no change}
  276.     convertNullFieldToDefault        : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  277.     morePrintEngineErrorMessages     : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  278.     caseInsensitiveSQLData           : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  279.     verifyOnEveryPrint               : Smallint;  {BOOL value, except use PE_UNCHAGED for no change}
  280.     zoomMode                         : Smallint;  {a PE_ZOOM_ constant, except use PE_UNCHANGED for no change}
  281.     hasGroupTree                     : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  282.     dontGenerateDataForHiddenObjects : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  283.     performGroupingOnServer          : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  284.     promptMode                       : Smallint;  {PE_RPTOPT_PROMPT_NONE, PE_RPTOPT_PROMPT_NORMAL,
  285.                                                    PE_RPTOPT_PROMPT_ALWAYS, PE_UNCHANGED}
  286.     selectDistinctRecords            : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  287.     alwaysSortLocallay               : Smallint;  {BOOL value, except use PE_UNCHANGED for no change}
  288.     isReadOnly                       : Smallint;  {BOOL value, a read-only attribute}
  289.     CanSelectDistinctRecords         : Smallint;  {BOOL value, a read-only attribute}
  290.   end;
  291.  
  292. const
  293.   PE_SIZEOF_REPORT_OPTIONS = SizeOf(PEReportOptions);
  294.  
  295. function PEGetReportOptions(
  296.   printJob          : Smallint;
  297.   var reportOptions : PEReportOptions): Bool stdcall;
  298.  
  299. function PESetReportOptions(
  300.   printJob          : Smallint;
  301.   var reportOptions : PEReportOptions): Bool stdcall;
  302.  
  303.  
  304. {******************************************************************************}
  305. { Open and Close Print Job (i.e. Report)                                       }
  306. {******************************************************************************}
  307. function PEOpenPrintJob (reportFilePath : PChar): Smallint stdcall;
  308. function PEClosePrintJob (printJob : Smallint): Bool stdcall;
  309.  
  310.  
  311. {******************************************************************************}
  312. { Start and Cancel Print Job                                                   }
  313. {  - i.e. print the Report, usually after changing report                      }
  314. {******************************************************************************}
  315. function PEStartPrintJob (
  316.   printJob      : Smallint;
  317.   waitUntilDone : Bool): Bool stdcall;
  318.  
  319. procedure PECancelPrintJob (printJob : Smallint) stdcall;
  320.  
  321.  
  322. {******************************************************************************}
  323. { Open and Close Subreport                                                     }
  324. {******************************************************************************}
  325. function PEOpenSubreport (
  326.   parentJob     : Smallint;
  327.   subreportName : PChar): Smallint stdcall;
  328.  
  329. function PECloseSubreport (printJob : Smallint): Bool stdcall;
  330.  
  331.  
  332. {******************************************************************************}
  333. { Print Job Status                                                             }
  334. {******************************************************************************}
  335. function PEIsPrintJobFinished (printJob : Smallint): Bool stdcall;
  336.  
  337. { Status returns for PEGetJobStatus }
  338. const
  339.   PE_JOBNOTSTARTED = 1;
  340.   PE_JOBINPROGRESS = 2;
  341.   PE_JOBCOMPLETED  = 3;
  342.   PE_JOBFAILED     = 4;
  343.   PE_JOBCANCELLED  = 5;
  344.   PE_JOBHALTED     = 6;
  345.  
  346. type
  347.   PEJobInfo = record
  348.     StructSize         : Word;  (*initialize to SizeOf(PEJobInfo)*)
  349.     NumRecordsRead     : DWord;
  350.     NumRecordsSelected : DWord;
  351.     NumRecordsPrinted  : DWord;
  352.     DisplayPageN       : Word;  (*the page being displayed in window*)
  353.     LatestPageN        : Word;  (*the page being generated*)
  354.     StartPageN         : Word;  (*user opted, default to 1*)
  355.     PrintEnded         : Bool;  (*full report print completed?*)
  356.   end;
  357.  
  358. const
  359.   PE_SIZEOF_JOB_INFO = SizeOf(PEJobInfo);
  360.  
  361. function PEGetJobStatus (
  362.   printJob    : Smallint;
  363.   var jobInfo : PEJobInfo): Smallint stdcall;
  364.  
  365.  
  366. {******************************************************************************}
  367. { Controlling Dialogs                                                          }
  368. {******************************************************************************}
  369. function PESetDialogParentWindow (
  370.   printJob     : Smallint;
  371.   parentWindow : HWnd): Bool stdcall;
  372.  
  373. function PEEnableProgressDialog (
  374.   printJob : Smallint;
  375.   enable   : Bool): Bool stdcall;
  376.  
  377.  
  378. {******************************************************************************}
  379. { Controlling Parameter Field Prompting Dialog                                 }
  380. {   Set boolean to indicate whether CRPE is allowed to prompt                  }
  381. {   for parameter values during printing.                                      }
  382. {******************************************************************************}
  383. function PEGetAllowPromptDialog (printJob : Smallint): Bool stdcall;
  384. function PESetAllowPromptDialog (
  385.   printJob         : Smallint;
  386.   showPromptDialog : Bool): Bool stdcall;
  387.  
  388.  
  389. {******************************************************************************}
  390. { Print Job Error Codes and Messages                                           }
  391. {******************************************************************************}
  392. function PEGetErrorCode (printJob : Smallint): Smallint stdcall;
  393.  
  394. function PEGetErrorText (
  395.   printJob       : Smallint;
  396.   var textHandle : HWnd;
  397.   var textLength : Smallint): Bool stdcall;
  398.  
  399. function PEGetHandleString (
  400.   textHandle   : HWnd;
  401.   buffer       : PChar;
  402.   bufferLength : Smallint): Bool stdcall;
  403.  
  404.  
  405. {******************************************************************************}
  406. { Print Date                                                                   }
  407. {******************************************************************************}
  408. function PEGetPrintDate (
  409.   printJob  : Smallint;
  410.   var year  : Smallint;
  411.   var month : Smallint;
  412.   var day   : Smallint): Bool stdcall;
  413.  
  414. function PESetPrintDate (
  415.   printJob : Smallint;
  416.   year     : Smallint;
  417.   month    : Smallint;
  418.   day      : Smallint): Bool stdcall;
  419.  
  420.  
  421. {******************************************************************************}
  422. { Encoding and Decoding Section Codes                                          }
  423. {******************************************************************************}
  424. { Section constants }
  425. { For use with PE_SECTION_CODE, PE_SECTION_TYPE,
  426.   PE_GROUP_N and PE_SECTION_N functions }
  427. const
  428.   PE_SECT_REPORT_HEADER = 1;
  429.   PE_SECT_PAGE_HEADER   = 2;
  430.   PE_SECT_GROUP_HEADER  = 3;
  431.   PE_SECT_DETAIL        = 4;
  432.   PE_SECT_GROUP_FOOTER  = 5;
  433.   PE_SECT_PAGE_FOOTER   = 7;
  434.   PE_SECT_REPORT_FOOTER = 8;
  435.  
  436. { The old section constants with comment showing them in terms of the new: }
  437. { Note that PE_GRANDTOTALSECTION and PE_SUMMARYSECTION both map }
  438. { to PE_SECT_REPORT_FOOTER. }
  439.   PE_ALLSECTIONS       =    0;
  440.   PE_HEADERSECTION     = 2000;  {PE_SECTION_CODE (PE_SECT_PAGE_HEADER, 0, 0)}
  441.   PE_FOOTERSECTION     = 7000;  {PE_SECTION_CODE (PE_SECT_PAGE_FOOTER, 0, 0)}
  442.   PE_TITLESECTION      = 1000;  {PE_SECTION_CODE (PE_SECT_REPORT_HEADER, 0, 0)}
  443.   PE_SUMMARYSECTION    = 8000;  {PE_SECTION_CODE (PE_SECT_REPORT_FOOTER, 0, 0)}
  444.   PE_GROUPHEADER       = 3000;  {PE_SECTION_CODE (PE_SECT_GROUP_HEADER, 0, 0)}
  445.   PE_GROUPFOOTER       = 5000;  {PE_SECTION_CODE (PE_SECT_GROUP_FOOTER, 0, 0)}
  446.   PE_DETAILSECTION     = 4000;  {PE_SECTION_CODE (PE_SECT_DETAIL, 0, 0)}
  447.   PE_GRANDTOTALSECTION = PE_SUMMARYSECTION;
  448.  
  449. { A function to create section codes: }
  450. { This representation allows up to 25 groups and 40 sections of a given }
  451. { type, although Crystal Reports itself has no such limitations. }
  452. function PE_SECTION_CODE (sectionType, groupN, sectionN : Smallint): Smallint stdcall;
  453.  
  454. { Functions to decode section and area codes: }
  455. function PE_SECTION_TYPE (sectionCode : Smallint): Smallint stdcall;
  456. function PE_GROUP_N (sectionCode : Smallint): Smallint stdcall;
  457. function PE_SECTION_N (sectionCode : Smallint): Smallint stdcall;
  458.  
  459. { A function to create section codes: }
  460. {  This representation allows up to 25 groups although Crystal Reports }
  461. {  itself has no such limitations. }
  462. function PE_AREA_CODE (sectionType, groupN : Smallint): Smallint stdcall;
  463.  
  464.  
  465. {******************************************************************************}
  466. { Group Conditions (i.e. group breaks)                                         }
  467. {******************************************************************************}
  468. const
  469.   PE_SF_MAX_NAME_LENGTH = 50;
  470.  
  471.   PE_SF_DESCENDING   = 0;
  472.   PE_SF_ASCENDING    = 1;
  473.   PE_SF_ORIGINAL     = 2;  {only for group condition}
  474.   PE_SF_SPECIFIED    = 3;  {only for group condition}
  475.  
  476.   { use PE_ANYCHANGE for all field types except Date }
  477.   PE_GC_ANYCHANGE    = 0;
  478.  
  479.   { use these constants for Date fields }
  480.   PE_GC_DAILY        = 0;
  481.   PE_GC_WEEKLY       = 1;
  482.   PE_GC_BIWEEKLY     = 2;
  483.   PE_GC_SEMIMONTHLY  = 3;
  484.   PE_GC_MONTHLY      = 4;
  485.   PE_GC_QUARTERLY    = 5;
  486.   PE_GC_SEMIANNUALLY = 6;
  487.   PE_GC_ANNUALLY     = 7;
  488.  
  489.   { use these constants for Time  and DateTime fields }
  490.   PE_GC_BYSECOND     =  8;
  491.   PE_GC_BYMINUTE     =  9;
  492.   PE_GC_BYHOUR       = 10;
  493.   PE_GC_BYAMPM       = 11;
  494.  
  495.   { use these constants for Boolean fields }
  496.   PE_GC_TOYES        = 1;
  497.   PE_GC_TONO         = 2;
  498.   PE_GC_EVERYYES     = 3;
  499.   PE_GC_EVERYNO      = 4;
  500.   PE_GC_NEXTISYES    = 5;
  501.   PE_GC_NEXTISNO     = 6;
  502.  
  503. function PESetGroupCondition (
  504.   printJob       : Smallint;
  505.   sectionCode    : Smallint;
  506.   conditionField : PChar;
  507.   condition      : Smallint;  (* a PE_GC_ constant *)
  508.   sortDirection  : Smallint   (* a PE_SF_ constant *)
  509.   ): Bool stdcall;
  510.  
  511. function PEGetNGroups (printJob : Smallint): Smallint stdcall;
  512.  
  513. { for PEGetGroupCondition, condition encodes both }
  514. { the condition and the type of the condition field }
  515. const
  516.   PE_GC_CONDITIONMASK = $00FF;
  517.   PE_GC_TYPEMASK      = $0F00;
  518.  
  519.   PE_GC_TYPEOTHER     = $0000;
  520.   PE_GC_TYPEDATE      = $0200;
  521.   PE_GC_TYPEBOOLEAN   = $0400;
  522.   PE_GC_TYPETIME      = $0800;
  523.  
  524. function PEGetGroupCondition (
  525.   printJob                 : Smallint;
  526.   sectionCode              : Smallint;
  527.   var conditionFieldHandle : Hwnd;
  528.   var conditionFieldLength : Smallint;
  529.   var condition            : Smallint;
  530.   var sortDirection        : Smallint): Bool stdcall;
  531.  
  532. const
  533.   PE_FIELD_NAME_LEN = 512;
  534.  
  535.   PE_GO_TBN_ALL_GROUPS_UNSORTED = 0;
  536.   PE_GO_TBN_ALL_GROUPS_SORTED   = 1;
  537.   PE_GO_TBN_TOP_N_GROUPS        = 2;
  538.   PE_GO_TBN_BOTTOM_N_GROUPS     = 3;
  539.  
  540. type
  541.   PEFieldNameType = array[0..PE_FIELD_NAME_LEN-1] of Char;
  542.   PEGroupOptions = record
  543.     StructSize:                Word;
  544.     (* when setting, pass a PE_GC_ constant, or PE_UNCHANGED for no change.
  545.        when getting, use PE_GC_TYPEMASK and PE_GC_CONDITIONMASK to
  546.        decode the condition.*)
  547.     condition                 : Smallint;  {a PE_GC_ constant, or PE_UNCHANGED for no change.}
  548.     FieldName                 : PEFieldNameType; { formula form, or empty for no change.}
  549.     sortDirection             : Smallint;  { a PE_SF_ const, or PE_UNCHANGED for no change.}
  550.     repeatGroupHeader         : Smallint;  { BOOL value, or PE_UNCHANGED for no change.}
  551.     keepGroupTogether         : Smallint;  { BOOL value, or PE_UNCHANGED for no change.}
  552.     topOrBottomNGroups        : Smallint;  { a PE_GO_TBN_ constant, or PE_UNCHANGED for no change.}
  553.     topOrBottomNSortFieldName : PEFieldNameType; { formula form, or empty for no change.}
  554.     nTopOrBottomGroups        : Smallint;  { the number of groups to keep,
  555.                                              0 for all, or PE_UNCHANGED for no change.}
  556.     discardOtherGroups        : Smallint;  { BOOL value, or PE_UNCHANGED for no change.}
  557.     ignored                   : Integer;   { ignored - used for 4-byte alignment }
  558.     hierarchicalSorting       : Smallint;  { Boolean or PE_UNCHANGED for no change.}
  559.     instanceIDField           : PEFieldNameType; { for hierarchical grouping }
  560.     parentIDField             : PEFieldNameType; { for hierarchical grouping }
  561.     groupIndent               : LongInt;   { twips }
  562.   end;
  563.  
  564. const
  565.   PE_SIZEOF_GROUP_OPTIONS = SizeOf(PEGroupOptions);
  566.  
  567. function PEGetGroupOptions (
  568.   printJob         : Smallint;
  569.   groupN           : Smallint;
  570.   var groupOptions : PEGroupOptions): Bool stdcall;
  571.  
  572. function PESetGroupOptions (
  573.   printJob         : Smallint;
  574.   groupN           : Smallint;
  575.   var groupOptions : PEGroupOptions): Bool stdcall;
  576.  
  577.  
  578. {******************************************************************************}
  579. { Getting Number of Sections and Section Code                                  }
  580. {******************************************************************************}
  581. function PEGetNSections (printJob: Smallint): Smallint stdcall;
  582. { return -1 if failed }
  583.  
  584. function PEGetSectionCode (
  585.   printJob: Smallint;
  586.   sectionN: Smallint): Smallint stdcall;
  587.  
  588. function PEGetNSectionsInArea (printJob: Smallint; areaCode: Smallint): Smallint stdcall;
  589. { return -1 if failed }
  590.  
  591.  
  592. {******************************************************************************}
  593. { Section Height                                                               }
  594. {   The PEGetMinimumSectionHeight/PESetMinimumSectionHeight API Calls          }
  595. {   are obsolete, please use PEGetSectionHeight/PESetSectionHeight instead.    }
  596. {   The obsolete API calls will still work in older applications but please    }
  597. {   use the NEW calls for all new Development.                                 }
  598. {******************************************************************************}
  599. function PESetSectionHeight (
  600.   printJob    : Smallint;
  601.   sectionCode :    Smallint;
  602.   Height      : Smallint): Bool stdcall;
  603.   {Height is in twips }
  604.  
  605. function PEGetSectionHeight (
  606.   printJob :        Smallint;
  607.   sectionCode :     Smallint;
  608.   var Height :    Smallint): Bool stdcall;
  609.   {Height is in twips }
  610.  
  611.  
  612. {******************************************************************************}
  613. { Section or Area Format                                                       }
  614. {******************************************************************************}
  615. type
  616.   PESectionOptions = record
  617.     (*Initialize to PE_SIZEOF_SECTION_OPTIONS*)
  618.     StructSize           : Word;
  619.     Visible              : Smallint; (* BOOLEAN values, except use PE_UNCHANGED *)
  620.     newPageBefore        : Smallint; (* to preserve the existing settings       *)
  621.     newPageAfter         : Smallint;
  622.     keepTogether         : Smallint;
  623.     suppressBlankSection : Smallint;
  624.     resetPageNAfter      : Smallint;
  625.     printAtBottomOfPage  : Smallint;
  626.     backgroundColor      : DWord;    (* Use PE_UNCHANGED_COLOR to preserve the
  627.                                         existing color. *)
  628.     underlaySection      : Smallint; (* BOOLEAN values, except use PE_UNCHANGED  *)
  629.     showArea             : Smallint; (* to preserve the existing settings        *)
  630.     freeFormPlacement    : Smallint;
  631.     reserveMinimumPageFooter : Smallint; { BOOLEAN or PE_UNCHANGED; Sets the size    }
  632.                                          { of the Page Footer *area* to the size     }
  633.                                          { of the largest Page Footer *section*.     }
  634.                                          { Used with PEGetAreaFormat/PESetAreaFormat }
  635.                                          { ignored when used with PEGetSectionFormat }
  636.                                          { PESetSectionFormat.                       }
  637.   end;
  638.  
  639. const PE_SIZEOF_SECTION_OPTIONS = SizeOf(PESectionOptions);
  640.  
  641. function PEGetSectionFormat (
  642.   printJob    : Smallint;
  643.   sectionCode : Smallint;
  644.   var options : PESectionOptions): Bool stdcall;
  645.  
  646. function PESetSectionFormat (
  647.   printJob    : Smallint;
  648.   sectionCode : Smallint;
  649.   var options : PESectionOptions): Bool stdcall;
  650.  
  651. function PEGetAreaFormat (
  652.   printJob    : Smallint;
  653.   areaCode    : Smallint;
  654.   var options : PESectionOptions): Bool stdcall;
  655.  
  656. function PESetAreaFormat (
  657.   printJob    : Smallint;
  658.   areaCode    : Smallint;
  659.   var options : PESectionOptions): Bool stdcall;
  660.  
  661.  
  662. {******************************************************************************}
  663. { Setting Font info                                                            }
  664. {******************************************************************************}
  665. const
  666.   PE_FIELDS = $0001;
  667.   PE_TEXT   = $0002;
  668.  
  669. function PESetFont (
  670.   printJob     : Smallint;
  671.   sectionCode  : Smallint;
  672.   scopeCode    : Smallint;
  673.   faceName     : PChar;    (* 0 for no change               *)
  674.   fontFamily   : Smallint; (* FF_DONTCARE for no change     *)
  675.   fontPitch    : Smallint; (* DEFAULT_PITCH for no change   *)
  676.   charSet      : Smallint; (* DEFAULT_CHARSET for no change *)
  677.   pointSize    : Smallint; (* 0 for no change               *)
  678.   isItalic     : Smallint; (* PE_UNCHANGED for no change    *)
  679.   isUnderlined : Smallint; (* PE_UNCHANGED for no change    *)
  680.   isStruckOut  : Smallint; (* PE_UNCHANGED for no change    *)
  681.   weight       : Smallint  (* 0 for no change               *)
  682.   ):Bool stdcall;
  683.  
  684.  
  685. {******************************************************************************}
  686. { Subreports                                                                   }
  687. {******************************************************************************}
  688. function PEGetNSubreportsInSection (
  689.   printJob: Smallint;
  690.   sectionCode : Smallint): Smallint stdcall;
  691.  
  692. function PEGetNthSubreportInSection (
  693.   printJob: Smallint;
  694.   sectionCode: Smallint;
  695.   subreportN : Smallint): DWord stdcall;
  696.  
  697. const
  698.   PE_SUBREPORT_NAME_LEN = 128;
  699.  
  700. type
  701.   PESubreportNameType = array [0..PE_SUBREPORT_NAME_LEN-1] of Char;
  702.   PESubreportInfo = record
  703.     structSize : Word;          { Initialize to PE_SIZEOF_SUBREPORT_INFO }
  704.     name       : PESubreportNameType;
  705.     NLinks     : Smallint;      { Number of Links }
  706.     IsOnDemand : Smallint;      { TRUE if subreport is On Demand }
  707.  
  708.     { New for SCR8 }
  709.     isExternal   : Smallint;    { 1: the subreport is imported; 0: otherwise. }
  710.     reimportOption : Smallint;  { PE_SRI_ONOPENJOB or PE_SRI_ONFUNCTIONCALL }
  711.   end;
  712.  
  713. const
  714.   PE_SIZEOF_SUBREPORT_INFO = SizeOf(PESubreportInfo);
  715.  
  716. function PEGetSubreportInfo (
  717.   printJob          : Smallint;
  718.   subreportHandle   : DWord;
  719.   var subreportInfo : PESubreportInfo): Bool stdcall;
  720.  
  721. function PEReimportSubreport(
  722.   printJob          : Smallint;
  723.   subreportHandle   : DWord;
  724.   var linkChanged   : Bool;
  725.   var reimported    : Bool): Bool stdcall;
  726.  
  727. {******************************************************************************}
  728. { Graphing                                                                     }
  729. {******************************************************************************}
  730. {------------------------------------------------------------------------------}
  731. { Graph Type                                                                   }
  732. {------------------------------------------------------------------------------}
  733. const
  734.   { Graph Type }
  735.   PE_GT_BARCHART           =   0;
  736.   PE_GT_LINECHART          =   1;
  737.   PE_GT_AREACHART          =   2;
  738.   PE_GT_PIECHART           =   3;
  739.   PE_GT_DOUGHNUTCHART      =   4;
  740.   PE_GT_THREEDRISERCHART   =   5;
  741.   PE_GT_THREEDSURFACECHART =   6;
  742.   PE_GT_SCATTERCHART       =   7;
  743.   PE_GT_RADARCHART         =   8;
  744.   PE_GT_BUBBLECHART        =   9;
  745.   PE_GT_STOCKCHART         =  10;
  746.   { These next two are for PEGetGraphTypeInfo only }
  747.   { Do not use in PESetGraphTypeInfo }
  748.   PE_GT_USERDEFINEDCHART   =  50;
  749.   PE_GT_UNKNOWNTYPECHART   = 100;
  750.  
  751.   { Graph Subtype }
  752.   { Bar charts }
  753.   PE_GST_SIDEBYSIDEBARCHART                =    0;
  754.   PE_GST_STACKEDBARCHART                   =    1;
  755.   PE_GST_PERCENTBARCHART                   =    2;
  756.   PE_GST_FAKED3DSIDEBYSIDEBARCHART         =    3;
  757.   PE_GST_FAKED3DSTACKEDBARCHART            =    4;
  758.   PE_GST_FAKED3DPERCENTBARCHART            =    5;
  759.  
  760.   { Line charts }
  761.   PE_GST_REGULARLINECHART                  =   10;
  762.   PE_GST_STACKEDLINECHART                  =   11;
  763.   PE_GST_PERCENTAGELINECHART               =   12;
  764.   PE_GST_LINECHARTWITHMARKERS              =   13;
  765.   PE_GST_STACKEDLINECHARTWITHMARKERS       =   14;
  766.   PE_GST_PERCENTAGELINECHARTWITHMARKERS    =   15;
  767.  
  768.   { Area charts }
  769.   PE_GST_ABSOLUTEAREACHART                 =   20;
  770.   PE_GST_STACKEDAREACHART                  =   21;
  771.   PE_GST_PERCENTAREACHART                  =   22;
  772.   PE_GST_FAKED3DABSOLUTEAREACHART          =   23;
  773.   PE_GST_FAKED3DSTACKEDAREACHART           =   24;
  774.   PE_GST_FAKED3DPERCENTAREACHART           =   25;
  775.  
  776.   { Pie charts }
  777.   PE_GST_REGULARPIECHART                   =   30;
  778.   PE_GST_FAKED3DREGULARPIECHART            =   31;
  779.   PE_GST_MULTIPLEPIECHART                  =   32;
  780.   PE_GST_MULTIPLEPROPORTIONALPIECHART      =   33;
  781.  
  782.   { Doughnut charts }
  783.   PE_GST_REGULARDOUGHNUTCHART              =   40;
  784.   PE_GST_MULTIPLEDOUGHNUTCHART             =   41;
  785.   PE_GST_MULTIPLEPROPORTIONALDOUGHNUTCHART =   42;
  786.  
  787.   { 3D Riser charts }
  788.   PE_GST_THREEDREGULARCHART                =   50;
  789.   PE_GST_THREEDPYRAMIDCHART                =   51;
  790.   PE_GST_THREEDOCTAGONCHART                =   52;
  791.   PE_GST_THREEDCUTCORNERSCHART             =   53;
  792.  
  793.   { 3D surface charts }
  794.   PE_GST_THREEDSURFACEREGULARCHART         =   60;
  795.   PE_GST_THREEDSURFACEWITHSIDESCHART       =   61;
  796.   PE_GST_THREEDSURFACEHONEYCOMBCHART       =   62;
  797.  
  798.   { Scatter charts }
  799.   PE_GST_XYSCATTERCHART                    =   70;
  800.   PE_GST_XYSCATTERDUALAXISCHART            =   71;
  801.   PE_GST_XYSCATTERWITHLABELSCHART          =   72;
  802.   PE_GST_XYSCATTERDUALAXISWITHLABELSCHART  =   73;
  803.  
  804.   { Radar charts }
  805.   PE_GST_REGULARRADARCHART                 =   80;
  806.   PE_GST_STACKEDRADARCHART                 =   81;
  807.   PE_GST_RADARDUALAXISCHART                =   82;
  808.  
  809.   { Bubble charts }
  810.   PE_GST_REGULARBUBBLECHART                =   90;
  811.   PE_GST_DUALAXISBUBBLECHART               =   91;
  812.  
  813.   { Stocked charts }
  814.   PE_GST_HIGHLOWCHART                      =  100;
  815.   PE_GST_HIGHLOWDUALAXISCHART              =  101;
  816.   PE_GST_HIGHLOWOPENCHART                  =  102;
  817.   PE_GST_HIGHLOWOPENDUALAXISCHART          =  103;
  818.   PE_GST_HIGHLOWOPENCLOSECHART             =  104;
  819.   PE_GST_HIGHLOWOPENCLOSEDUALAXISCHART     =  105;
  820.  
  821.   PE_GST_UNKNOWNSUBTYPECHART               = 1000;
  822.  
  823. type
  824.   PEGraphTypeInfo = record
  825.     StructSize   : Word;
  826.     graphType    : Smallint; { PE_GT_*, PE_UNCHANGED for no change }
  827.     graphSubtype : Smallint; { PE_GST_*, PE_UNCHANGED for no change }
  828.   end;
  829.  
  830. const
  831.  PE_SIZEOF_GRAPH_TYPE_INFO = SizeOf(PEGraphTypeInfo);
  832.  
  833. function PEGetGraphTypeInfo (
  834.   printJob          : Smallint;
  835.   sectionN          : Smallint;
  836.   graphN            : Smallint;
  837.   var graphTypeInfo : PEGraphTypeInfo): Bool stdcall;
  838.  
  839. function PESetGraphTypeInfo (
  840.   printJob          : Smallint;
  841.   sectionN          : Smallint;
  842.   graphN            : Smallint;
  843.   var graphTypeInfo : PEGraphTypeInfo): Bool stdcall;
  844.  
  845. {------------------------------------------------------------------------------}
  846. { Graph Text                                                                   }
  847. {------------------------------------------------------------------------------}
  848. const
  849.   PE_GTT_TITLE           = 0;
  850.   PE_GTT_SUBTITLE        = 1;
  851.   PE_GTT_FOOTNOTE        = 2;
  852.   PE_GTT_SERIESTITLE     = 3;
  853.   PE_GTT_GROUPSTITLE     = 4;
  854.   PE_GTT_XAXISTITLE      = 5;
  855.   PE_GTT_YAXISTITLE      = 6;
  856.   PE_GTT_ZAXISTITLE      = 7;
  857.  
  858. function PEGetGraphTextInfo (
  859.   printJob        : Smallint;
  860.   sectionN        : Smallint;
  861.   graphN          : Smallint;
  862.   titleType       : Word;     { PE_GTT_ constant }
  863.   var title       : Hwnd;
  864.   var titleLength : Smallint): Bool stdcall;
  865.  
  866. function PESetGraphTextInfo (
  867.   printJob  : Smallint;
  868.   sectionN  : Smallint;
  869.   graphN    : Smallint;
  870.   titleType : Word;   { PE_GTT_ constant }
  871.   title     : PChar): Bool stdcall;
  872.  
  873. { enable/disable graph default titles }
  874. function PESetGraphTextDefaultOption (
  875.   printJob   : Smallint;
  876.   sectionN   : Smallint; 
  877.   graphN     : Smallint; 
  878.   titleType  : Word;  { PE_GTT_ constant }
  879.   useDefault : Bool): Bool stdcall;
  880.  
  881. function PEGetGraphTextDefaultOption (
  882.   printJob       : Smallint;
  883.   sectionN       : Smallint; 
  884.   graphN         : Smallint; 
  885.   titleType      : Word;   { PE_GTT_ constant }
  886.   var useDefault : Bool): Bool stdcall;
  887.  
  888. {------------------------------------------------------------------------------}
  889. { Graph Font                                                                   }
  890. {------------------------------------------------------------------------------}
  891. const
  892.   PE_GTF_TITLEFONT       = 0;
  893.   PE_GTF_SUBTITLEFONT    = 1;
  894.   PE_GTF_FOOTNOTEFONT    = 2;
  895.   PE_GTF_GROUPSTITLEFONT = 3;
  896.   PE_GTF_DATATITLEFONT   = 4;
  897.   PE_GTF_LEGENDFONT      = 5;
  898.   PE_GTF_GROUPLABELSFONT = 6;
  899.   PE_GTF_DATALABELSFONT  = 7;
  900.  
  901.   PE_FACE_NAME_LEN       = 64;
  902.  
  903. type
  904.   PEFaceNameType = array [0..PE_FACE_NAME_LEN-1] of Char;
  905.   PEFontColorInfo = record
  906.     StructSize   : Word;
  907.     faceName     : PEFaceNameType; { empty string for no change }
  908.     fontFamily   : Smallint; { FF_DONTCARE for no change }
  909.     fontPitch    : Smallint; { DEFAULT_PITCH for no change }
  910.     charSet      : Smallint; { DEFAULT_CHARSET for no change }
  911.     pointSize    : Smallint; { 0 for no change }
  912.     isItalic     : Smallint; { BOOL value, except use PE_UNCHANGED for no change }
  913.     isUnderlined : Smallint; { BOOL value, except use PE_UNCHANGED for no change }
  914.     isStruckOut  : Smallint; { BOOL value, except use PE_UNCHANGED for no change }
  915.     weight       : Smallint; { 0 for no change }
  916.     color        : COLORREF; { PE_UNCHANGED_COLOR for no change }
  917.     twipSize     : Smallint; { Font size in twips, 0 for no change.        }
  918.       { Use either pointSize or twipSize. If both pointSize and twipSize   }
  919.       { are non-zero, twipSize will be used and pointSize will be ignored. }
  920.   end;
  921.  
  922. const
  923.   PE_SIZEOF_FONT_COLOR_INFO = SizeOf(PEFontColorInfo);
  924.  
  925. function PEGetGraphFontInfo (
  926.   printJob           : Smallint;
  927.   sectionN           : Smallint;
  928.   graphN             : Smallint;
  929.   titleFontType      : Word;  { PE_GTF_ constant }
  930.   var fontColourInfo : PEFontColorInfo): Bool stdcall;
  931.  
  932. function PESetGraphFontInfo (
  933.   printJob           : Smallint;
  934.   sectionN           : Smallint;
  935.   graphN             : Smallint;
  936.   titleFontType      : Word; { PE_GTF_ constant }
  937.   var fontColourInfo : PEFontColorInfo): Bool stdcall;
  938.  
  939. {------------------------------------------------------------------------------}
  940. { Graph Options                                                                }
  941. {------------------------------------------------------------------------------}
  942. const
  943.   PE_GLP_PLACEUPPERRIGHT    =  0;
  944.   PE_GLP_PLACEBOTTOMCENTER  =  1;
  945.   PE_GLP_PLACETOPCENTER     =  2;
  946.   PE_GLP_PLACERIGHT         =  3;
  947.   PE_GLP_PLACELEFT          =  4;
  948.  
  949.   { Bar Sizes }
  950.   PE_GBS_MINIMUMBARSIZE     =  0;
  951.   PE_GBS_SMALLBARSIZE       =  1;
  952.   PE_GBS_AVERAGEBARSIZE     =  2;
  953.   PE_GBS_LARGEBARSIZE       =  3;
  954.   PE_GBS_MAXIMUMBARSIZE     =  4;
  955.  
  956.   { Pie Sizes }
  957.   PE_GPS_MINIMUMPIESIZE     = 64;
  958.   PE_GPS_SMALLPIESIZE       = 48;
  959.   PE_GPS_AVERAGEPIESIZE     = 32;
  960.   PE_GPS_LARGEPIESIZE       = 16;
  961.   PE_GPS_MAXIMUMPIESIZE     =  0;
  962.  
  963.   { Detached Pie Slice }
  964.   PE_GDPS_NODETACHMENT      =  0;
  965.   PE_GDPS_SMALLESTSLICE     =  1;
  966.   PE_GDPS_LARGESTSLICE      =  2;
  967.  
  968.   { Marker Sizes }
  969.   PE_GMS_SMALLMARKERS       =  0;
  970.   PE_GMS_MEDIUMSMALLMARKERS =  1;
  971.   PE_GMS_MEDIUMMARKERS      =  2;
  972.   PE_GMS_MEDIUMLARGEMARKERS =  3;
  973.   PE_GMS_LARGEMARKERS       =  4;
  974.  
  975.   { Marker shapes }
  976.   PE_GMSP_RECTANGLESHAPE    =  1;
  977.   PE_GMSP_CIRCLESHAPE       =  4;
  978.   PE_GMSP_DIAMONDSHAPE      =  5;
  979.   PE_GMSP_TRIANGLESHAPE     =  8;
  980.  
  981.   { Chart Color }
  982.   PE_GCR_COLORCHART         =  0;
  983.   PE_GCR_BLACKANDWHITECHART =  1;
  984.  
  985.   { Chart Data points }
  986.   PE_GDP_NONE               =  0;
  987.   PE_GDP_SHOWLABEL          =  1;
  988.   PE_GDP_SHOWVALUE          =  2;
  989.  
  990.   { Number formats }
  991.   PE_GNF_NODECIMAL          =  0;
  992.   PE_GNF_ONEDECIMAL         =  1;
  993.   PE_GNF_TWODECIMAL         =  2;
  994.   PE_GNF_CURRENCYNODECIMAL  =  3;
  995.   PE_GNF_CURRENCYTWODECIMAL =  4;
  996.   PE_GNF_PERCENTNODECIMAL   =  5;
  997.   PE_GNF_PERCENTONEDECIMAL  =  6;
  998.   PE_GNF_PERCENTTWODECIMAL  =  7;
  999.  
  1000.   { Viewing Angles }
  1001.   PE_GVA_STANDARDVIEW       =  1;
  1002.   PE_GVA_TALLVIEW           =  2;
  1003.   PE_GVA_TOPVIEW            =  3;
  1004.   PE_GVA_DISTORTEDVIEW      =  4;
  1005.   PE_GVA_SHORTVIEW          =  5;
  1006.   PE_GVA_GROUPEYEVIEW       =  6;
  1007.   PE_GVA_GROUPEMPHASISVIEW  =  7;
  1008.   PE_GVA_FEWSERIESVIEW      =  8;
  1009.   PE_GVA_FEWGROUPSVIEW      =  9;
  1010.   PE_GVA_DISTORTEDSTDVIEW   = 10;
  1011.   PE_GVA_THICKGROUPSVIEW    = 11;
  1012.   PE_GVA_SHORTERVIEW        = 12;
  1013.   PE_GVA_THICKSERIESVIEW    = 13;
  1014.   PE_GVA_THICKSTDVIEW       = 14;
  1015.   PE_GVA_BIRDSEYEVIEW       = 15;
  1016.   PE_GVA_MAXVIEW            = 16;
  1017.  
  1018.   {legend layout}
  1019.   PE_GLL_PERCENTAGE         =  0;
  1020.   PE_GLL_AMOUNT             =  1;
  1021.   PE_GLL_CUSTOM             =  2;  { for PEGetGraphOptionInfo, do not use }
  1022.                                    { in PESetGraphOptionInfo. }
  1023. type
  1024.   PEGraphOptionInfo = record
  1025.     StructSize       : Word;
  1026.     graphColour      : Smallint; { PE_GCR_*, PE_UNCHANGED for no change }
  1027.     showLegend       : Smallint; { BOOL, PE_UNCHANGED for no change }
  1028.     legendPosition   : Smallint; { PE_GLP_*, if showLegend == 0, means no legend }
  1029.     { Pie Charts and Doughut Charts }
  1030.     pieSize          : Smallint; { PE_GPS_*, PE_UNCHANGED for no change }
  1031.     detachedPieSlice : Smallint; { PE_GDPS_*, PE_UNCHANGED for no change }
  1032.     { Bar Chart }
  1033.     barSize          : Smallint; { PE_GBS_*, PE_UNCHANGED for no change }
  1034.     verticalBars     : Smallint; { BOOL, PE_UNCHANGED for no change }
  1035.     { Markers (used for line and bar charts) }
  1036.     markerSize       : Smallint; { PE_GMS_*, PE_UNCHANGED for no change }
  1037.     markerShape      : Smallint; { PE_GMSP_*, PE_UNCHANGED for no change }
  1038.     { Data Points }
  1039.     dataPoints       : Smallint; { PE_GDP_*, PE_UNCHANGED for no change }
  1040.     dataValueNumberFormat : Smallint; { PE_GNF_*, PE_UNCHANGED for no change }
  1041.     { 3D }
  1042.     viewingAngle     : Smallint; { PE_GVA_*, PE_UNCHANGED for no change }
  1043.     legendLayout     : Smallint; { PE_GLL_ constant }
  1044.   end;
  1045.  
  1046. const
  1047.   PE_SIZEOF_GRAPH_OPTION_INFO = SizeOf(PEGraphOptionInfo);
  1048.  
  1049. function PEGetGraphOptionInfo (
  1050.   printJob            : Smallint;
  1051.   sectionN            : Smallint;
  1052.   graphN              : Smallint;
  1053.   var graphOptionInfo : PEGraphOptionInfo): Bool stdcall;
  1054.  
  1055. function PESetGraphOptionInfo (
  1056.   printJob           : Smallint;
  1057.   sectionN           : Smallint;
  1058.   graphN             : Smallint;
  1059.   var graphOptionInfo : PEGraphOptionInfo): Bool stdcall;
  1060.  
  1061. {------------------------------------------------------------------------------}
  1062. { Graph Axes                                                                   }
  1063. {------------------------------------------------------------------------------}
  1064. const
  1065.   PE_GGT_NOGRIDLINES            =  0;
  1066.   PE_GGT_MINORGRIDLINES         =  1;
  1067.   PE_GGT_MAJORGRIDLINES         =  2;
  1068.   PE_GGT_MAJORANDMINORGRIDLINES =  3;
  1069.   PE_ADM_AUTOMATIC              =  0;
  1070.   PE_ADM_MANUAL                 =  1;
  1071.  
  1072. type
  1073.   PEGraphAxisInfo = record
  1074.     StructSize         : Word;
  1075.     { Grid Lines }
  1076.     groupAxisGridLine  : Smallint; { PE_GGT_*, PE_UNCHANGED for no change }
  1077.     dataAxisYGridLine  : Smallint; { PE_GGT_*, PE_UNCHANGED for no change }
  1078.     dataAxisY2GridLine : Smallint; { PE_GGT_*, PE_UNCHANGED for no change }
  1079.     seriesAxisGridline : Smallint; { PE_GGT_*, PE_UNCHANGED for no change }
  1080.     { Min/Max Values }
  1081.     dataAxisYMinValue  : double;
  1082.     dataAxisYMaxValue  : double;
  1083.     dataAxisY2MinValue : double;
  1084.     dataAxisY2MaxValue : double;
  1085.     seriesAxisMinValue : double;
  1086.     seriesAxisMaxValue : double;
  1087.     { Number Format }
  1088.     dataAxisYNumberFormat  : Smallint; { PE_GNF_*, PE_UNCHANGED for no change }
  1089.     dataAxisY2NumberFormat : Smallint; { PE_GNF_*, PE_UNCHANGED for no change }
  1090.     seriesAxisNumberFormat : Smallint; { PE_GNF_*, PE_UNCHANGED for no change }
  1091.     { Auto Range }
  1092.     dataAxisYAutoRange  : Smallint; { BOOL, PE_UNCHANGED for no change }
  1093.     dataAxisY2AutoRange : Smallint; { BOOL, PE_UNCHANGED for no change }
  1094.     seriesAxisAutoRange : Smallint; { BOOL, PE_UNCHANGED for no change }
  1095.     { Automatic Division }
  1096.     dataAxisYAutomaticDivision  : Smallint; { PE_ADM_*, PE_UNCHANGED for no change }
  1097.     dataAxisY2AutomaticDivision : Smallint; { PE_ADM_*, PE_UNCHANED for no change }
  1098.     seriesAxisAutomaticDivision : Smallint; { PE_ADM_*, PE_UNCHANED for no change }
  1099.     { Manual Division }
  1100.     dataAxisYManualDivision  : LongInt; { if dataAxisYAutomaticDivision is PE_ADM_AUTOMATIC, this field is ignored }
  1101.     dataAxisY2ManualDivision : LongInt; { if dataAxisY2AutomaticDivision is PE_ADM_AUTOMATIC, this field is ignored }
  1102.     seriesAxisManualDivision : LongInt; { if seriesAxisAutomaticDivision is PE_ADM_AUTOMATIC, this field is ignored }
  1103.     { Auto Scale }
  1104.     dataAxisYAutoScale  : Smallint;  { BOOL, PE_UNCHANGED for no change }
  1105.     dataAxisY2AutoScale : Smallint;  { BOOL, PE_UNCHANGED for no change }
  1106.     seriesAxisAutoScale : Smallint;  { BOOL, PE_UNCHANGED for no change }
  1107.   end;
  1108.  
  1109. const
  1110.   PE_SIZEOF_GRAPH_AXIS_INFO = SizeOf(PEGraphAxisInfo);
  1111.  
  1112. function PEGetGraphAxisInfo (
  1113.   printJob          : Smallint;
  1114.   sectionN          : Smallint;
  1115.   graphN            : Smallint;
  1116.   var graphAxisInfo : PEGraphAxisInfo): Bool stdcall;
  1117.  
  1118. function PESetGraphAxisInfo (
  1119.   printJob          : Smallint;
  1120.   sectionN          : Smallint;
  1121.   graphN            : Smallint;
  1122.   var graphAxisInfo : PEGraphAxisInfo): Bool stdcall;
  1123.  
  1124.  
  1125. {******************************************************************************}
  1126. {  Formulas, Selection Formulas and Group Selection Formulas                   }
  1127. {******************************************************************************}
  1128. {------------------------------------------------------------------------------}
  1129. { Formulas                                                                     }
  1130. {------------------------------------------------------------------------------}
  1131. function PEGetNFormulas (printJob : Smallint): Smallint stdcall;
  1132.  
  1133. function PEGetNthFormula (
  1134.   printJob       : Smallint;
  1135.   formulaN       : Smallint;
  1136.   var nameHandle : Hwnd;
  1137.   var nameLength : Smallint;
  1138.   var textHandle : Hwnd;
  1139.   var textLength : Smallint): Bool stdcall;
  1140.  
  1141. function PEGetFormula (
  1142.   printJob       : Smallint;
  1143.   formulaName    : PChar;
  1144.   var textHandle : HWnd;
  1145.   var textLength : Smallint): Bool stdcall;
  1146.  
  1147. function PESetFormula (
  1148.   printJob      : Smallint;
  1149.   formulaName   : PChar;
  1150.   formulaString : PChar): Bool stdcall;
  1151.  
  1152. function PECheckFormula (
  1153.   printJob    : Smallint;
  1154.   formulaName : PChar): Bool stdcall;
  1155.  
  1156. {------------------------------------------------------------------------------}
  1157. { Selection Formula                                                            }
  1158. {------------------------------------------------------------------------------}
  1159. function PEGetSelectionFormula (
  1160.   printJob       : Smallint;
  1161.   var textHandle : HWnd;
  1162.   var textLength : Smallint): Bool stdcall;
  1163.  
  1164. function PESetSelectionFormula (
  1165.   printJob      : Smallint;
  1166.   formulaString : PChar): Bool stdcall;
  1167.  
  1168. function PECheckSelectionFormula (printJob : Smallint): Bool stdcall;
  1169.  
  1170. {------------------------------------------------------------------------------}
  1171. { Group Selection Formula                                                      }
  1172. {------------------------------------------------------------------------------}
  1173. function PEGetGroupSelectionFormula (
  1174.   printJob       : Smallint;
  1175.   var textHandle : HWnd;
  1176.   var textLength : Smallint): Bool stdcall;
  1177.  
  1178. function PESetGroupSelectionFormula (
  1179.   printJob      : Smallint;
  1180.   formulaString : PChar): Bool stdcall;
  1181.  
  1182. function PECheckGroupSelectionFormula (printJob : Smallint): Bool stdcall;
  1183.  
  1184. {------------------------------------------------------------------------------}
  1185. { Section Format Formulas                                                      }
  1186. {------------------------------------------------------------------------------}
  1187. const
  1188.   { Format formula name : Old naming convention }
  1189.   SECTION_VISIBILITY      = 58;
  1190.   NEW_PAGE_BEFORE         = 60;
  1191.   NEW_PAGE_AFTER          = 61;
  1192.   KEEP_SECTION_TOGETHER   = 62;
  1193.   SUPPRESS_BLANK_SECTION  = 63;
  1194.   RESET_PAGE_N_AFTER      = 64;
  1195.   PRINT_AT_BOTTOM_OF_PAGE = 65;
  1196.   UNDERLAY_SECTION        = 66;
  1197.   SECTION_BACK_COLOUR     = 67;
  1198.   { Format formula name : New naming convention}
  1199.   PE_FFN_AREASECTION_VISIBILITY  = 58;
  1200.   PE_FFN_SECTION_VISIBILITY      = 58;
  1201.   PE_FFN_SHOW_AREA               = 59;
  1202.   PE_FFN_NEW_PAGE_BEFORE         = 60;
  1203.   PE_FFN_NEW_PAGE_AFTER          = 61;
  1204.   PE_FFN_KEEP_SECTION_TOGETHER   = 62;
  1205.   PE_FFN_KEEP_TOGETHER           = 62;
  1206.   PE_FFN_SUPPRESS_BLANK_SECTION  = 63;
  1207.   PE_FFN_RESET_PAGE_N_AFTER      = 64;
  1208.   PE_FFN_PRINT_AT_BOTTOM_OF_PAGE = 65;
  1209.   PE_FFN_UNDERLAY_SECTION        = 66;
  1210.   PE_FFN_SECTION_BACK_COLOR      = 67;
  1211.  
  1212. function PEGetSectionFormatFormula (
  1213.   printJob       : Smallint;
  1214.   sectionCode    : Smallint;
  1215.   formulaName    : Smallint;
  1216.   var textHandle : HWnd;
  1217.   var textLength : Smallint): Bool stdcall;
  1218.  
  1219. function PESetSectionFormatFormula (
  1220.   printJob      : Smallint;
  1221.   sectionCode   : Smallint;
  1222.   formulaName   : Smallint;
  1223.   formulaString : PChar): Bool stdcall;
  1224.  
  1225. {------------------------------------------------------------------------------}
  1226. { Area Format Formulas                                                         }
  1227. {------------------------------------------------------------------------------}
  1228. function PEGetAreaFormatFormula (
  1229.   printJob       : Smallint;
  1230.   areaCode       : Smallint;
  1231.   formulaName    : Smallint;
  1232.   var textHandle : HWnd;
  1233.   var textLength : Smallint): Bool stdcall;
  1234.  
  1235. function PESetAreaFormatFormula (
  1236.   printJob      : Smallint;
  1237.   areaCode      : Smallint;
  1238.   formulaName   : Smallint;
  1239.   formulaString : PChar): Bool stdcall;
  1240.  
  1241.  
  1242. {******************************************************************************}
  1243. { SQL Expressions                                                              }
  1244. {******************************************************************************}
  1245. function PEGetNSQLExpressions (printJob : Smallint): Smallint stdcall;
  1246.  
  1247. function PEGetNthSQLExpression (
  1248.   printJob       : Smallint;
  1249.   expressionN    : Smallint;
  1250.   var nameHandle : Hwnd;
  1251.   var nameLength : Smallint;
  1252.   var textHandle : Hwnd;
  1253.   var textLength : Smallint): Bool stdcall;
  1254.  
  1255. function PEGetSQLExpression (
  1256.   printJob             : Smallint;
  1257.   const expressionName : PChar;
  1258.   var textHandle       : Hwnd;
  1259.   var textLength       : Smallint): Bool stdcall;
  1260.  
  1261. function PESetSQLExpression (
  1262.   printJob               : Smallint;
  1263.   const expressionName   : PChar;
  1264.   const expressionString : PChar): Bool stdcall;
  1265.  
  1266. function PECheckSQLExpression (
  1267.   printJob             : Smallint;
  1268.   const expressionName : PChar): Bool stdcall;
  1269.  
  1270.  
  1271. (********************************************************************************/
  1272. ** NOTE : Stored Procedures
  1273. **   The previous Stored Procedure API Calls PEGetNParams, PEGetNthParam,
  1274. ** PEGetNthParamInfo and PESetNthParam have been made obsolete.  Older
  1275. ** applications that used these API Calls will still work as before, but for new
  1276. ** development please use the new Parameter API calls below,
  1277. **   The Stored Procedure Parameters have now been unified with the Parameter
  1278. ** Fields.
  1279. **
  1280. ** The replacements for these calls are as follows :
  1281. **        PEGetNParams      = PEGetNParameterFields
  1282. **        PEGetNthParam      = PEGetNthParameterField
  1283. **        PEGetNthParamInfo = PEGetParameterValueInfo
  1284. **        PESetNthParam      = PESetNthParameterField
  1285. **
  1286. ** NOTE : To tell if a Parameter Field is a Stored Procedure, use the
  1287. **      PEGetNthParameterType or PEGetNthParameterField API Calls
  1288. **
  1289. ** If you wish to SET a parameter to NULL then set the CurrentValue to CRWNULL.
  1290. ** The CRWNULL is of Type String and is independant of the datatype of the
  1291. ** parameter.
  1292. *******************************************************************************)
  1293.  
  1294.  
  1295. {******************************************************************************}
  1296. { Parameter Fields                                                             }
  1297. {******************************************************************************}
  1298. {------------------------------------------------------------------------------}
  1299. { Getting/Setting Parameter Fields                                             }
  1300. {------------------------------------------------------------------------------}
  1301. const
  1302.   PE_PF_REPORT_NAME_LEN = 128;
  1303.   PE_PF_NAME_LEN        = 256;
  1304.   PE_PF_PROMPT_LEN      = 256;
  1305.   PE_PF_VALUE_LEN       = 256;
  1306.   PE_PF_EDITMASK_LEN    = 256;
  1307.  
  1308.   PE_PF_NUMBER     = 0;
  1309.   PE_PF_CURRENCY   = 1;
  1310.   PE_PF_BOOLEAN    = 2;
  1311.   PE_PF_DATE       = 3;
  1312.   PE_PF_STRING     = 4;
  1313.   PE_PF_DATETIME   = 5;
  1314.   PE_PF_TIME       = 6;
  1315.  
  1316. type
  1317.   PE_PF_ReportNameType         = array [0..PE_PF_REPORT_NAME_LEN-1] of Char;
  1318.   PEParameterFieldNameType     = array [0..PE_PF_NAME_LEN-1] of Char;
  1319.   PEParameterFieldTextType     = array [0..PE_PF_PROMPT_LEN-1] of Char;
  1320.   PEParameterFieldValueType    = array [0..PE_PF_VALUE_LEN-1] of Char;
  1321.   PEParameterFieldEditMaskType = array [0..PE_PF_EDITMASK_LEN-1] of Char;
  1322.   PEParameterFieldInfo = record
  1323.     structSize        : Word; { Initialize to PE_SIZEOF_PARAMETER_FIELD_INFO }
  1324.     ValueType         : Word; { PE_PF_ constant }
  1325.     DefaultValueSet   : Word; { Indicate the default value is set in PEParameterFieldInfo }
  1326.     CurrentValueSet   : Word; { Indicate the current value is set in PEParameterFieldInfo }
  1327.     Name              : PEParameterFieldNameType;
  1328.     Prompt            : PEParameterFieldTextType;
  1329.     { Next 2 Could be Number, Date, DateTime, Time, Boolean, or String }
  1330.     DefaultValue      : PEParameterFieldValueType;
  1331.     CurrentValue      : PEParameterFieldValueType;
  1332.     { Name of report where the field belongs, only used in PEGetNthParameterField }
  1333.     ReportName        : PE_PF_ReportNameType;
  1334.     { Returns false (0) if parameter is linked, not in use, or has current value set }
  1335.     needsCurrentValue : Word;
  1336.     { For String values this will be TRUE if the string is limited on length, for }
  1337.     { other types it will be TRUE if the parameter is limited by a range }
  1338.     isLimited         : Word;
  1339.     { For string fields, these are the minimum/maximum length of the string }
  1340.     { For numeric fields, they are the minimum/maximum numeric value }
  1341.     { For other fields, use PEGetParameterMinMaxValue }
  1342.     MinSize           : double;
  1343.     MaxSize           : double;
  1344.     { An edit mask that restricts what may be entered for string parameters }
  1345.     EditMask          : PEParameterFieldEditMaskType;
  1346.     { Returns True if it is essbase sub var }
  1347.     isHidden          : Word;
  1348.   end;
  1349.  
  1350. const
  1351.   PE_SIZEOF_PARAMETER_FIELD_INFO = SizeOf(PEParameterFieldInfo);
  1352.   PE_SIZEOF_VARINFO_TYPE = SizeOf(PEParameterFieldInfo);
  1353.  
  1354. function PEGetNParameterFields (printJob: Smallint): Smallint stdcall;
  1355.  
  1356. function PEGetNthParameterField (
  1357.   printJob          : Smallint;
  1358.   parameterN        : Smallint;
  1359.   var parameterInfo : PEParameterFieldInfo): Bool stdcall;
  1360.  
  1361. function PESetNthParameterField (
  1362.   printJob          : Smallint;
  1363.   parameterN        : Smallint;
  1364.   var parameterInfo : PEParameterFieldInfo): Bool stdcall;
  1365.  
  1366. {------------------------------------------------------------------------------}
  1367. { Converting Default/Current Value via PEValueInfo                             }
  1368. {------------------------------------------------------------------------------}
  1369. const
  1370.   { ValueInfo types }
  1371.   PE_VI_NUMBER      = 0;
  1372.   PE_VI_CURRENCY    = 1;
  1373.   PE_VI_BOOLEAN     = 2;
  1374.   PE_VI_DATE        = 3;
  1375.   PE_VI_STRING      = 4;
  1376.   PE_VI_DATETIME    = 5;
  1377.   PE_VI_TIME        = 6;
  1378.   PE_VI_INTEGER     = 7;
  1379.   PE_VI_COLOR       = 8;
  1380.   PE_VI_CHAR        = 9;
  1381.   PE_VI_LONG        = 10;
  1382.   PE_VI_NOVALUE    = 100;
  1383.   PE_VI_STRING_LEN = 256;
  1384.  
  1385. type
  1386.   PEValueInfoStringType     = array[0..PE_VI_STRING_LEN-1] of Char;
  1387.   PEValueInfoDateOrTimeType = array[0..2] of Smallint;
  1388.   PEValueInfoDateTimeType   = array[0..5] of Smallint;
  1389.   PEValueInfo = record
  1390.     StructSize : Word;
  1391.     valueType  : Word;  {a PE_VI_ constant}
  1392.     viNumber   : Double;
  1393.     viCurrency : Double;
  1394.     viBoolean  : Bool;
  1395.     viString   : PEValueInfoStringType;
  1396.     viDate     : PEValueInfoDateOrTimeType; {year, month, day}
  1397.     viDateTime : PEValueInfoDateTimeType;   {year, month, day, hour, minute, second}
  1398.     viTime     : PEValueInfoDateOrTimeType; {hour, minute, second}
  1399.     viColor    : DWord;
  1400.     viInteger  : Smallint;
  1401.     viC        : Char;
  1402.     ignored    : Char; {for 4 byte alignment. ignored.}
  1403.     viLong     : DWord;
  1404.   end;
  1405.  
  1406. const
  1407.   PE_SIZEOF_VALUE_INFO = SizeOf(PEValueInfo);
  1408.  
  1409. function PEConvertPFInfoToVInfo (
  1410.   value         : PChar;
  1411.   valueType     : Smallint;
  1412.   var valueInfo : PEValueInfo): Bool stdcall;
  1413.  
  1414. function PEConvertVInfoToPFInfo (
  1415.   var valueInfo  : PEValueInfo;
  1416.   var valueType  : Word;
  1417.   value : PChar): Bool stdcall;
  1418.  
  1419. {------------------------------------------------------------------------------}
  1420. { Getting/Setting multiple Default Values                                      }
  1421. {------------------------------------------------------------------------------}
  1422. { If return value is -1 then an error has occurred. }
  1423. function PEGetNParameterDefaultValues(
  1424.   printJob                 : Smallint;
  1425.   const parameterFieldName : PChar;
  1426.   const reportName         : PChar): Smallint stdcall;
  1427.  
  1428. function PEGetNthParameterDefaultValue (
  1429.   printJob                 : Smallint;
  1430.   const parameterFieldName : PChar;
  1431.   const reportName         : PChar;
  1432.   index                    : Smallint;
  1433.   var valueInfo            : PEValueInfo): Bool stdcall;
  1434.  
  1435. function PESetNthParameterDefaultValue (
  1436.   printJob                 : Smallint;
  1437.   const parameterFieldName : PChar;
  1438.   const reportName         : PChar;
  1439.   index                    : Smallint;
  1440.   var valueInfo            : PEValueInfo): Bool stdcall;
  1441.  
  1442. function PEAddParameterDefaultValue (
  1443.   printJob                 : Smallint;
  1444.   const parameterFieldName : PChar;
  1445.   const reportName         : PChar;
  1446.   var valueInfo            : PEValueInfo): Bool stdcall;
  1447.  
  1448. function PEDeleteNthParameterDefaultValue (
  1449.   printJob                 : Smallint;
  1450.   const parameterFieldName : PChar;
  1451.   const reportName         : PChar;
  1452.   index                    : Smallint): Bool stdcall;
  1453.  
  1454. {------------------------------------------------------------------------------}
  1455. { Min/Max Values for Parameter Fields                                          }
  1456. {------------------------------------------------------------------------------}
  1457. function PEGetParameterMinMaxValue (
  1458.   printJob                 : Smallint;
  1459.   const parameterFieldName : PChar;
  1460.   const reportName         : PChar;
  1461.   var valueMin             : PEValueInfo;
  1462.   { Set to NULL to retrieve MAX only; must be non-NULL if valueMax is NULL }
  1463.   var valueMax             : PEValueInfo): Bool stdcall;
  1464.   { Set to NULL to retrieve MIN only; must be non-NULL if valueMin is NULL }
  1465.  
  1466.  
  1467. function PESetParameterMinMaxValue (
  1468.   printJob                 : Smallint;
  1469.   const parameterFieldName : PChar;
  1470.   const reportName         : PChar;
  1471.   var valueMin             : PEValueInfo;
  1472.   { Set to NULL to retrieve MAX only; must be non-NULL if valueMax is NULL }
  1473.   var valueMax             : PEValueInfo): Bool stdcall;
  1474.   { Set to NULL to retrieve MIN only; must be non-NULL if valueMin is NULL }
  1475.   { If both valueInfo and valueMax are non-NULL then }
  1476.   { valueMin->valueType MUST BE THE SAME AS valueMax->valueType. }
  1477.   { If different, PE_ERR_INCONSISTANTTYPES is returned. }
  1478.  
  1479. {------------------------------------------------------------------------------}
  1480. { Pick List Options in Parameter Fields                                        }
  1481. {------------------------------------------------------------------------------}
  1482. function PEGetNthParameterValueDescription (
  1483.   printJob            : Smallint;
  1484.   parameterFieldName  : PChar;
  1485.   reportName          : PChar;
  1486.   index               : Smallint;
  1487.   var valueDesc       : HWnd;
  1488.   var valueDescLength : Smallint): Bool stdcall;
  1489.  
  1490. function PESetNthParameterValueDescription (
  1491.   printJob            : Smallint;
  1492.   parameterFieldName  : PChar;
  1493.   reportName          : PChar;
  1494.   index               : Smallint;
  1495.   valueDesc           : PChar): Bool stdcall;
  1496.  
  1497. { Constants for sortMethod in PEParameterPickListOption }
  1498. const
  1499.   PE_OR_NO_SORT                 = 0;
  1500.   PE_OR_ALPHANUMERIC_ASCENDING  = 1;
  1501.   PE_OR_ALPHANUMERIC_DESCENDING = 2;
  1502.   PE_OR_NUMERIC_ASCENDING       = 3;
  1503.   PE_OR_NUMERIC_DESCENDING      = 4;
  1504.  
  1505. type
  1506.   PEParameterPickListOption = record
  1507.     StructSize      : Word;      { initialize to PE_SIZEOF_PICK_LIST_OPTION }
  1508.     showDescOnly    : Smallint;  { boolean value or PE_UNCHANGED }
  1509.     sortMethod      : Smallint;  { enum type const, PE_UNCHANGED for no change }
  1510.     sortBasedOnDesc : Smallint;  { boolean value or PE_UNCHANGED }
  1511.   end;
  1512.  
  1513. const
  1514.   PE_SIZEOF_PICK_LIST_OPTION = SizeOf(PEParameterPickListOption);
  1515.  
  1516. function PEGetParameterPickListOption (
  1517.   printJob           : Smallint;
  1518.   parameterFieldName : PChar;
  1519.   reportName         : PChar;
  1520.   var pickListOption : PEParameterPickListOption): Bool stdcall;
  1521.  
  1522. function PESetParameterPickListOption (
  1523.   printJob           : Smallint;
  1524.   parameterFieldName : PChar;
  1525.   reportName         : PChar;
  1526.   var pickListOption : PEParameterPickListOption): Bool stdcall;
  1527.  
  1528. {------------------------------------------------------------------------------}
  1529. { Parameter Value Info - extra options for Parameter Fields                    }
  1530. {------------------------------------------------------------------------------}
  1531. type
  1532.   PEParameterValueInfo = record
  1533.     StructSize             : Word;
  1534.     isNullable             : Smallint; {Boolean value or PE_UNCHANGED for no change.}
  1535.     disallowEditing        : Smallint; {Boolean value or PE_UNCHANGED for no change.}
  1536.     allowMultipleValues    : Smallint; {Boolean value or PE_UNCHANGED for no change.}
  1537.     hasDiscreteValues      : Smallint; {Boolean value or PE_UNCHANGED for no change.}
  1538.                                        {True: has discrete values, False: has ranges}
  1539.     partOfGroup            : Smallint; {Boolean value or PE_UNCHANGED for no change.}
  1540.     groupNum               : Smallint; {a group number or PE_UNCHANGED for no change.}
  1541.     mutuallyExclusiveGroup : Smallint; {Boolean value or PE_UNCHANGED for no change.}
  1542.   end;
  1543.  
  1544. const
  1545.   PE_SIZEOF_PARAMETER_VALUE_INFO = SizeOf(PEParameterValueInfo);
  1546.  
  1547. function PEGetParameterValueInfo (
  1548.   printJob                 : Smallint;
  1549.   const parameterFieldName : PChar;
  1550.   const reportName         : PChar;
  1551.   var valueInfo            : PEParameterValueInfo): Bool stdcall;
  1552.  
  1553. function PESetParameterValueInfo (
  1554.   printJob                 : Smallint;
  1555.   const parameterFieldName : PChar;
  1556.   const reportName         : PChar;
  1557.   var valueInfo            : PEParameterValueInfo): Bool stdcall;
  1558.  
  1559. {------------------------------------------------------------------------------}
  1560. { Getting/Setting multiple Current Values and Ranges                           }
  1561. {------------------------------------------------------------------------------}
  1562. const
  1563.   { Range Info }
  1564.   PE_RI_INCLUDEUPPERBOUND = 1;
  1565.   PE_RI_INCLUDELOWERBOUND = 2;
  1566.   PE_RI_NOUPPERBOUND      = 4;
  1567.   PE_RI_NOLOWERBOUND      = 8;
  1568.  
  1569.   PE_DR_HASRANGE            = 0;
  1570.   PE_DR_HASDISCRETE         = 1;
  1571.   PE_DR_HASDISCRETEANDRANGE = 2;
  1572.  
  1573. { If return value is -1 then an error has occurred. }
  1574. function PEGetNParameterCurrentValues (
  1575.   printJob                 : Smallint;
  1576.   const parameterFieldName : PChar;
  1577.   const reportName         : PChar): Word stdcall;
  1578.  
  1579. function PEGetNthParameterCurrentValue (
  1580.   printJob                 : Smallint;
  1581.   const parameterFieldName : PChar;
  1582.   const reportName         : PChar;
  1583.   index                    : Smallint;
  1584.   var currentValue         : PEValueInfo): Bool stdcall;
  1585.  
  1586. function PEAddParameterCurrentValue (
  1587.   printJob                 : Smallint;
  1588.   const parameterFieldName : PChar;
  1589.   const reportName         : PChar;
  1590.   var currentValue         : PEValueInfo): Bool stdcall;
  1591.  
  1592. { If return value is -1 then an error has occurred. }
  1593. function PEGetNParameterCurrentRanges (
  1594.   printJob                 : Smallint;
  1595.   const parameterFieldName : PChar;
  1596.   const reportName         : PChar) : Word stdcall;
  1597.  
  1598. function PEGetNthParameterCurrentRange (
  1599.   printJob                 : Smallint;
  1600.   const parameterFieldName : PChar;
  1601.   const reportName         : PChar;
  1602.   index                    : Smallint;
  1603.   var rangeStart           : PEValueInfo;
  1604.   var rangeEnd             : PEValueInfo;
  1605.   var rangeInfo            : Smallint): Bool stdcall;
  1606.  
  1607. function PEAddParameterCurrentRange (
  1608.   printJob                 : Smallint;
  1609.   const parameterFieldName : PChar;
  1610.   const reportName         : PChar;
  1611.   var rangeStart           : PEValueInfo;
  1612.   var rangeEnd             : PEValueInfo;
  1613.   rangeInfo                : Smallint): Bool stdcall;
  1614.  
  1615. function PEClearParameterCurrentValuesAndRanges (
  1616.   printJob                 : Smallint;
  1617.   const parameterFieldName : PChar;
  1618.   const reportName         : PChar): Bool stdcall;
  1619.  
  1620. {------------------------------------------------------------------------------}
  1621. { Parameter Field Type                                                         }
  1622. {------------------------------------------------------------------------------}
  1623. const
  1624.   { Parameter Field origin }
  1625.   PE_PO_REPORT     = 0;
  1626.   PE_PO_STOREDPROC = 1;
  1627.   PE_PO_QUERY      = 2;
  1628.  
  1629. {returns PE_PO_* or -1 if index is invalid.}
  1630. function PEGetNthParameterType (
  1631.   printJob : Smallint;
  1632.   index    : Smallint): Smallint stdcall;
  1633.  
  1634.  
  1635. {******************************************************************************}
  1636. { Record and Group SortFields                                                  }
  1637. {******************************************************************************}
  1638. {------------------------------------------------------------------------------}
  1639. { SortFields                                                                   }
  1640. {------------------------------------------------------------------------------}
  1641. function PEGetNSortFields (printJob: Smallint): Smallint stdcall;
  1642.  
  1643. function PEGetNthSortField (
  1644.   printJob       : Smallint;
  1645.   sortFieldN     : Smallint;
  1646.   var nameHandle : HWnd;
  1647.   var nameLength : Smallint;
  1648.   var direction  : Smallint): Bool stdcall;
  1649.  
  1650. function PESetNthSortField (
  1651.   printJob   : Smallint;
  1652.   sortFieldN : Smallint;
  1653.   Name       : PChar;
  1654.   direction  : Smallint): Bool stdcall;
  1655.  
  1656. function PEDeleteNthSortField (
  1657.   printJob   : Smallint;
  1658.   sortFieldN : Smallint): Bool stdcall;
  1659.  
  1660. {------------------------------------------------------------------------------}
  1661. { GroupSortFields                                                              }
  1662. {------------------------------------------------------------------------------}
  1663. function PEGetNGroupSortFields (printJob : Smallint): Smallint stdcall;
  1664.  
  1665. function PEGetNthGroupSortField (
  1666.   printJob       : Smallint;
  1667.   sortFieldN     : Smallint;
  1668.   var nameHandle : HWnd;
  1669.   var nameLength : Smallint;
  1670.   var direction  : Smallint): Bool stdcall;
  1671.  
  1672. function PESetNthGroupSortField (
  1673.   printJob   : Smallint;
  1674.   sortFieldN : Smallint;
  1675.   Name       : PChar;
  1676.   direction  : Smallint): Bool stdcall;
  1677.  
  1678. function PEDeleteNthGroupSortField (
  1679.   printJob   : Smallint;
  1680.   sortFieldN : Smallint): Bool stdcall;
  1681.  
  1682.  
  1683. {******************************************************************************}
  1684. { Controlling Databases                                                        }
  1685. {   The following functions allow retrieving and updating database info        }
  1686. {   in an opened report, so that a report can be printed using different       }
  1687. {   session, server, database, user and/or table location settings.  Any       }
  1688. {   changes made to the report via these functions are not permanent, and      }
  1689. {   only last as long as the report is open.                                   }
  1690. {                                                                              }
  1691. {   The following database functions (except for PELogOnServer and             }
  1692. {   PELogOffServer) must be called after PEOpenPrintJob and before             }
  1693. {   PEStartPrintJob.                                                           }
  1694. {******************************************************************************}
  1695. {------------------------------------------------------------------------------}
  1696. { Getting Number of Tables                                                     }
  1697. {   The function PEGetNTables is called to fetch the number of tables in       }
  1698. {   the report.  This includes all PC databases (e.g. Paradox, xBase)          }
  1699. {   as well as SQL databases (e.g. SQL Server, Oracle, Netware).               }
  1700. {------------------------------------------------------------------------------}
  1701. function PEGetNTables (printJob: Smallint): Smallint stdcall;
  1702.  
  1703. {------------------------------------------------------------------------------}
  1704. { Getting Table Type                                                           }
  1705. {   The function PEGetNthTableType allows the application to determine the     }
  1706. {   type of each table.  The application can test DBType (equal to             }
  1707. {   PE_DT_STANDARD or PE_DT_SQL), or test the database DLL name used to        }
  1708. {   create the report.  DLL names have the following naming convention:        }
  1709. {       - PDB*.DLL for standard (non-SQL) databases,                           }
  1710. {       - PDS*.DLL for SQL databases.                                          }
  1711. {                                                                              }
  1712. {   In the case of ODBC (PDSODBC.DLL) the DescriptiveName includes the         }
  1713. {   ODBC data source name.                                                     }
  1714. {------------------------------------------------------------------------------}
  1715. const
  1716.   PE_DLL_NAME_LEN            =  64;
  1717.   PE_FULL_NAME_LEN           = 256;
  1718.   { DBType constants }
  1719.   PE_DT_STANDARD             = 1;
  1720.   PE_DT_SQL                  = 2;
  1721.   PE_DT_SQL_STORED_PROCEDURE = 3;
  1722.  
  1723. type
  1724.   PEDllNameType  = array [0..PE_DLL_NAME_LEN - 1] of Char;
  1725.   PEFullNameType = array [0..PE_FULL_NAME_LEN - 1] of Char;
  1726.   PETableType = record
  1727.     StructSize      : Word; { Initialize to PE_SIZEOF_TABLE_TYPE }
  1728.     DLLName         : PEDllNameType;
  1729.     DescriptiveName : PEFullNameType;
  1730.     DBType          : Word;
  1731.   end;
  1732.  
  1733. const
  1734.   PE_SIZEOF_TABLE_TYPE = SizeOf(PETableType);
  1735.  
  1736. function PEGetNthTableType (
  1737.   printJob      : Smallint;
  1738.   tableN        : Smallint;
  1739.   var tableType : PETableType): Bool stdcall;
  1740.  
  1741. {------------------------------------------------------------------------------}
  1742. { Getting Table Session Info                                                   }
  1743. {   The functions PEGetNthTableSessionInfo and PESetNthTableSessionInfo        }
  1744. {   are only used when connecting to MS Access databases (which require a      }
  1745. {   session to be opened first)                                                }
  1746. {------------------------------------------------------------------------------}
  1747. const
  1748.   PE_SESS_USERID_LEN   = 128;
  1749.   PE_SESS_PASSWORD_LEN = 128;
  1750.  
  1751. type
  1752.   PESesPassType = array [0..PE_SESS_PASSWORD_LEN - 1] of Char;
  1753.   PESessUserType = array [0..PE_SESS_USERID_LEN - 1] of Char;
  1754.   PESessionInfo = record
  1755.     StructSize    : Word; { Initialize to PE_SIZEOF_SESSION_INFO }
  1756.     UserID        : PESessUserType;
  1757.     { Password is undefined when getting information from report. }
  1758.     Password      : PESesPassType;
  1759.     { SessionHandle is undefined when getting information from report. }
  1760.     { When setting information, if it is = 0 the UserID and Password }
  1761.     { settings are used, otherwise the SessionHandle is used. }
  1762.     SessionHandle : DWord;
  1763.   end;
  1764.  
  1765. const
  1766.   PE_SIZEOF_SESSION_INFO = SizeOf(PESessionInfo);
  1767.  
  1768. function PEGetNthTableSessionInfo (
  1769.   printJob        : Smallint;
  1770.   tableN          : Smallint;
  1771.   var sessionInfo : PESessionInfo): Bool stdcall;
  1772.  
  1773. function PESetNthTableSessionInfo (
  1774.   printJob              : Smallint;
  1775.   tableN                : Smallint;
  1776.   var sessionInfo       : PESessionInfo;
  1777.   propagateAcrossTables : Bool): Bool stdcall;
  1778.  
  1779. {------------------------------------------------------------------------------}
  1780. { Table LogOn/LogOff                                                           }
  1781. {   Logging on is performed when printing the report, but the correct          }
  1782. {   log on information must first be set using PESetNthTableLogOnInfo.         }
  1783. {   Only the password is required, but the server, database, and               }
  1784. {   user names may optionally be overriden as well.                            }
  1785. {                                                                              }
  1786. {   If the parameter propagateAcrossTables is TRUE, the new log on info        }
  1787. {   is also applied to any other tables in this report that had the            }
  1788. {   same original server and database names as this table.  If FALSE           }
  1789. {   only this table is updated.                                                }
  1790. {                                                                              }
  1791. {   Logging off is performed automatically when the print job is closed.       }
  1792. {------------------------------------------------------------------------------}
  1793. const
  1794.   PE_SERVERNAME_LEN      = 128;
  1795.   PE_DATABASENAME_LEN    = 128;
  1796.   PE_USERID_LEN          = 128;
  1797.   PE_PASSWORD_LEN        = 128;
  1798.  
  1799. type
  1800.   PELogonServerType = array [0..PE_SERVERNAME_LEN - 1] of Char;
  1801.   PELogonDbType     = array [0..PE_DATABASENAME_LEN - 1] of Char;
  1802.   PELogonUserType   = array [0..PE_USERID_LEN - 1] of Char;
  1803.   PELogonPassType   = array [0..PE_PASSWORD_LEN - 1] of Char;
  1804.   PELogOnInfo = record
  1805.     StructSize   : Word; { Initialize to PE_SIZEOF_LOGON_INFO }
  1806.     (* For any of the following values an empty string ("") means to use
  1807.     ** the value already set in the report.  To override a value in the
  1808.     ** report use a non-empty string (e.g. "Server A").  All strings are
  1809.     ** null-terminated.
  1810.     **
  1811.     ** For Netware SQL, pass the dictionary path name in ServerName and
  1812.     ** data path name in DatabaseName. *)
  1813.     ServerName   : PELogonServerType;
  1814.     DatabaseName : PELogonDbType;
  1815.     UserId       : PELogonUserType;
  1816.     (* Password is undefined when getting information from report. *)
  1817.     Password     : PELogonPassType;
  1818.   end;
  1819.  
  1820. const
  1821.   PE_SIZEOF_LOGON_INFO = SizeOf(PELogOnInfo);
  1822.  
  1823. function PEGetNthTableLogOnInfo (
  1824.   printJob      : Smallint;
  1825.   tableN        : Smallint;
  1826.   var logOnInfo : PELogOnInfo): Bool stdcall;
  1827.  
  1828. function PESetNthTableLogOnInfo (
  1829.   printJob              : Smallint;
  1830.   tableN                : Smallint;
  1831.   var logOnInfo         : PELogOnInfo;
  1832.   propagateAcrossTables : Bool): Bool stdcall;
  1833.  
  1834. {------------------------------------------------------------------------------}
  1835. { Table Location                                                               }
  1836. {   A table's location is fetched and set using PEGetNthTableLocation and      }
  1837. {   PESetNthTableLocation.  This name is database-dependent, and must be       }
  1838. {   formatted correctly for the expected database.  For example:               }
  1839. {       - Paradox: "c:\crw\ORDERS.DB"                                          }
  1840. {       - SQL Server: "publications.dbo.authors"                               }
  1841. {------------------------------------------------------------------------------}
  1842. const
  1843.   PE_TABLE_LOCATION_LEN    = 256;
  1844.   PE_CONNECTION_BUFFER_LEN = 512;
  1845.  
  1846. type
  1847.   PETableLocType = array [0..PE_TABLE_LOCATION_LEN - 1] of Char;
  1848.   PEConnectBufferType = array [0..PE_CONNECTION_BUFFER_LEN - 1] of Char;
  1849.   PETableLocation = record
  1850.     StructSize    : Word; { Initialize to PE_SIZEOF_TABLE_LOCATION }
  1851.     Location      : PETableLocType;
  1852.     SubLocation   : PETableLocType; { For MS Access Table Names }
  1853.     ConnectBuffer : PEConnectBufferType;
  1854.   end;
  1855.  
  1856. const
  1857.   PE_SIZEOF_TABLE_LOCATION = SizeOf(PETableLocation);
  1858.  
  1859. function PEGetNthTableLocation (
  1860.   printJob     : Smallint;
  1861.   tableN       : Smallint;
  1862.   var location : PETableLocation): Bool stdcall;
  1863.  
  1864. function PESetNthTableLocation (
  1865.   printJob     : Smallint;
  1866.   tableN       : Smallint;
  1867.   var location : PETableLocation): Bool stdcall;
  1868.  
  1869. {------------------------------------------------------------------------------}
  1870. { Table Private Info - for CDO, ADO, etc.                                      }
  1871. {------------------------------------------------------------------------------}
  1872. type
  1873.   crBytePointer = ^Byte;
  1874.   PETablePrivateInfo = record
  1875.     StructSize : Word;  { initialize to PE_SIZEOF_TABLE_PRIVATE_INFO }
  1876.     nBytes     : Smallint;
  1877.     tag        : DWord;
  1878.     dataPtr    : crBytePointer;
  1879.   end;
  1880.  
  1881. const
  1882.   PE_SIZEOF_TABLE_PRIVATE_INFO = SizeOf(PETablePrivateInfo);
  1883.  
  1884. function PEGetNthTablePrivateInfo (
  1885.   printJob        : Smallint;
  1886.   tableN          : Smallint;
  1887.   var privateInfo : PETablePrivateInfo): Bool stdcall;
  1888.  
  1889. function PESetNthTablePrivateInfo (
  1890.   printJob        : Smallint;
  1891.   tableN          : Smallint;
  1892.   var privateInfo : PETablePrivateInfo): Bool stdcall;
  1893.  
  1894. {------------------------------------------------------------------------------}
  1895. { Test Connectivity                                                            }
  1896. {   The function PETestNthTableConnectivity tests whether a database           }
  1897. {   table's settings are valid and ready to be reported on.  It returns        }
  1898. {   true if the database session, log on, and location info is all             }
  1899. {   correct.                                                                   }
  1900. {                                                                              }
  1901. {   This is useful, for example, in prompting the user and testing a           }
  1902. {   server password before printing begins.                                    }
  1903. {                                                                              }
  1904. {   This function may require a significant amount of time to complete,        }
  1905. {   since it will first open a user session (if required), then log onto       }
  1906. {   the database server (if required), and then open the appropriate           }
  1907. {   database table (to test that it exists).  It does not read any data,       }
  1908. {   and closes the table immediately once successful.  Logging off is          }
  1909. {   performed when the print job is closed.                                    }
  1910. {                                                                              }
  1911. {   If it fails in any of these steps, the error code set indicates            }
  1912. {   which database info needs to be updated using functions above:             }
  1913. {      - If it is unable to begin a session, PE_ERR_DATABASESESSION is set,    }
  1914. {        and the application should update with PESetNthTableSessionInfo.      }
  1915. {      - If it is unable to log onto a server, PE_ERR_DATABASELOGON is set,    }
  1916. {        and the application should update with PESetNthTableLogOnInfo.        }
  1917. {      - If it is unable open the table, PE_ERR_DATABASELOCATION is set,       }
  1918. {        and the application should update with PESetNthTableLocation.         }
  1919. {------------------------------------------------------------------------------}
  1920. function PETestNthTableConnectivity (
  1921.   printJob : Smallint;
  1922.   tableN   : Smallint): Bool stdcall;
  1923.  
  1924. {------------------------------------------------------------------------------}
  1925. { Logging On/Off Server                                                        }
  1926. {   PELogOnServer and PELogOffServer can be called at any time to log on       }
  1927. {   and off of a database server.  These functions are not required if         }
  1928. {   function PESetNthTableLogOnInfo above was already used to set the          }
  1929. {   password for a table.                                                      }
  1930. {                                                                              }
  1931. {   These functions require a database DLL name, which can be retrieved        }
  1932. {   using PEGetNthTableType above.                                             }
  1933. {                                                                              }
  1934. {   This function can also be used for non-SQL tables, such as password-       }
  1935. {   protected Paradox tables.  Call this function to set the password          }
  1936. {   for the Paradox DLL before beginning printing.                             }
  1937. {                                                                              }
  1938. {   Note: When printing using PEStartPrintJob the ServerName passed in         }
  1939. {   PELogOnServer must agree exactly with the server name stored in the        }
  1940. {   report.  If this is not true use PESetNthTableLogOnInfo to perform         }
  1941. {   logging on instead.                                                        }
  1942. {------------------------------------------------------------------------------}
  1943. function PELogOnServer (
  1944.   dllName       : PChar;
  1945.   var logOnInfo : PELogOnInfo): Bool stdcall;
  1946.  
  1947. function PELogOffServer (
  1948.   dllName       : PChar;
  1949.   var logOnInfo : PELogOnInfo): Bool stdcall;
  1950.  
  1951. function PELogOnSQLServerWithPrivateInfo (
  1952.   dllName     : PChar;
  1953.   privateInfo : Pointer): Bool stdcall;
  1954.  
  1955. {------------------------------------------------------------------------------}
  1956. { Verify Database                                                              }
  1957. {------------------------------------------------------------------------------}
  1958. function PEVerifyDatabase(printJob : Smallint): Bool stdcall;
  1959.  
  1960. {------------------------------------------------------------------------------}
  1961. { Check Table Differences                                                      }
  1962. {------------------------------------------------------------------------------}
  1963. const
  1964.   { Constants returned from PECheckNthTableDifferences, }
  1965.   { can be any combination of the following: }
  1966.   PE_TCD_OKAY                     = $00000000;
  1967.   PE_TCD_DATABASENOTFOUND         = $00000001;
  1968.   PE_TCD_SERVERNOTFOUND           = $00000002;
  1969.   PE_TCD_SERVERNOTOPENED          = $00000004;
  1970.   PE_TCD_ALIASCHANGED             = $00000008;
  1971.   PE_TCD_INDEXESCHANGED           = $00000010;
  1972.   PE_TCD_DRIVERCHANGED            = $00000020;
  1973.   PE_TCD_DICTIONARYCHANGED        = $00000040;
  1974.   PE_TCD_FILETYPECHANGED          = $00000080;
  1975.   PE_TCD_RECORDSIZECHANGED        = $00000100;
  1976.   PE_TCD_ACCESSCHANGED            = $00000200;
  1977.   PE_TCD_PARAMETERSCHANGED        = $00000400;
  1978.   PE_TCD_LOCATIONCHANGED          = $00000800;
  1979.   PE_TCD_DATABASEOTHER            = $00001000;
  1980.   PE_TCD_NUMFIELDSCHANGED         = $00010000;
  1981.   PE_TCD_FIELDOTHER               = $00020000;
  1982.   PE_TCD_FIELDNAMECHANGED         = $00040000;
  1983.   PE_TCD_FIELDDESCCHANGED         = $00080000;
  1984.   PE_TCD_FIELDTYPECHANGED         = $00100000;
  1985.   PE_TCD_FIELDSIZECHANGED         = $00200000;
  1986.   PE_TCD_NATIVEFIELDTYPECHANGED   = $00400000;
  1987.   PE_TCD_NATIVEFIELDOFFSETCHANGED = $00800000;
  1988.   PE_TCD_NATIVEFIELDSIZECHANGED   = $01000000;
  1989.   PE_TCD_FIELDDECPLACESCHANGED    = $02000000;
  1990.  
  1991. type
  1992.   PETableDifferenceInfo = record
  1993.     StructSize       : Word;
  1994.     tableDifferences : DWord; { any combination of PE_TCD_* }
  1995.     reserved1        : DWord; { reserved - do not use }
  1996.     reserved2        : DWord; { reserved - do not use }
  1997.   end;
  1998.  
  1999. const
  2000.   PE_SIZEOF_TABLE_DIFFERENCE_INFO = SizeOf(PETableDifferenceInfo);
  2001.  
  2002. { Not implemented for Reports based on Dictionaries: returns PE_ERR_NOTIMPLEMENTED }
  2003. function PECheckNthTableDifferences (
  2004.   printJob                : Smallint;
  2005.   tableN                  : Smallint;
  2006.   var tabledifferenceinfo : PETableDifferenceInfo): Bool stdcall;
  2007.  
  2008.  
  2009. {******************************************************************************}
  2010. { Overriding SQL Query in Report                                               }
  2011. {   PEGetSQLQuery () returns the same query as appears in the Show SQL Query   }
  2012. {   dialog in CRW, in syntax specific to the database driver you are using.    }
  2013. {                                                                              }
  2014. {   PESetSQLQuery () is mostly useful for reports with SQL queries that        }
  2015. {   were explicitly edited in the Show SQL Query dialog in CRW, i.e. those     }
  2016. {   reports that needed database-specific selection criteria or joins.         }
  2017. {   (Otherwise it is usually best to continue using function calls such as     }
  2018. {   PESetSelectionFormula () and let CRW build the SQL query automatically.    }
  2019. {                                                                              }
  2020. {   PESetSQLQuery () has the same restrictions as editing in the Show SQL      }
  2021. {   Query dialog; in particular that changes are accepted in the FROM and      }
  2022. {   WHERE clauses but ignored in the SELECT list of fields.                    }
  2023. {******************************************************************************}
  2024. function PEGetSQLQuery (
  2025.   printJob       : Smallint;
  2026.   var textHandle : HWnd;
  2027.   var textLength : Smallint): Bool stdcall;
  2028.  
  2029. function PESetSQLQuery (
  2030.   printJob    : Smallint;
  2031.   queryString : PChar): Bool stdcall;
  2032.  
  2033.  
  2034. {******************************************************************************}
  2035. { Saved Data                                                                   }
  2036. {   Use PEHasSavedData() to find out if a report currently has saved data      }
  2037. {   associated with it.  This may or may not be TRUE when a print job is       }
  2038. {   first opened from a report file.  Since data is saved during a print,      }
  2039. {   this will always be TRUE immediately after a report is printed.            }
  2040. {                                                                              }
  2041. {   Use PEDiscardSavedData() to release the saved data associated with a       }
  2042. {   report.  The next time the report is printed, it will get current data     }
  2043. {   from the database.                                                         }
  2044. {                                                                              }
  2045. {   The default behavior is for a report to use its saved data, rather than    }
  2046. {   refresh its data from the database when printing a report.                 }
  2047. {******************************************************************************}
  2048. function PEHasSavedData (
  2049.   printJob         : Smallint;
  2050.   var hasSavedData : Bool): Bool stdcall;
  2051.  
  2052. function PEDiscardSavedData (printJob : Smallint): Bool stdcall;
  2053.  
  2054.  
  2055. {******************************************************************************}
  2056. { Report Title                                                                 }
  2057. {******************************************************************************}
  2058. function PEGetReportTitle (
  2059.   printJob        : Smallint;
  2060.   var titleHandle : HWnd;
  2061.   var titleLength : Smallint): Bool stdcall;
  2062.  
  2063. function PESetReportTitle (
  2064.   printJob : Smallint;
  2065.   title    : PChar): Bool stdcall;
  2066.  
  2067.  
  2068. {******************************************************************************}
  2069. { Output to Window                                                             }
  2070. {******************************************************************************}
  2071. function PEOutputToWindow (
  2072.   printJob     : Smallint;
  2073.   title        : PChar;
  2074.   left         : Integer;
  2075.   top          : Integer;
  2076.   width        : Integer;
  2077.   height       : Integer;
  2078.   style        : DWord;
  2079.   parentWindow : HWnd): Bool stdcall;
  2080.  
  2081. function PEGetWindowHandle (printJob: Smallint): HWnd stdcall;
  2082.  
  2083. procedure PECloseWindow (printJob: Smallint) stdcall;
  2084.  
  2085. {------------------------------------------------------------------------------}
  2086. { Window Options/Print Controls                                                }
  2087. {------------------------------------------------------------------------------}
  2088. type
  2089.   PEWindowOptions = record
  2090.     StructSize            : Word;     { initialize to PE_SIZEOF_WINDOW_OPTIONS}
  2091.     hasGroupTree          : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2092.     canDrillDown          : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2093.     hasNavigationControls : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2094.     hasCancelButton       : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2095.     hasPrintButton        : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2096.     hasExportButton       : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2097.     hasZoomControl        : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2098.     hasCloseButton        : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2099.     hasProgressControls   : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2100.     hasSearchButton       : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2101.     hasPrintSetupButton   : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2102.     hasRefreshButton      : Smallint; { 0 or 1 except use PE_UNCHANGED for no change}
  2103.     showToolbarTips       : Smallint; { BOOL value, except use PE_UNCHANGED for no change}
  2104.                                       { default is TRUE (*Show* tooltips on toolbar)}
  2105.     showDocumentTips      : Smallint; { BOOL value, except use PE_UNCHANGED for no change}
  2106.                                       { default is FALSE (*Hide* tooltips on document)}
  2107.     hasLaunchButton       : Smallint; { Launch Seagate Analysis button on toolbar. }
  2108.                                       { BOOL value, except use PE_UNCHANGED for no change }
  2109.                                       { default is FALSE }
  2110.   end;
  2111.  
  2112. const
  2113.   PE_SIZEOF_WINDOW_OPTIONS = SizeOf(PEWindowOptions);
  2114.  
  2115. function PEGetWindowOptions (
  2116.   printJob    : Smallint;
  2117.   var options : PEWindowOptions): Bool stdcall;
  2118.  
  2119. function PESetWindowOptions (
  2120.   printJob    : Smallint;
  2121.   var options : PEWindowOptions): Bool stdcall;
  2122.  
  2123. function PEShowPrintControls (
  2124.   printJob          : Smallint;
  2125.   showPrintControls : Bool): Bool stdcall;
  2126.  
  2127. function PEPrintControlsShowing (
  2128.   printJob            : Smallint;
  2129.   var controlsShowing : Bool): Bool stdcall;
  2130.  
  2131. {------------------------------------------------------------------------------}
  2132. { Paging                                                                       }
  2133. {------------------------------------------------------------------------------}
  2134. function PEShowFirstPage (printJob: Smallint): Bool stdcall;
  2135. function PEShowNextPage (printJob: Smallint): Bool stdcall;
  2136. function PEShowPreviousPage (printJob: Smallint): Bool stdcall;
  2137. function PEShowLastPage (printJob: Smallint): Bool stdcall;
  2138.  
  2139. function PEGetNPages (printJob: Smallint): Smallint stdcall;
  2140.  
  2141. function PEShowNthPage (
  2142.   printJob : Smallint;
  2143.   pageN    : Smallint): Bool stdcall;
  2144.  
  2145. {------------------------------------------------------------------------------}
  2146. { Window Zoom                                                                  }
  2147. {------------------------------------------------------------------------------}
  2148. const
  2149.   PE_ZOOM_FULL_SIZE           = 0;
  2150.   PE_ZOOM_SIZE_FIT_ONE_SIDE   = 1;
  2151.   PE_ZOOM_SIZE_FIT_BOTH_SIDES = 2;
  2152.  
  2153. function PEZoomPreviewWindow (
  2154.   printJob : Smallint;
  2155.   level    : Smallint): Bool stdcall;
  2156.   {level: a percent from 25 to 400 or a PE_ZOOM_ constant}
  2157.  
  2158. function PENextPrintWindowMagnification (printJob:  Smallint): Bool stdcall;
  2159.  
  2160. {------------------------------------------------------------------------------}
  2161. { Print/Export Preview Window                                                  }
  2162. {------------------------------------------------------------------------------}
  2163. function PEPrintWindow (
  2164.   printJob      : Smallint;
  2165.   waitUntilDone : Bool): Bool stdcall;
  2166.  
  2167. function PEExportPrintWindow (
  2168.   printJob      : Smallint;
  2169.   toMail        : Bool;
  2170.   waitUntilDone : Bool): Bool stdcall;
  2171.  
  2172.  
  2173. {******************************************************************************}
  2174. { Output to Printer                                                            }
  2175. {******************************************************************************}
  2176. function PEOutputToPrinter (
  2177.   printJob : Smallint;
  2178.   nCopies  : Smallint): Bool stdcall;
  2179.  
  2180. function PESelectPrinter (
  2181.   printJob    : Smallint;
  2182.   driverName  : PChar;
  2183.   printerName : PChar;
  2184.   portName    : PChar;
  2185.   mode        : PDevMode): Bool stdcall;
  2186.  
  2187. function PEGetSelectedPrinter (
  2188.   printJob          : Smallint;
  2189.   var driverHandle  : Hwnd;
  2190.   var driverLength  : Smallint;
  2191.   var printerHandle : Hwnd;
  2192.   var printerLength : Smallint;
  2193.   var portHandle    : Hwnd;
  2194.   var portLength    : Smallint;
  2195.   var mode          : PDevMode): Bool stdcall;
  2196.  
  2197. function PEFreeDevMode (
  2198.   printJob : Smallint; 
  2199.   mode     : PDevMode): Bool stdcall;
  2200.  
  2201. {******************************************************************************}
  2202. { Detail Copies                                                                }
  2203. {   Commonly used for label-style Reports                                      }
  2204. {******************************************************************************}
  2205. function PESetNDetailCopies (
  2206.   printJob : Smallint;
  2207.   nCopies  : Smallint): Bool stdcall;
  2208.  
  2209. function PEGetNDetailCopies (
  2210.   printJob          : Smallint;
  2211.   var nDetailCopies : Smallint): Bool stdcall;
  2212.  
  2213.  
  2214. {******************************************************************************}
  2215. { Print Options                                                                }
  2216. {   Extension to PESetPrintOptions function: If the 2nd parameter              }
  2217. {   (pointer to PEPrintOptions) is set to 0 (null) the function prompts        }
  2218. {   the user for these options.                                                }
  2219. {                                                                              }
  2220. {   With this change, you can get the behaviour of the print-to-printer        }
  2221. {   button in the print window by calling PESetPrintOptions with a             }
  2222. {   null pointer and then calling PEPrintWindow.                               }
  2223. {******************************************************************************}
  2224. const
  2225.   {Start/Stop Page}
  2226.   PE_MAXPAGEN            = 65535;
  2227.   {Output FileName}
  2228.   PE_FILE_PATH_LEN       = 512;
  2229.   {Collation}
  2230.   PE_UNCOLLATED          = 0;
  2231.   PE_COLLATED            = 1;
  2232.   PE_DEFAULTCOLLATION    = 2;
  2233.  
  2234. type
  2235.   PEOutputFileNameType = array [0..PE_FILE_PATH_LEN-1] of Char;
  2236.   PEPrintOptions  = record
  2237.     StructSize     : Word; { initialize to SizeOf(PEPrintOptions) }
  2238.     { page and copy numbers are 1-origin }
  2239.     { use 0 to preserve the existing Strings }
  2240.     StartPageN     : Word;
  2241.     StopPageN      : Word;
  2242.     nReportCopies  : Word;
  2243.     Collation      : Word;
  2244.     outputFileName : PEOutputFileNameType;
  2245.   end;
  2246.  
  2247. function PESetPrintOptions (
  2248.   printJob    : Smallint;
  2249.   var options : PEPrintOptions): Bool stdcall;
  2250.  
  2251. function PEGetPrintOptions (
  2252.   printJob    : Smallint;
  2253.   var options : PEPrintOptions):Bool stdcall;
  2254.  
  2255.  
  2256. {******************************************************************************}
  2257. { Exporting                                                                    }
  2258. {******************************************************************************}
  2259. const
  2260.   UXFCrystalReportType    = 0;
  2261.   UXFWordWinType          = 0;
  2262.   UXFWordDosType          = 1;
  2263.   UXFWordPerfectType      = 2;
  2264.   UXFTextType             = 0;
  2265.   UXFTabbedTextType       = 1;
  2266.   UXFRichTextFormatType   = 0;
  2267.   UXFLotusWksType         = 0;
  2268.   UXFLotusWk1Type         = 1;
  2269.   UXFLotusWk3Type         = 2;
  2270.   UXFReportDefinitionType = 0;
  2271.  
  2272. type
  2273.   PEExportOptions  = record
  2274.     { Initialize to SizeOfPEExportOptions }
  2275.     StructSize               : Word;
  2276.     formatDLLName            : PEDllNameType;
  2277.     formatType               : DWord;
  2278.     formatOptions            : Pointer;
  2279.     destinationDLLName       : PEDllNameType;
  2280.     destinationType          : DWord;
  2281.     destinationOptions       : Pointer;
  2282.     nFormatOptionsBytes      : Word; { Set by PEExportOptions }
  2283.                                      { Ignored by PEExportTo  }
  2284.     nDestinationOptionsBytes : Word; { Set by PEExportOptions }
  2285.                                      { Ignored by PEExportTo  }
  2286.   end;
  2287.  
  2288. const
  2289.   PE_SIZEOF_EXPORT_OPTIONS = SizeOf(PEExportOptions);
  2290.  
  2291. function PEGetExportOptions (
  2292.   printJob    : Smallint;
  2293.   var options : PEExportOptions): Bool stdcall;
  2294.  
  2295. function PEExportTo (
  2296.   printJob    : Smallint;
  2297.   var options : PEExportOptions): Bool stdcall;
  2298.  
  2299. {------------------------------------------------------------------------------}
  2300. { Export to Excel                                                              }
  2301. {------------------------------------------------------------------------------}
  2302. const
  2303.   UXFXls2Type            = 0;
  2304.   UXFXls3Type            = 1;
  2305.   UXFXls4Type            = 2;
  2306.   UXFXls5Type            = 3;
  2307.   UXFXls5TypeTab         = 4; {Left in for backward compatibility}
  2308.   UXFXls5TypeExt         = 4;
  2309.   UXFXl7Type             = 5;
  2310.   UXFXl7TabType          = 6;
  2311.   UXFXl8Type             = 7;
  2312.   UXFXl8TabType          = 8;
  2313.   DEFAULT_COLUMN_WIDTH   = 10;
  2314.  
  2315. type
  2316.   UXFXlsOptions = record
  2317.     structSize        : Word;
  2318.     bColumnHeadings   : Bool;
  2319.     {TRUE -- has column headings, which come from}
  2320.     {        "Page Header" and "Report Header" areas.}
  2321.     {FALSE -- no column headings.}
  2322.     {The default value is FALSE.}
  2323.     bUseconstColWidth : Bool;
  2324.     {TRUE -- use constant column width}
  2325.     {FALSE -- set column width based on an area}
  2326.     {The default value is FALSE.}
  2327.     fconstColWidth    : double;
  2328.     {Column width, when bUseconstColWidth is TRUE.}
  2329.     {The default value is DEFAULT_COLUMN_WIDTH (10)}
  2330.     bTabularFormat    : Bool;
  2331.     {TRUE -- tabular format (flatten an area into a row)}
  2332.     {FALSE -- non-tabular format}
  2333.     {The default value is FALSE.}
  2334.     baseAreaType      : AreaType;
  2335.     {One of the 7 area types defined by PE_SECT_ constants.}
  2336.     {The default value is PE_SECT_DETAIL Details.}
  2337.     baseAreaGroupNum  : Word;
  2338.     {If baseAreaType is either GroupHeader or GroupFooter,
  2339.     { and there are more than one group, we need to give the group number.}
  2340.     {The default value is 1.}
  2341.     bUseWorksheetFunc  : Bool;
  2342.     { If TRUE, use Excel worksheet functions to represent }
  2343.     { subtotal fields in SCR. }
  2344.     { The default value is TRUE. }
  2345.   end;
  2346.  
  2347. const
  2348.   UXFXlsOptionsSize = SizeOf(UXFXlsOptions);
  2349.  
  2350. {------------------------------------------------------------------------------}
  2351. { Export to Lotus Notes Database                                               }
  2352. {------------------------------------------------------------------------------}
  2353. const
  2354.   UXDNotesType = 3;
  2355.  
  2356. type
  2357.   UXDNotesOptions = record
  2358.     structSize : Word;
  2359.     szDBName   : PChar;
  2360.     szFormName : PChar;  // should be "Report Form"
  2361.     szComments : PChar;
  2362.   end;
  2363.  
  2364. const
  2365.   UXDNotesOptionsSize = SizeOf(UXDNotesOptions);
  2366.  
  2367. {------------------------------------------------------------------------------}
  2368. { Export to Disk                                                               }
  2369. {------------------------------------------------------------------------------}
  2370. const
  2371.   UXDDiskType = 0;
  2372.  
  2373. type
  2374.   UXDDiskOptions = record
  2375.     {Initialize to UXDDiskOptionsSize}
  2376.     structSize : Word;
  2377.     fileName   : PChar;
  2378.   end;
  2379.  
  2380. const
  2381.   UXDDiskOptionsSize = SizeOf(UXDDiskOptions);
  2382.  
  2383. {------------------------------------------------------------------------------}
  2384. { Export to MAPI                                                               }
  2385. {------------------------------------------------------------------------------}
  2386. const
  2387.   UXDMAPIType = 0;
  2388.  
  2389. type
  2390.   UXDMAPIOptions = record
  2391.     {Initialize to UXDMAPIOptionsSize}
  2392.     structSize  : Word;
  2393.     toList      : PChar;
  2394.     ccList      : PChar;
  2395.     subject     : PChar;
  2396.     mailmessage : PChar;
  2397.   end;
  2398.  
  2399. const
  2400.   UXDMAPIOptionsSize = SizeOf(UXDMAPIOptions);
  2401.  
  2402. {------------------------------------------------------------------------------}
  2403. { Export to DIF                                                                }
  2404. {------------------------------------------------------------------------------}
  2405. const
  2406.   UXFDIFType = 0;
  2407.  
  2408. type
  2409.   UXFDIFOptions = record
  2410.     {Initialize to UXFDIFOptionsSize}
  2411.     structSize            : Word;
  2412.     useReportNumberFormat : Bool;
  2413.     useReportDateFormat   : Bool;
  2414.   end;
  2415.  
  2416. const
  2417.   UXFDIFOptionsSize = SizeOf(UXFDIFOptions);
  2418.  
  2419. {------------------------------------------------------------------------------}
  2420. { Export to RecordStyle                                                        }
  2421. {------------------------------------------------------------------------------}
  2422. const
  2423.   UXFRecordType = 0;
  2424.  
  2425. type
  2426.   UXFRecordStyleOptions = record
  2427.     {Initialize to UXFRecordStyleOptionsSize}
  2428.     structSize            : Word;
  2429.     useReportNumberFormat : Bool;
  2430.     useReportDateFormat   : Bool;
  2431.   end;
  2432.  
  2433. const
  2434.   UXFRecordStyleOptionsSize = SizeOf(UXFRecordStyleOptions);
  2435.  
  2436. {------------------------------------------------------------------------------}
  2437. { Export to Comma/Tab Separated                                                }
  2438. {------------------------------------------------------------------------------}
  2439. const
  2440.   UXFCommaSeparatedType = 0;
  2441.   UXFTabSeparatedType   = 1;
  2442.  
  2443. type
  2444.   UXFCommaTabSeparatedOptions = record
  2445.     {Initialize to UXFCommaTabSeparatedOptionsSize}
  2446.     structSize            : Word;
  2447.     useReportNumberFormat : Bool;
  2448.     useReportDateFormat   : Bool;
  2449.   end;
  2450.  
  2451. const
  2452.   UXFCommaTabSeparatedOptionsSize = SizeOf(UXFCommaTabSeparatedOptions);
  2453.  
  2454. {------------------------------------------------------------------------------}
  2455. { Export to Char Separated                                                     }
  2456. {------------------------------------------------------------------------------}
  2457. const
  2458.   UXFCharSeparatedType = 2;
  2459.  
  2460. type
  2461.   UXFCharSeparatedOptions = record
  2462.     {Initialize to UXFCharSeparatedOptionsSize}
  2463.     structSize            : Word;
  2464.     useReportNumberFormat : Bool;
  2465.     useReportDateFormat   : Bool;
  2466.     stringDelimiter       : Char;
  2467.     fieldDelimiter        : PChar;
  2468.   end;
  2469.  
  2470. const
  2471.   UXFCharSeparatedOptionsSize = SizeOf(UXFCharSeparatedOptions);
  2472.  
  2473. {------------------------------------------------------------------------------}
  2474. { Export to VIM                                                                }
  2475. {------------------------------------------------------------------------------}
  2476. const
  2477.   UXDVIMType = 0;
  2478.  
  2479. type
  2480.   UXDVIMOptions = record
  2481.     {Initialize to UXDVIMOptionsSize}
  2482.     structSize  : Word;
  2483.     toList      : PChar;
  2484.     ccList      : PChar;
  2485.     bccList     : PChar;
  2486.     subject     : PChar;
  2487.     mailmessage : PChar;
  2488.   end;
  2489.  
  2490. const
  2491.   UXDVIMOptionsSize = SizeOf(UXDVIMOptions);
  2492.  
  2493. {------------------------------------------------------------------------------}
  2494. { Export to Exchange                                                           }
  2495. {------------------------------------------------------------------------------}
  2496. const
  2497.   UXDExchFolderType = 0;
  2498.   UXDPostDocMessage = 1011; {wDestType for folder messages}
  2499.  
  2500. type
  2501.   UXDPostFolderOptions = record
  2502.     structSize    : Word;
  2503.     pszProfile    : PChar;
  2504.     pszPassword   : PChar;
  2505.     wDestType     : Word;
  2506.     pszFolderPath : PChar;
  2507.   end;
  2508.  
  2509.   { pszFolderPath has to be in the following format:
  2510.      <Message Store Name>@<Folder Name>@<Folder Name> }
  2511.  
  2512. const
  2513.   UXDPostFolderOptionsSize = SizeOf(UXDPostFolderOptions);
  2514.  
  2515. {------------------------------------------------------------------------------}
  2516. { Export to ODBC                                                               }
  2517. {------------------------------------------------------------------------------}
  2518. const
  2519.   UXFODBCType = 0;
  2520.  
  2521. type
  2522.   UXFODBCOptions = record
  2523.     structSize         : Word;
  2524.     dataSourceName     : PChar;
  2525.     dataSourceUserID   : PChar;
  2526.     dataSourcePassword : PChar;
  2527.     exportTableName    : PChar;
  2528.   end;
  2529.  
  2530. const
  2531.   UXFODBCOptionsSize = SizeOf(UXFODBCOptions);
  2532.  
  2533. {------------------------------------------------------------------------------}
  2534. { Export to HTML                                                               }
  2535. {------------------------------------------------------------------------------}
  2536. const
  2537.   UXFHTML3Type     = 0; {Draft HTML 3.0 tags}
  2538.   UXFExplorer2Type = 1; {Include MS Explorer 2.0 tags}
  2539.   UXFNetscape2Type = 2; {Include Netscape 2.0 tags}
  2540.   UXFHTML32ExtType = 1; {HTML 3.2 tags + bg color extensions}
  2541.   UXFHTML32StdType = 2; {HTML 3.2 tags}
  2542.  
  2543. type
  2544.   UXFHTML3Options = record
  2545.     structSize : Word;  { set to UXFHTML3OptionsSize }
  2546.     fileName   : PChar; { ptr to full Windows filepath of HTML output file }
  2547.                         { e.g. "C:\pub\docs\boxoffic\default.htm" }
  2548.                         { NOTE: any exported GIF files will be  }
  2549.                         { located in the same directory as this file }
  2550.   end;
  2551.  
  2552. const
  2553.   UXFHTML3OptionsSize = SizeOf(UXFHTML3Options);
  2554.  
  2555. {------------------------------------------------------------------------------}
  2556. { Export to Paginated Text                                                     }
  2557. {------------------------------------------------------------------------------}
  2558. const
  2559.   UXFPaginatedTextType = 2;
  2560.  
  2561. type
  2562.   UXFPaginatedTextOptions = record
  2563.     structSize     :Word;
  2564.     nLinesPerPage  :Word;
  2565.   end;
  2566.  
  2567. const
  2568.   UXFPaginatedTextOptionsSize = SizeOf(UXFPaginatedTextOptions);
  2569.  
  2570. {------------------------------------------------------------------------------}
  2571. { Export to Application                                                        }
  2572. {------------------------------------------------------------------------------}
  2573. const
  2574.   UXDApplicationType = 0;
  2575.  
  2576. type
  2577.   UXDApplicationOptions = record
  2578.     structSize : word;
  2579.     fileName : PChar;
  2580.   end;
  2581.  
  2582. const
  2583.   UXDApplicationOptionsSize = SizeOf(UXDApplicationOptions);
  2584.  
  2585.  
  2586. {******************************************************************************}
  2587. { Setting Page Margins                                                         }
  2588. {******************************************************************************}
  2589. const
  2590.   PE_SM_DEFAULT = $8000;
  2591.  
  2592. function PESetMargins (
  2593.   printJob : Smallint;
  2594.   left     : Smallint;
  2595.   right    : Smallint;
  2596.   top      : Smallint;
  2597.   bottom   : Smallint): Bool stdcall;
  2598.  
  2599. function PEGetMargins (
  2600.   printJob   : Smallint;
  2601.   var left   : Smallint;
  2602.   var right  : Smallint;
  2603.   var top    : Smallint;
  2604.   var bottom : Smallint): Bool stdcall;
  2605.  
  2606.  
  2607. {******************************************************************************}
  2608. { Report Summary Info                                                          }
  2609. {******************************************************************************}
  2610. const
  2611.   PE_SI_APPLICATION_NAME_LEN  = 128;
  2612.   PE_SI_TITLE_LEN             = 128;
  2613.   PE_SI_SUBJECT_LEN           = 128;
  2614.   PE_SI_AUTHOR_LEN            = 128;
  2615.   PE_SI_KEYWORDS_LEN          = 128;
  2616.   PE_SI_COMMENTS_LEN          = 512;
  2617.   PE_SI_REPORT_TEMPLATE_LEN   = 128;
  2618.  
  2619. type
  2620.   PEApplicationNameType = array [0..PE_SI_APPLICATION_NAME_LEN-1] of char;
  2621.   PETitleType           = array [0..PE_SI_TITLE_LEN-1] of char;
  2622.   PESubjectType         = array [0..PE_SI_SUBJECT_LEN-1] of char;
  2623.   PEAuthorType          = array [0..PE_SI_AUTHOR_LEN-1] of char;
  2624.   PEKeywordsType        = array [0..PE_SI_KEYWORDS_LEN-1] of char;
  2625.   PECommentsType        = array [0..PE_SI_COMMENTS_LEN-1] of char;
  2626.   PEReportTemplateType  = array [0..PE_SI_REPORT_TEMPLATE_LEN-1] of char;
  2627.   PEReportSummaryInfo = record
  2628.     StructSize      : Word;
  2629.     applicationName : PEApplicationNameType; { read only.}
  2630.     title           : PETitleType;
  2631.     subject         : PESubjectType;
  2632.     author          : PEAuthorType;
  2633.     keywords        : PEKeywordsType;
  2634.     comments        : PECommentsType;
  2635.     reportTemplate  : PEReportTemplateType;
  2636.     savePreviewPicture : Smallint; { BOOL PE_UNCHANGED for no change }
  2637.   end;
  2638.  
  2639. const
  2640.   PE_SIZEOF_REPORT_SUMMARY_INFO = SizeOf(PEReportSummaryInfo);
  2641.  
  2642. function PEGetReportSummaryInfo (
  2643.   printJob        : Smallint;
  2644.   var summaryInfo : PEReportSummaryInfo): Bool stdcall;
  2645.  
  2646. function PESetReportSummaryInfo (
  2647.   printJob        : Smallint;
  2648.   var summaryInfo : PEReportSummaryInfo): Bool stdcall;
  2649.  
  2650.  
  2651. {******************************************************************************}
  2652. { Callback Events                                                              }
  2653. {******************************************************************************}
  2654. const
  2655.   { event ID }
  2656.   PE_CLOSE_PRINT_WINDOW_EVENT           = 1;
  2657.   PE_ACTIVATE_PRINT_WINDOW_EVENT        = 2;
  2658.   PE_DEACTIVATE_PRINT_WINDOW_EVENT      = 3;
  2659.   PE_PRINT_BUTTON_CLICKED_EVENT         = 4;
  2660.   PE_EXPORT_BUTTON_CLICKED_EVENT        = 5;
  2661.   PE_ZOOM_LEVEL_CHANGING_EVENT          = 6;
  2662. (*  PE_ZOOM_CONTROL_SELECTED_EVENT        = 6;*)
  2663.   PE_FIRST_PAGE_BUTTON_CLICKED_EVENT    = 7;
  2664.   PE_PREVIOUS_PAGE_BUTTON_CLICKED_EVENT = 8;
  2665.   PE_NEXT_PAGE_BUTTON_CLICKED_EVENT     = 9;
  2666.   PE_LAST_PAGE_BUTTON_CLICKED_EVENT     = 10;
  2667.   PE_CANCEL_BUTTON_CLICKED_EVENT        = 11;
  2668.   PE_CLOSE_BUTTON_CLICKED_EVENT         = 12;
  2669.   PE_SEARCH_BUTTON_CLICKED_EVENT        = 13;
  2670.       PE_GROUP_TREE_BUTTON_CLICKED_EVENT     = 14;
  2671.   PE_PRINT_SETUP_BUTTON_CLICKED_EVENT   = 15;
  2672.   PE_REFRESH_BUTTON_CLICKED_EVENT       = 16;
  2673.   PE_SHOW_GROUP_EVENT                   = 17;
  2674.   PE_DRILL_ON_GROUP_EVENT            = 18; { include drill on graph }
  2675.   PE_DRILL_ON_DETAIL_EVENT              = 19;
  2676.   PE_READING_RECORDS_EVENT              = 20;
  2677.   PE_START_EVENT                        = 21;
  2678.   PE_STOP_EVENT                         = 22;
  2679.   PE_MAPPING_FIELD_EVENT                = 23;
  2680.   PE_RIGHT_CLICK_EVENT                  = 24; { right mouse click }
  2681.   PE_LEFT_CLICK_EVENT                   = 25; { left mouse click }
  2682.   PE_MIDDLE_CLICK_EVENT                 = 26; { middle mouse click }
  2683.  
  2684. { All Events are disabled by default; use PEEnableEvent to enable events }
  2685. type
  2686.   PEEnableEventInfo = record
  2687.     StructSize                 : Word;
  2688.     startStopEvent             : Smallint; {0 or 1, PE_UNCHANGED for no change}
  2689.     readingRecordEvent         : Smallint; {0 or 1, PE_UNCHANGED for no change}
  2690.     printWindowButtonEvent     : Smallint; {0 or 1, PE_UNCHANGED for no change}
  2691.     drillEvent                 : Smallint; {0 or 1, PE_UNCHANGED for no change}
  2692.     closePrintWindowEvent      : Smallint; {0 or 1, PE_UNCHANGED for no change}
  2693.     activatePrintWindowEvent   : Smallint; {0 or 1, PE_UNCHANGED for no change}
  2694.     fieldMappingEvent          : Smallint; {Bool value, PE_UNCHANGED for no change}
  2695.     mouseClickEvent            : Smallint; {Bool value, PE_UNCHANGED for no change}
  2696.     hyperlinkEvent             : Smallint; {Bool value, PE_UNCHANGED for no change}
  2697.     launchSeagateAnalysisEvent : Smallint; {Bool value, PE_UNCHANGED for no change}
  2698.   end;
  2699.  
  2700. const
  2701.   PE_SIZEOF_ENABLE_EVENT_INFO = SizeOf(PEEnableEventInfo);
  2702.  
  2703. function PEEnableEvent (
  2704.   printJob            : Smallint;
  2705.   var enableEventInfo : PEEnableEventInfo): Bool stdcall;
  2706.  
  2707. function PEGetEnableEventInfo (
  2708.   printJob            : Smallint;
  2709.   var enableEventInfo : PEEnableEventInfo): Bool stdcall;
  2710.  
  2711. { Set callback function}
  2712. function PESetEventCallback (
  2713.   printJob     : Smallint;
  2714.   callbackProc : pointer;
  2715.   userData     : pointer): Bool stdcall;
  2716.   (*
  2717.   callbackProc function should be of form:
  2718.     function callbackProc (
  2719.       eventID : Smallint;  {event ID constant}
  2720.       param2  : pointer;   {pointer to Event structure for event ID}
  2721.       param3  : pointer    {user-defined pointer}
  2722.       ): Bool stdcall;
  2723.   *)  {should "export" be used for 16-bit callback?}
  2724.  
  2725. {------------------------------------------------------------------------------}
  2726. { General PrintWindow Event                                                    }
  2727. {------------------------------------------------------------------------------}
  2728. { use this structure for
  2729.   PE_CLOSE_PRINT_WINDOW_EVENT
  2730.   PE_ACTIVATE_PRINT_WINDOW_EVENT
  2731.   PE_DEACTIVATE_PRINT_WINDOW_EVENT
  2732.   PE_PRINT_BUTTON_CLICKED_EVENT
  2733.   PE_EXPORT_BUTTON_CLICKED_EVENT
  2734.   PE_FIRST_PAGE_BUTTON_CLICKED_EVENT
  2735.   PE_PREVIOUS_PAGE_BUTTON_CLICKED_EVENT
  2736.   PE_NEXT_PAGE_BUTTON_CLICKED_EVENT
  2737.   PE_LAST_PAGE_BUTTON_CLICKED_EVENT
  2738.   PE_CANCEL_BUTTON_CLICKED_EVENT
  2739.   PE_PRINT_SETUP_BUTTON_CLICKED_EVENT
  2740.   PE_REFRESH_BUTTON_CLICKED_EVENT }
  2741. type
  2742.   PEGeneralPrintWindowEventInfo = record
  2743.     StructSize   : Word;
  2744.     ignored      : Word; {for 4 byte alignment. ignore.}
  2745.     windowHandle : HWnd;
  2746.   end;
  2747.  
  2748. const
  2749.   PE_SIZEOF_GENERAL_PRINT_WINDOW_EVENT_INFO = SizeOf(PEGeneralPrintWindowEventInfo);
  2750.  
  2751. {------------------------------------------------------------------------------}
  2752. { Mouse Click Event                                                            }
  2753. {------------------------------------------------------------------------------}
  2754. { use this structure for
  2755.   PE_RIGHT_CLICK_EVENT
  2756.   PE_LEFT_CLICK_EVENT
  2757.   PE_MIDDLE_CLICK_EVENT }
  2758. const
  2759.   { mouse click action }
  2760.   PE_MOUSE_NOTSUPPORTED = 0;
  2761.   PE_MOUSE_DOWN         = 1;
  2762.   PE_MOUSE_UP           = 2;
  2763.   PE_MOUSE_DOUBLE_CLICK = 3;
  2764.  
  2765.   { mouse click flags (virtual key state-masks) }
  2766.   PE_CF_NONE       = $0000;
  2767.   PE_CF_LBUTTON    = $0001;
  2768.   PE_CF_RBUTTON    = $0002;
  2769.   PE_CF_SHIFTKEY   = $0004;
  2770.   PE_CF_CONTROLKEY = $0008;
  2771.   PE_CF_MBUTTON    = $0010;
  2772.  
  2773. {for PE_RIGHT_CLICK_EVENT}
  2774. type
  2775.   PEMouseClickEventInfo = record
  2776.     StructSize   : Word;
  2777.     windowHandle : LongInt;
  2778.     clickAction  : integer;     {PE_MOUSE constants: mouse button down or up}
  2779.     clickFlags   : integer;     {any combination of PE_CF_*}
  2780.     xOffset      : integer;     {x-coordinate of mouse click in pixels}
  2781.     yOffset      : integer;     {y-coordinate of mouse click in pixels}
  2782.     fieldValue   : PEValueInfo;    {value of object at click point if it is a field}
  2783.                                 {object, excluding MEMO and BLOB fields,}
  2784.                                 {else valueType element = PE_VI_NOVALUE.}
  2785.     objectHandle : DWord;    {the design view object}
  2786.     sectionCode  : Smallint;    {section in which click occurred.}
  2787.   end;
  2788.  
  2789. const
  2790.   PE_SIZEOF_MOUSE_CLICK_EVENT_INFO = SizeOf(PEMouseClickEventInfo);
  2791.  
  2792. {------------------------------------------------------------------------------}
  2793. { Start/Stop Event                                                             }
  2794. {------------------------------------------------------------------------------}
  2795. { use this structure for
  2796.   PE_START_EVENT
  2797.   PE_STOP_EVENT }
  2798. const
  2799.   { job destination }
  2800.   PE_TO_NOWHERE = 0;
  2801.   PE_TO_WINDOW  = 1;
  2802.   PE_TO_PRINTER = 2;
  2803.   PE_TO_EXPORT  = 3;
  2804.   PE_FROM_QUERY = 4;
  2805.  
  2806. { for PE_START_EVENT}
  2807. type
  2808.   PEStartEventInfo = record
  2809.     StructSize  : Word;
  2810.     destination : Word;
  2811.   end;
  2812.  
  2813. const
  2814.   PE_SIZEOF_START_EVENT_INFO = SizeOf(PEStartEventInfo);
  2815.  
  2816. { for PE_STOP_EVENT}
  2817. type
  2818.   PEStopEventInfo = record
  2819.     StructSize  : Word;
  2820.     destination : Word;
  2821.     jobStatus   : Word; {a PE_JOB constant}
  2822.   end;
  2823.  
  2824. const
  2825.   PE_SIZEOF_STOP_EVENT_INFO = SizeOf(PEStopEventInfo);
  2826.  
  2827. {------------------------------------------------------------------------------}
  2828. { Reading Records Event                                                        }
  2829. {------------------------------------------------------------------------------}
  2830. { for PE_READING_RECORDS_EVENT }
  2831. type
  2832.   PEReadingRecordsEventInfo = record
  2833.     StructSize      : Word;
  2834.     cancelled       : Smallint; {0 or 1.}
  2835.     recordsRead     : DWord;
  2836.     recordsSelected : DWord;
  2837.     done            : Smallint; {0 or 1}
  2838.   end;
  2839.  
  2840. const
  2841.   PE_SIZEOF_READING_RECORDS_EVENT_INFO = SizeOf(PEReadingRecordsEventInfo);
  2842.  
  2843. {------------------------------------------------------------------------------}
  2844. { Zoom Control Event                                                           }
  2845. {------------------------------------------------------------------------------}
  2846. { for PE_ZOOM_CONTROL_SELECTED_EVENT }
  2847. type
  2848.   PEZoomLevelChangingEventInfo = record
  2849.     StructSize   : Word;
  2850.     zoomLevel    : Word;
  2851.     windowHandle : HWnd;
  2852.  end;
  2853.  
  2854. const
  2855.   PE_SIZEOF_ZOOM_LEVEL_CHANGING_EVENT_INFO = SizeOf(PEZoomLevelChangingEventInfo);
  2856.  
  2857. {------------------------------------------------------------------------------}
  2858. { Close Button Clicked Event                                                   }
  2859. {------------------------------------------------------------------------------}
  2860. { for PE_CLOSE_BUTTON_CLICKED_EVENT}
  2861. type
  2862.   PECloseButtonClickedEventInfo = record
  2863.     StructSize   : Word;
  2864.     viewIndex    : Word; {which view is going to be closed. start from zero.}
  2865.     windowHandle : HWnd; {frame window handle the button is on.}
  2866.   end;
  2867.  
  2868. const
  2869.   PE_SIZEOF_CLOSE_BUTTON_CLICKED_EVENT_INFO = SizeOf(PECloseButtonClickedEventInfo);
  2870.  
  2871. {------------------------------------------------------------------------------}
  2872. { Search Button Clicked Event                                                  }
  2873. {------------------------------------------------------------------------------}
  2874. {for PE_SEARCH_BUTTON_CLICKED_EVENT}
  2875. const
  2876.   PE_SEARCH_STRING_LEN = 128;
  2877.  
  2878. type
  2879.   PESearchStringType = array [0..PE_SEARCH_STRING_LEN-1] of Char;
  2880.   PESearchButtonClickedEventInfo = record
  2881.     windowHandle : HWnd;
  2882.     searchString : PESearchStringType;
  2883.     StructSize   : Word;
  2884.   end;
  2885.  
  2886. const
  2887.   PE_SIZEOF_SEARCH_BUTTON_CLICKED_EVENT_INFO = SizeOf(PESearchButtonClickedEventInfo);
  2888.  
  2889. {------------------------------------------------------------------------------}
  2890. { GroupTree Button Clicked Event                                               }
  2891. {------------------------------------------------------------------------------}
  2892. {for PE_GROUPTREE_BUTTON_CLICKED_EVENT}
  2893. type
  2894.   PEGroupTreeButtonClickedEventInfo = record
  2895.     StructSize   : Word;
  2896.     Visible      : Smallint; {0 or 1. Current state of the group tree button}
  2897.     windowHandle : HWnd;
  2898.   end;
  2899.  
  2900. const
  2901.   PE_SIZEOF_GROUP_TREE_BUTTON_CLICKED_EVENT_INFO = SizeOf(PEGroupTreeButtonClickedEventInfo);
  2902.  
  2903. {------------------------------------------------------------------------------}
  2904. { Show Group Event                                                             }
  2905. {------------------------------------------------------------------------------}
  2906. {for PE_SHOW_GROUP_EVENT}
  2907. type
  2908.   PEGroupArray = array[0..0] of PChar;
  2909.   PPEGroupArray = ^PEGroupArray;
  2910.   PEShowGroupEventInfo = record
  2911.     StructSize   : Word;
  2912.     groupLevel   : Word;
  2913.     windowHandle : HWnd;
  2914.     groupList    : PPEGroupArray;
  2915.     { points to an array of group name PChars }
  2916.     { PChar memory is freed after calling the call back function }
  2917.   end;
  2918.  
  2919. const
  2920.   PE_SIZEOF_SHOW_GROUP_EVENT_INFO = SizeOf(PEShowGroupEventInfo);
  2921.  
  2922. (******************************************************************************
  2923. ** An example of using the PEGroupArray (array of pointers)
  2924. **   - because the array is defined with zero elements,
  2925. **     we turn range-checking off in code.
  2926. *******************************************************************************
  2927.   {Local procedure WindowCallback}
  2928.   function WindowCallback(eventID: Smallint; pEvent: pointer; nil): LongBool stdcall;
  2929.   var
  2930.     ShowGroupInfo : PEShowGroupEventInfo;
  2931.     slGroups      : TStringList;
  2932.     cnt           : integer;
  2933.   begin
  2934.     case eventID of
  2935.       PE_SHOW_GROUP_EVENT :
  2936.         begin
  2937.           ShowGroupInfo := PEShowGroupEventInfo(pEvent^);
  2938.           if (ShowGroupInfo.structSize = SizeOf(PEShowGroupEventInfo)) then
  2939.           begin
  2940.             slGroups := TStringList.Create;
  2941.             {If Range Checking is on, turn it off}
  2942.             {$IFOPT R+}
  2943.               {$DEFINE CKRANGE}
  2944.               {$R-}
  2945.             {$ENDIF}
  2946.             for cnt := 0 to ShowGroupInfo.groupLevel - 1 do
  2947.               slGroups.Add(String(ShowGroupInfo.groupList^[cnt]));
  2948.             {$IFDEF CKRANGE}
  2949.               {$UNDEF CKRANGE}
  2950.               {$R+}
  2951.             {$ENDIF}
  2952.             {...do something...}
  2953.             slGroups.Free;
  2954.             Result := True; //to continue processing
  2955.           end;
  2956.         end;
  2957.     end;
  2958.   end;
  2959. *)
  2960.  
  2961. {------------------------------------------------------------------------------}
  2962. { Drill On Group Event                                                         }
  2963. {------------------------------------------------------------------------------}
  2964. {For PE_DRILL_ON_GROUP_EVENT}
  2965. const
  2966.   PE_DE_ON_GROUP     = 0;
  2967.   PE_DE_ON_GROUPTREE = 1;
  2968.   PE_DE_ON_GRAPH     = 2;
  2969.   PE_DE_ON_MAP       = 3;
  2970.   PE_DE_ON_SUBREPORT = 4;
  2971.  
  2972. type
  2973.   PEDrillOnGroupEventInfo = record
  2974.     StructSize   : Word;
  2975.     drillType    : Word; { a PE_DE_ constant}
  2976.     windowHandle : HWnd;
  2977.     { Points to an array of group name. Memory pointed by group list
  2978.     { is freed after calling the callback function }
  2979.     groupList    : PPEGroupArray;
  2980.     groupLevel   : Word;
  2981.   end;
  2982.   PPEDrillOnGroupEventInfo = ^PEDrillOnGroupEventInfo;
  2983.  
  2984. const
  2985.   PE_SIZEOF_DRILL_ON_GROUP_EVENT_INFO = SizeOf(PEDrillOnGroupEventInfo);
  2986.  
  2987. {------------------------------------------------------------------------------}
  2988. { Drill On Detail Event                                                        }
  2989. {------------------------------------------------------------------------------}
  2990. { for PE_DRILL_ON_DETAIL_EVENT }
  2991. type
  2992.   PEFieldValueInfo = record
  2993.     StructSize : Word;
  2994.     ignored    : Word;  {for 4 byte alignment. ignore.}
  2995.     fieldName:  PEFieldNameType; {defined in GroupCondition/GroupOptions}
  2996.     fieldValue: PEValueInfo;
  2997.   end;
  2998.   PPEFieldValueInfo     = ^PEFieldValueInfo;
  2999.   PEFieldValueInfoArray = array [0..0] of PPEFieldValueInfo;
  3000.   PPEFieldValueInfoArray = ^PEFieldValueInfoArray;
  3001.  
  3002. const
  3003.   PE_SIZEOF_FIELD_VALUE_INFO = SizeOf(PEFieldValueInfo);
  3004.  
  3005. type
  3006.   PEDrillOnDetailEventInfo = record
  3007.     StructSize         : Word;
  3008.     selectedFieldIndex : Smallint; {-1 if no field selected}
  3009.     windowHandle       : HWnd;
  3010.     { points to an array of PEFieldValue. memory
  3011.       pointed by fieldValueList is freed after
  3012.       calling the call back function }
  3013.     fieldValueList     : PPEFieldValueInfoArray;
  3014.     nFieldValue        : Smallint; {number of field value in fieldValueList}
  3015.   end;
  3016.  
  3017. const
  3018.   PE_SIZEOF_DRILL_ON_DETAIL_EVENT_INFO = SizeOf(PEDrillOnDetailEventInfo);
  3019.  
  3020. {------------------------------------------------------------------------------}
  3021. { Field Mapping Event                                                          }
  3022. {------------------------------------------------------------------------------}
  3023. const
  3024.   PE_TABLE_NAME_LEN          = 128;
  3025.   PE_DATABASE_FIELD_NAME_LEN = 128;
  3026.  
  3027.   { Field value type }
  3028.   PE_FVT_INT8SFIELD           = 1;
  3029.   PE_FVT_INT8UFIELD           = 2;
  3030.   PE_FVT_INT16SFIELD          = 3;
  3031.   PE_FVT_INT16UFIELD          = 4;
  3032.   PE_FVT_INT32SFIELD          = 5;
  3033.   PE_FVT_INT32UFIELD          = 6;
  3034.   PE_FVT_NUMBERFIELD          = 7;
  3035.   PE_FVT_CURRENCYFIELD        = 8;
  3036.   PE_FVT_BOOLEANFIELD         = 9;
  3037.   PE_FVT_DATEFIELD            = 10;
  3038.   PE_FVT_TIMEFIELD            = 11;
  3039.   PE_FVT_STRINGFIELD          = 12;
  3040.   PE_FVT_TRANSIENTMEMOFIELD   = 13;
  3041.   PE_FVT_PERSISTENTMEMOFIELD  = 14;
  3042.   PE_FVT_BLOBFIELD            = 15;
  3043.   PE_FVT_DATETIMEFIELD        = 16;
  3044.   PE_FVT_BITMAPFIELD          = 17;
  3045.   PE_FVT_ICONFIELD            = 18;
  3046.   PE_FVT_PICTUREFIELD         = 19;
  3047.   PE_FVT_OLEFIELD             = 20;
  3048.   PE_FVT_GRAPHFIELD           = 21;
  3049.   PE_FVT_UNKNOWNFIELD         = 22;
  3050.  
  3051.   { Field mapping types }
  3052.   PE_FM_AUTO_FLD_MAP          = 0;
  3053.   { Auto field name mapping }
  3054.   { Unmapped Report fields will be removed }
  3055.  
  3056.   PE_FM_CRPE_PROMPT_FLD_MAP   = 1;
  3057.   { CRPE provides dialog box to map field manually }
  3058.  
  3059.   PE_FM_EVENT_DEFINED_FLD_MAP = 2;
  3060.   { CRPE provides list of field in report and new database }
  3061.   { User needs to activate the PE_MAPPING_FIELD_EVENT }
  3062.   { and define a callback function }
  3063.  
  3064. function PESetFieldMappingType (
  3065.   printJob    : Smallint;
  3066.   mappingType : Word): Bool stdcall;
  3067.  
  3068. function PEGetFieldMappingType (
  3069.   printJob        : Smallint;
  3070.   var mappingType : Word): Bool stdcall;
  3071.  
  3072. type
  3073.   PETableAliasNameType     = array [0..PE_TABLE_NAME_LEN -1] of Char;
  3074.   PEDatabaseFieldNameType  = array [0..PE_DATABASE_FIELD_NAME_LEN -1] of Char;
  3075.   PEReportFieldMappingInfo = record
  3076.     StructSize        : Word;
  3077.     valueType         : Word; { a PE_FVT_constant }
  3078.     tableAliasName    : PETableAliasNameType;
  3079.     databaseFieldName : PEDatabaseFieldNameType;
  3080.     mappingTo         : integer;
  3081.     { Mapped fields are assigned to the index of a field }
  3082.     { in array PEFieldMappingEventInfo->databaseFields. }
  3083.     { Unmapped fields are assigned to -1 }
  3084.   end;
  3085.   PPEReportFieldMappingInfo = ^PEReportFieldMappingInfo;
  3086.   PEMappingInfoArray = array[0..0] of PPEReportFieldMappingInfo;
  3087.   PPEMappingInfoArray = ^PEMappingInfoArray;
  3088.  
  3089. const
  3090.   PE_SIZEOF_REPORT_FIELDMAPPING_INFO = SizeOf(PEReportFieldMappingInfo);
  3091.  
  3092. type
  3093.   PEFieldMappingEventInfo = record
  3094.     StructSize      : Word;
  3095.     reportFields    : PPEMappingInfoArray;
  3096.     { An array of pointers to the fields in the report }
  3097.     { User need to modify the 'mappingTo' of each new mapped field
  3098.     { by assigning the value of the index of a field in the array of databaseFields }
  3099.     nReportFields   : Word; { Size of array reportFields }
  3100.     databaseFields  : PPEMappingInfoArray;
  3101.     { An array of pointers to the fields in the new database file }
  3102.     nDatabaseFields : Word; { Size of array databaseField }
  3103.   end;
  3104.  
  3105.  
  3106. const
  3107.   PE_SIZEOF_FIELDMAPPING_EVENT_INFO = SizeOf(PEFieldMappingEventInfo);
  3108.  
  3109. {------------------------------------------------------------------------------}
  3110. { Hyperlink Event                                                              }
  3111. {------------------------------------------------------------------------------}
  3112. const
  3113.   PE_DRILL_ON_HYPERLINK_EVENT      = 27;
  3114.   PE_LAUNCH_SEAGATE_ANALYSIS_EVENT = 28;
  3115.  
  3116. type
  3117.   PEHyperlinkEventInfo = record
  3118.     StructSize    : Word;
  3119.     ignored       : Word;    { for 4 byte alignment. ignore. }
  3120.     windowHandle  : Longint; { HWND }
  3121.     hyperlinkText : PChar;   { points to the hyperlink text associated with the object. }
  3122.                              { memory pointed by hyperlinkText is freed after calling the callback function. }
  3123.   end;
  3124.  
  3125. const
  3126.   PE_SIZEOF_HYPERLINKEVENTINFO = SizeOf(PEHyperlinkEventInfo);
  3127.  
  3128. {------------------------------------------------------------------------------}
  3129. { LaunchSeagateAnalysis Event                                                  }
  3130. {------------------------------------------------------------------------------}
  3131. type
  3132.   PELaunchSeagateAnalysisEventInfo = record
  3133.     StructSize   : Word;
  3134.     ignored      : Word;    { for 4 byte alignment. ignore. }
  3135.     windowHandle : Longint; { HWND }
  3136.     pathFile     : PChar;   { points to the path and filename of the temporary report. }
  3137.                             { memory pointed by pathFile is freed after calling the callback function. }
  3138.   end;
  3139.  
  3140. const
  3141.   PE_SIZEOF_LAUNCHSEAGATEANALYSISEVENTINFO = SizeOf(PELaunchSeagateAnalysisEventInfo);
  3142.  
  3143.  
  3144. {******************************************************************************}
  3145. { Window Cursor                                                                }
  3146. {******************************************************************************}
  3147. { All are window standard cursors except PE_TC_MAGNIFY_CURSOR.
  3148.   PE_TC_SIZEALL_CURSOR, PE_TC_NO_CURSOR, PE_TC_APPSTARTING_CURSOR
  3149.   and PE_TC_HELP_CURSOR are  not supported in 16-bit.
  3150.   PE_TC_SIZE_CURSOR and PE_TC_ICON_CURSOR are obsolete for 32-bit;
  3151.   use PE_TC_SIZEALL_CURSOR and PE_TC_ARROW_CURSOR instead. }
  3152. const
  3153.   PE_TC_DEFAULT_CURSOR     = 0; {CRPE set default cursor to be PE_TC_ARRAOW_CURSOR}
  3154.   PE_TC_ARROW_CURSOR       = 1;
  3155.   PE_TC_CROSS_CURSOR       = 2;
  3156.   PE_TC_IBEAM_CURSOR       = 3;
  3157.   PE_TC_UPARROW_CURSOR     = 4;
  3158.   PE_TC_SIZEALL_CURSOR     = 5;  {32-bit}
  3159.   PE_TC_SIZENWSE_CURSOR    = 6;
  3160.   PE_TC_SIZENESW_CURSOR    = 7;
  3161.   PE_TC_SIZEWE_CURSOR      = 8;
  3162.   PE_TC_SIZENS_CURSOR      = 9;
  3163.   PE_TC_NO_CURSOR          = 10; {32-bit}
  3164.   PE_TC_WAIT_CURSOR        = 11;
  3165.   PE_TC_APPSTARTING_CURSOR = 12; {32-bit}
  3166.   PE_TC_HELP_CURSOR       = 13; {32-bit}
  3167.   PE_TC_SIZE_CURSOR        = 14; {16-bit}
  3168.   PE_TC_ICON_CURSOR        = 15; {16-bit}
  3169.   { 32-bit, CRPE specific cusors }
  3170.   PE_TC_BACKGROUND_PROCESS_CURSOR = 94;
  3171.   PE_TC_GRAB_HAND_CURSOR          = 95;
  3172.   PE_TC_ZOOM_IN_CURSOR            = 96;
  3173.   PE_TC_REPORT_SECTION_CURSOR     = 97;
  3174.   PE_TC_HAND_CURSOR               = 98;
  3175.   PE_TC_MAGNIFY_CURSOR            = 99;
  3176.  
  3177. type
  3178.   PETrackCursorInfo = record
  3179.     StructSize                  : Word;
  3180.     groupAreaCursor             : Smallint; {a PE_TC constant. PE_UNCHANGED for no change}
  3181.     groupAreaFieldCursor        : Smallint; {a PE_TC constant. PE_UNCHAGNED for no change}
  3182.     detailAreaCursor            : Smallint; {a PE_TC constant. PE_UNCHANGED for no change}
  3183.     detailAreaFieldCursor       : Smallint; {a PE_TC constant. PE_UNCHANGED for no change}
  3184.     graphCursor                 : Smallint; {a PE_TC constant. PE_UNCHANGED for no change}
  3185.     groupAreaCursorHandle       : DWord;    {reserved}
  3186.     groupAreaFieldCursorHandle  : DWord;    {reserved}
  3187.     detailAreaCursorHandle      : DWord;    {reserved}
  3188.     detailAreaFieldCursorHandle : DWord;    {reserved}
  3189.     graphCursorHandle           : DWord;    {reserved}
  3190.     ondemandSubreportCursor     : Smallint; { Cursor to show over on-demand subreports when }
  3191.                                             { drilldown for the window is enabled; }
  3192.                                             { default is PE_TC_MAGNIFY_CURSOR. }
  3193.     hyperlinkCursor             : Smallint; { Cursor to show over report object that has hyperlink text; }
  3194.                                             { default is PE_TC_HAND_CURSOR. }
  3195.   end;
  3196.  
  3197. const
  3198.   PE_SIZEOF_TRACK_CURSOR_INFO = SizeOf(PETrackCursorInfo);
  3199.  
  3200. { set tracking cursor}
  3201. function PEGetTrackCursorInfo (
  3202.   printJob       : Smallint;
  3203.   var cursorInfo : PETrackCursorInfo): Bool stdcall;
  3204.  
  3205. function PESetTrackCursorInfo (
  3206.   printJob       : Smallint;
  3207.   var cursorInfo : PETrackCursorInfo): Bool stdcall;
  3208.  
  3209.  
  3210. {******************************************************************************}
  3211. { Formula Syntax                                                               }
  3212. {******************************************************************************}
  3213. const
  3214.   PE_FST_CRYSTAL = 0;
  3215.   PE_FST_BASIC   = 1;
  3216.   PE_FS_SIZE    = 2;
  3217.  
  3218. type
  3219.   PEFormulaSyntaxArray = array[0..PE_FS_SIZE-1] of Smallint;
  3220.   PEFormulaSyntax = record
  3221.     StructSize    : Word;
  3222.     formulaSyntax : PEFormulaSyntaxArray; { PE_FS_* or PE_UNCHANGED. }
  3223.   end;
  3224.  
  3225. const
  3226.   PE_SIZEOF_FORMULA_SYNTAX = SizeOf(PEFormulaSyntax);
  3227.  
  3228. { PEGetFormulaSyntax                                                               }
  3229. { Indicates the syntax used by the formula addressed in the last formula API call. }
  3230. { The syntax type is returned in formulaSyntax[0];                                 }
  3231. { formulaSyntax[1] is reserved for internal use.                                   }
  3232. { ***Default Behaviour: If this API is called before any Formula API is called     }
  3233. {                       then the values returned will be PE_UNCHANGED.             }
  3234.  
  3235.  
  3236. function PEGetFormulaSyntax (
  3237.   printJob          : Smallint;
  3238.   var formulaSyntax : PEFormulaSyntax): Bool stdcall;
  3239.  
  3240. { PESetFormulaSyntax                                                      }
  3241. { Use this API to set the syntax to use in the next (and all successive)  }
  3242. { formula API call(s).                                                    }
  3243. { Set one of PE_FST_* into formulaSyntax[0];                              }
  3244. { formulaSyntax[1] is reserved for internal use.                          }
  3245. { ***Default Behaviour: If any Formula API is called before calling       }
  3246. {                       PESetFormulaSyntax then PE_FST_CRYSTAL is assumed.}
  3247.  
  3248. function PESetFormulaSyntax (
  3249.   printJob          : Smallint;
  3250.   var formulaSyntax : PEFormulaSyntax): Bool stdcall;
  3251.  
  3252.  
  3253.  
  3254. {******************************************************************************}
  3255. { Report Version                                                               }
  3256. {******************************************************************************}
  3257. type
  3258.    PEVersionInfo = record
  3259.       StructSize                       : Word;        {initialize to PE_SIZEOF_VERSION_INFO}
  3260.       major                            : Word;
  3261.       minor                            : Word;
  3262.       letter                           : Char;
  3263.    end;
  3264.  
  3265. const
  3266.    PE_SIZEOF_VERSION_INFO = SizeOf(PEVersionInfo);
  3267.  
  3268. function PEGetReportVersion(
  3269.    printJob          : Smallint;
  3270.    var pVersionInfo : PEVersionInfo): Bool stdcall;
  3271.  
  3272. {******************************************************************************}
  3273. { Report Alert                                                                 }
  3274. {******************************************************************************}
  3275.  
  3276. type
  3277.    PEReportAlertInfo = record
  3278.       StructSize                       : Word;        {initialize to PE_SIZEOF_REPORT_ALERT_INFO}
  3279.       nameLength                       : Smallint;
  3280.       name                             : HWND;            {Must Release HANDLES even if not using them}
  3281.       isEnabled                        : Smallint;        {True if alert is enabled, else false}
  3282.       alertConditionLength             : Smallint;
  3283.       alertConditionFormula            : HWND;
  3284.       nTriggeredInstances              : DWord;
  3285.       alertMessageLength               : SmallInt;        {for alertMessageFormula}
  3286.       defaultAlertMessageLength        : SmallInt;
  3287.       alertMessageFormula              : HWND;
  3288.       defaultAlertMessage              : HWND;
  3289.    end;
  3290.  
  3291. const
  3292.    PE_SIZEOF_REPORT_ALERT_INFO = SizeOf (PEReportAlertInfo);
  3293.  
  3294. type
  3295.    PEAlertInstanceInfo = record
  3296.       StructSize                       : Word;        {initialize to PE_SIZEOF_ALERT_INSTANCE_INFO}
  3297.       alertMessageLength               : Smallint;
  3298.       alertMessage                     : HWND;
  3299.    end;
  3300.  
  3301. const
  3302.    PE_SIZEOF_ALERT_INSTANCE_INFO = SizeOf (PEAlertInstanceInfo);
  3303.  
  3304. function PEGetNReportAlerts (printJob : Smallint) : Smallint stdcall;
  3305.  
  3306. function PEGetNthReportAlert(
  3307.    printJob        : Smallint;
  3308.    alertN          : Smallint;
  3309.    var reportAlertInfo : PEReportAlertInfo) : boolean stdcall;
  3310.  
  3311. function PEGetNthAlertInstanceInfo(
  3312.    printJob        : Smallint;
  3313.    alertN          : Smallint;
  3314.    instanceN       : DWord;
  3315.    var alertInstanceInfo : PEAlertInstanceInfo) : boolean stdcall;
  3316.  
  3317. function PESetNthAlertConditionFormula(
  3318.    printJob        : Smallint;
  3319.    alertN          : Smallint;
  3320.    const formula : PCHAR) : boolean stdcall;
  3321.  
  3322. function PESetNthAlertMessageFormula(
  3323.    printJob        : Smallint;
  3324.    alertN          : Smallint;
  3325.    const formula : PCHAR) : boolean stdcall;
  3326.  
  3327. function PESetNthAlertDefaultMessage(
  3328.    printJob        : Smallint;
  3329.    alertN          : Smallint;
  3330.    const text : PCHAR) : boolean stdcall;
  3331.  
  3332. function PEEnableNthAlert(
  3333.    printJob        : Smallint;
  3334.    alertN          : Smallint;
  3335.    enabled : boolean) : boolean stdcall;
  3336.  
  3337. {******End of Interface Section******}
  3338.  
  3339. implementation
  3340.  
  3341. function PE_SECTION_CODE(sectionType, groupN, sectionN : Smallint): Smallint stdcall;
  3342. begin
  3343.   Result := (sectionType * 1000) + (groupN mod 25) + ((sectionN mod 40) * 25);
  3344. end;
  3345.  
  3346. function PE_AREA_CODE(sectionType, groupN: Smallint): Smallint stdcall;
  3347. begin
  3348.   Result := PE_SECTION_CODE(sectionType, groupN, 0);
  3349. end;
  3350.  
  3351. function PE_SECTION_TYPE(sectionCode: Smallint): Smallint;
  3352. begin
  3353.   Result := sectionCode div 1000;
  3354. end;
  3355.  
  3356. function PE_GROUP_N(sectionCode: Smallint): Smallint;
  3357. begin
  3358.   Result := sectionCode mod 25;
  3359. end;
  3360.  
  3361. function PE_SECTION_N(sectionCode: Smallint): Smallint;
  3362. begin
  3363.   Result := (sectionCode div 25) mod 40;
  3364. end;
  3365.  
  3366. const
  3367.   DLLName = 'CRPE32.DLL';
  3368.  
  3369. function  PEPrintReport;                          external DLLName;
  3370. function  PEOpenEngine;                           external DLLName;
  3371. procedure PECloseEngine;                          external DLLName;
  3372. function  PECanCloseEngine;                       external DLLName;
  3373. function  PEGetVersion;                           external DLLName;
  3374. function  PEOpenPrintJob;                         external DLLName;
  3375. function  PEClosePrintJob;                        external DLLName;
  3376. function  PEGetReportOptions;                     external DLLName;
  3377. function  PESetReportOptions;                     external DLLName;
  3378. function  PEStartPrintJob;                        external DLLName;
  3379. procedure PECancelPrintJob;                       external DLLName;
  3380. function  PEIsPrintJobFinished;                   external DLLName;
  3381. function  PEGetJobStatus;                         external DLLName;
  3382. function  PEGetErrorCode;                         external DLLName;
  3383. function  PEGetErrorText;                         external DLLName;
  3384. function  PEGetHandleString;                      external DLLName;
  3385. function  PEGetPrintDate;                         external DLLName;
  3386. function  PESetPrintDate;                         external DLLName;
  3387. function  PESetGroupCondition;                    external DLLName;
  3388. function  PEGetNGroups;                           external DLLName;
  3389. function  PEGetGroupCondition;                    external DLLName;
  3390. function  PEGetGroupOptions;                      external DLLName;
  3391. function  PESetGroupOptions;                      external DLLName;
  3392. function  PEGetNFormulas;                         external DLLName;
  3393. function  PEGetNthFormula;                        external DLLName;
  3394. function  PEGetFormula;                           external DLLName;
  3395. function  PESetFormula;                           external DLLName;
  3396. function  PECheckFormula;                         external DLLName;
  3397. function  PEGetSelectionFormula;                  external DLLName;
  3398. function  PESetSelectionFormula;                  external DLLName;
  3399. function  PECheckSelectionFormula;                external DLLName;
  3400. function  PEGetGroupSelectionFormula;             external DLLName;
  3401. function  PESetGroupSelectionFormula;             external DLLName;
  3402. function  PECheckGroupSelectionFormula;           external DLLName;
  3403. function  PEGetNSQLExpressions;                   external DLLName;
  3404. function  PEGetNthSQLExpression;                  external DLLName;
  3405. function  PEGetSQLExpression;                     external DLLName;
  3406. function  PESetSQLExpression;                     external DLLName;
  3407. function  PECheckSQLExpression;                   external DLLName;
  3408. function  PEGetNSortFields;                       external DLLName;
  3409. function  PEGetNthSortField;                      external DLLName;
  3410. function  PESetNthSortField;                      external DLLName;
  3411. function  PEDeleteNthSortField;                   external DLLName;
  3412. function  PEGetNGroupSortFields;                  external DLLName;
  3413. function  PEGetNthGroupSortField;                 external DLLName;
  3414. function  PESetNthGroupSortField;                 external DLLName;
  3415. function  PEDeleteNthGroupSortField;              external DLLName;
  3416. function  PEGetNTables;                           external DLLName;
  3417. function  PEGetNthTableType;                      external DLLName;
  3418. function  PEGetNthTableSessionInfo;               external DLLName;
  3419. function  PESetNthTableSessionInfo;               external DLLName;
  3420. function  PEGetNthTableLogOnInfo;                 external DLLName;
  3421. function  PESetNthTableLogOnInfo;                 external DLLName;
  3422. function  PEGetNthTableLocation;                  external DLLName;
  3423. function  PESetNthTableLocation;                  external DLLName;
  3424. function  PEGetNthTablePrivateInfo;               external DLLName;
  3425. function  PESetNthTablePrivateInfo;               external DLLName;
  3426. function  PETestNthTableConnectivity;             external DLLName;
  3427. function  PELogOnServer;                          external DLLName;
  3428. function  PELogOffServer;                         external DLLName;
  3429. function  PELogOnSQLServerWithPrivateInfo;        external DLLName;
  3430. function  PEGetSQLQuery;                          external DLLName;
  3431. function  PESetSQLQuery;                          external DLLName;
  3432. function  PEVerifyDatabase;                       external DLLName;
  3433. function  PEHasSavedData;                         external DLLName;
  3434. function  PEDiscardSavedData;                     external DLLName;
  3435. function  PEGetReportTitle;                       external DLLName;
  3436. function  PESetReportTitle;                       external DLLName;
  3437. function  PEOutputToWindow;                       external DLLName;
  3438. function  PEGetWindowOptions;                     external DLLName;
  3439. function  PESetWindowOptions;                     external DLLName;
  3440. function  PEGetWindowHandle;                      external DLLName;
  3441. procedure PECloseWindow;                          external DLLName;
  3442. function  PEShowNextPage;                         external DLLName;
  3443. function  PEShowFirstPage;                        external DLLName;
  3444. function  PEShowPreviousPage;                     external DLLName;
  3445. function  PEShowLastPage;                         external DLLName;
  3446. function  PEZoomPreviewWindow;                    external DLLName;
  3447. function  PEShowPrintControls;                    external DLLName;
  3448. function  PEPrintControlsShowing;                 external DLLName;
  3449. function  PEPrintWindow;                          external DLLName;
  3450. function  PEExportPrintWindow;                    external DLLName;
  3451. function  PENextPrintWindowMagnification;         external DLLName;
  3452. function  PESelectPrinter;                        external DLLName;
  3453. function  PEGetSelectedPrinter;                   external DLLName;
  3454. function  PEOutputToPrinter;                      external DLLName;
  3455. function  PESetNDetailCopies;                     external DLLName;
  3456. function  PEGetNDetailCopies;                     external DLLName;
  3457. function  PESetPrintOptions;                      external DLLName;
  3458. function  PEGetPrintOptions;                      external DLLName;
  3459. function  PEGetExportOptions;                     external DLLName;
  3460. function  PEExportTo;                             external DLLName;
  3461. function  PESetMargins;                           external DLLName;
  3462. function  PEGetMargins;                           external DLLName;
  3463. function  PEGetReportSummaryInfo;                 external DLLName;
  3464. function  PESetReportSummaryInfo;                 external DLLName;
  3465. function  PESetSectionHeight;                     external DLLName;
  3466. function  PEGetSectionHeight;                       external DLLName;
  3467. function  PESetSectionFormat;                     external DLLName;
  3468. function  PEGetSectionFormatFormula;              external DLLName;
  3469. function  PESetSectionFormatFormula;              external DLLName;
  3470. function  PEGetSectionFormat;                     external DLLName;
  3471. function  PESetAreaFormat;                        external DLLName;
  3472. function  PEGetAreaFormatFormula;                 external DLLName;
  3473. function  PESetAreaFormatFormula;                 external DLLName;
  3474. function  PEGetAreaFormat;                        external DLLName;
  3475. function  PESetFont;                              external DLLName;
  3476. function  PEGetNSubreportsInSection;              external DLLName;
  3477. function  PEGetNthSubreportInSection;             external DLLName;
  3478. function  PEGetSubreportInfo;                     external DLLName;
  3479. function  PEOpenSubreport;                        external DLLName;
  3480. function  PECloseSubreport;                       external DLLName;
  3481. function  PEGetNParameterFields;                  external DLLName;
  3482. function  PEGetNthParameterField;                 external DLLName;
  3483. function  PESetNthParameterField;                 external DLLName;
  3484. function  PEGetNSections;                         external DLLName;
  3485. function  PEGetSectionCode;                       external DLLName;
  3486. function  PEGetNPages;                            external DLLName;
  3487. function  PEShowNthPage;                          external DLLName;
  3488. function  PESetDialogParentWindow;                external DLLName;
  3489. function  PEEnableProgressDialog;                 external DLLName;
  3490. function  PEGetAllowPromptDialog;                 external DLLName;
  3491. function  PESetAllowPromptDialog;                 external DLLName;
  3492. function  PEConvertPFInfoToVInfo;                 external DLLName;
  3493. function  PEConvertVInfoToPFInfo;                 external DLLName;
  3494. function  PEGetNParameterDefaultValues;           external DLLName;
  3495. function  PEGetNthParameterDefaultValue;          external DLLName;
  3496. function  PESetNthParameterDefaultValue;          external DLLName;
  3497. function  PEAddParameterDefaultValue;             external DLLName;
  3498. function  PEDeleteNthParameterDefaultValue;       external DLLName;
  3499. function  PEGetParameterMinMaxValue;              external DLLName;
  3500. function  PESetParameterMinMaxValue;              external DLLName;
  3501. function  PEGetParameterValueInfo;                external DLLName;
  3502. function  PESetParameterValueInfo;                external DLLName;
  3503. function  PEGetNParameterCurrentValues;           external DLLName;
  3504. function  PEGetNthParameterCurrentValue;          external DLLName;
  3505. function  PEAddParameterCurrentValue;             external DLLName;
  3506. function  PEGetNParameterCurrentRanges;           external DLLName;
  3507. function  PEGetNthParameterCurrentRange;          external DLLName;
  3508. function  PEAddParameterCurrentRange;             external DLLName;
  3509. function  PEGetNthParameterType;                  external DLLName;
  3510. function  PEClearParameterCurrentValuesAndRanges; external DLLName;
  3511. function  PESetFieldMappingType;                  external DLLName;
  3512. function  PEGetFieldMappingType;                  external DLLName;
  3513. function  PEEnableEvent;                          external DLLName;
  3514. function  PEGetEnableEventInfo;                   external DLLName;
  3515. function  PESetEventCallback;                     external DLLName;
  3516. function  PESetTrackCursorInfo;                   external DLLName;
  3517. function  PEGetTrackCursorInfo;                   external DLLName;
  3518. { New Graph Calls }
  3519. function  PEGetGraphTypeInfo;                     external DLLName;
  3520. function  PESetGraphTypeInfo;                     external DLLName;
  3521. function  PEGetGraphTextInfo;                     external DLLName;
  3522. function  PESetGraphTextInfo;                     external DLLName;
  3523. function  PEGetGraphOptionInfo;                   external DLLName;
  3524. function  PESetGraphOptionInfo;                   external DLLName;
  3525. function  PEGetGraphFontInfo;                     external DLLName;
  3526. function  PESetGraphFontInfo;                     external DLLName;
  3527. function  PEGetGraphAxisInfo;                     external DLLName;
  3528. function  PESetGraphAxisInfo;                     external DLLName;
  3529. { Other New Calls }
  3530. function PEGetNthParameterValueDescription;       external DLLName;
  3531. function PESetNthParameterValueDescription;       external DLLName;
  3532. function PEGetParameterPickListOption;            external DLLName;
  3533. function PESetParameterPickListOption;            external DLLName;
  3534. function PECheckNthTableDifferences;              external DLLName;
  3535. { New Calls for SCR8 }
  3536. function PEGetNSectionsInArea;                    external DLLName;
  3537. function PEGetGraphTextDefaultOption;             external DLLName;
  3538. function PESetGraphTextDefaultOption;             external DLLName;
  3539. function PEFreeDevMode;                           external DLLName;
  3540. function PEGetFormulaSyntax;                      external DLLName;
  3541. function PESetFormulaSyntax;                      external DLLName;
  3542. function PEReimportSubreport;                     external DLLName;
  3543. {New Calls for SCR8 MR1}
  3544. function PEGetReportVersion;                      external DLLName;
  3545. function PEGetNReportAlerts;                      external DLLName;
  3546. function PEGetNthReportAlert;                     external DLLName;
  3547. function PEGetNthAlertinstanceInfo;               external DLLName;
  3548. function PESetNthAlertConditionFormula;           external DLLName;
  3549. function PESetNthAlertMessageFormula;             external DLLName;
  3550. function PESetNthAlertDefaultMessage;             external DLLName;
  3551. function PEEnableNthAlert;                        external DLLName;
  3552. end.
  3553.  
  3554.