[ROOT] --> C++Client
PCREJob class contains all of the API calls which relate to a report-engine job. The functionality of the class mirrors that of the Java Client.
friend class PCREEngine ; | |
friend class PCREJobTable ; |
{
Cancel
CheckFormula
CheckGroupSelectionFormula
CheckSelectionFormula
Close
CloseSubreport
DeleteNthGroupSortField
DeleteNthSortField
DiscardSavedData
EnableProgressDialog
ExportTo
ExportTo
GetAreaFormat
GetAreaFormatFormula
getEngine
GetErrorCode
GetErrorText
GetFormula
GetGraphData
GetGraphOptions
GetGraphText
GetGraphType
GetGroupCondition
GetGroupOptions
GetGroupSelectionFormula
getHandle
GetMargins
GetMinimumSectionHeight
GetName
GetNDetailCopies
GetNFormulas
GetNGroups
GetNGroupSortFields
GetNPages
GetNParameterFields
GetNParams
GetNSections
GetNSortFields
GetNSubreportsInSection
GetNTables
GetNthFormula
GetNthFormulaStr
GetNthGroupSortField
GetNthParam
GetNthParameterField
GetNthSortField
GetNthSubreportInSection
GetNthTableLocation
GetNthTableLogOnInfo
GetNthTableSessionInfo
GetNthTableType
GetParameterField
getParent
GetPrintDate
GetReportSummaryInfo
GetReportTitle
GetSectionCode
GetSectionFormat
GetSectionFormatFormula
GetSelectedPrinter
GetSelectionFormula
GetSQLQuery
GetStatus
getStatus
HasSavedData
IsFinished
OutputToPDF
OutputToPrinter
SelectPrinter
SetAreaFormat
SetAreaFormatFormula
SetFont
SetFormula
SetGraphData
SetGraphOptions
SetGraphText
SetGraphType
SetGroupCondition
SetGroupOptions
SetGroupSelectionFormula
SetMargins
SetMinimumSectionHeight
SetName
SetNDetailCopies
SetNthGroupSortField
SetNthParam
SetNthParameterField
SetNthSortField
SetNthTableLocation
SetNthTableLogOnInfo
SetNthTableSessionInfo
SetParameterField
SetPrintDate
SetPrintOptions
SetReportSummaryInfo
SetReportTitle
SetSectionFormat
SetSelectionFormula
SetSQLQuery
Start
StrAlloc
StrDup
StrFree
StrReAlloc
TestNthTableConnectivity
public enum { jobClosed = 0 ,
jobOpened = 1 } ;
static char * StrAlloc ( unsigned int len ) ;
Allocate a string for use by CORBA.
| len | The size of the string to allocate |
static char * StrReAlloc ( const char * str ,
unsigned int len ) ;
Re-allocate a string for use by CORBA, changing the size of the string
| str | A pointer to the current string. |
| len | The size of the string to allocate |
static char * StrDup ( const char * str ) ;
Copy a string for use by CORBA.
| str | A pointer to the current string. |
static void StrFree ( char * str ) ;
Free memory allocated for a string by CORBA. It is important that all the Str* methods have their memory freed by this call, rather than the standard free().
| str | A pointer to the string to be freed. Once this call has been made this memory is not useable by the caller. |
void SetName ( const char * jobName ) ;
Set the name associated with this job
| jobName | The name to use for this job |
char * GetName ( ) ;
Get the name associated with this job
int getStatus ( ) ;
Get the status of this report job.
int getHandle ( ) ;
Get the handle used by this job
PCREEngine * getEngine ( ) ;
Get the engine that opened this job
PCREJob * getParent ( ) ;
Get the parent of this job, this is meaningless unless the job is a supreport.
int GetErrorCode ( ) ;
Issue a PEGetErrorCode call for the job.
const char * GetErrorText ( ) ;
Issue a PEGetErrorText call for the job.
void Start ( ) ;
Issue a PEStartPrintJob call for the job.
int GetStatus ( PEJobInfo * jobInfo ) ;
Get the status and progress statistics of a report job.
| info | A PCREJobInfo object which status information will be placed into. |
BOOL IsFinished ( ) ;
Check to see if this print job has finished.
void Close ( ) ;
Closes the print job. If printing has not yet finished, it continues. See Crystal Developer's Guide for more information.
void CloseSubreport ( ) ;
Closes this subreport job.
void Cancel ( ) ;
Cancels the printing of this job. Typically, this will be tied to a 'cancel' button in the GUI.
void EnableProgressDialog ( BOOL enable ) ;
Controls the displaying of the print progress dialog box.
| enable | Indicates whether the print progress dialog should appear or not |
void OutputToPrinter ( int copies ) ;
Sets the print destination for this job to be the printer. See the Crystal Developer's Guide for more information about which printer is used.
| copies | The number of copies of the report to print |
void SelectPrinter ( const char * driverName ,
const char * printerName ,
const char * portName ,
DEVMODE * mode ) ;
Select the printer that this report will be printed to. [The parameters must be supplied or a windows dialog will be thrown up on the server machine.]
| driverName | The name of the driver |
| printerName | The name of the printer |
| portName | The name of the port |
| mode | The mode in which the printer should be selected |
void GetSelectedPrinter ( char * & driverName ,
char * & printerName ,
char * & portName ,
DEVMODE * * mode ) ;
Determine the printer that this report will be printed to.
| driverName | The name of the driver to use |
| portName | The name of the port to use |
| mode | Upon completion mode will contain information about the printer. |
void OutputToPDF ( const char * pdfFileName ,
PCREPDFOutputOptions * pdfOptions = NULL ) ;
Output the report in PDF format.
| pdfFileName | The name of the PDF output file. |
| options | Additional options controlling PDF generation. |
void ExportTo ( PCREExportOptions * exports ) ;
Export the report to a variety of formats.
| exports | A PCRExportOptions object describing the format of the export. |
void ExportTo ( PEExportOptions * exports ) ;
Export the report to a variety of formats.
| exports | A PExportOptions object describing the format of the export. |
const char * GetReportTitle ( ) ;
Get the title of this job's report.
void SetReportTitle ( const char * title ) ;
Set the title of this job's report.
| titleString | The new title for the report. |
void SetPrintOptions ( PEPrintOptions * options ) ;
Set the options for printing.
| options | The options to use for printing |
BOOL HasSavedData ( ) ;
Checks to see if this job's report contains saved data.
void DiscardSavedData ( ) ;
Discard the saved data associated with this job's report.
int GetNFormulas ( ) ;
Get the number of formulae which are used in this job's report
void GetNthFormula ( int nFormula ,
char * & formulaName ,
char * & formulaText ) ;
Get the nth formula from this job's report. Both the formula name and text are returned
| nFormula | The index of the formula to be retrieved. |
| formulaName | Where the formula name will be returned. |
| formulaText | Where the formula text will be returned. |
void GetNthFormulaStr ( short nFormula ,
char * & formulaName ,
char * & formulaText ) ;
Get the Nth formula from this job's report.
void GetFormula ( char * formulaName ,
char * & formulaText ) ;
Get the text for the given (named) formula.
| formulaName | The name of the formula. |
| formulaText | Where the formula text will be returned. |
void GetSelectionFormula ( char * & formulaText ) ;
Get the selection formula used in this job's report.
| formulaText | Where the selection formula text will be returned. |
void SetSelectionFormula ( const char * formulaText ) ;
Set the selection formula for this job's report.
| formulaText | The new selection formula. |
BOOL CheckSelectionFormula ( ) ;
Test the selection formula for validity.
BOOL CheckGroupSelectionFormula ( ) ;
Test the group selection formula for validity.
void SetFormula ( const char * formulaName ,
const char * formulaText ) ;
Set the text for a given (named) formula.
| formulaName | The name of the formula whose text is being changed. |
| formulaText | The new text for the formula. |
BOOL CheckFormula ( const char * formulaText ) ;
Checks the named formula for validity.
| formulaName | The name of the formula to check. |
int GetNParams ( ) ;
int GetNParameterFields ( ) ;
Get the number of parameter fields in this job's report.
void GetNthParameterField ( int paramN ,
PCREParameterField * info ) ;
Get details about the nth parameter field in this job's report.
| paramN | The number of the parameter field. |
| info | The PCREParameterFieldInfo for the given parameter field. |
void SetNthParameterField ( int paramN ,
PCREParameterField * info ) ;
Set details about the nth parameter field in this job's report.
| paramN | The number of the parameter field. |
| info | The PCREParameterFieldInfo for the given parameter field. |
void GetNthParam ( int paramN ,
char * & parameter ) ;
Retrieve the specified param.
| paramN | The number of the param that should be retrieved. |
| parameter | Where the parameter should be copied to. |
void SetNthParam ( int paramN ,
const char * parameter ) ;
Change the specified param.
| paramN | The number of the param that should be changed. |
| parameter | The new value of the parameter. |
int GetNSortFields ( ) ;
Get the number of sort fields in this job's report.
void GetNthSortField ( short sortFieldN ,
char * & name ,
short * direction ) ;
Get the name and sort direction of a given sort field.
| sortFieldN | The sort field which we are interested in. |
| nameHandle | Handle to use for the name. |
| nameLength | The maximum length of the name |
| Direction | Either PCREJob.SF_ASCENDING or PCREJob.SF_DESCENDING to indicate the sort field direction. |
void SetNthSortField ( short sortFieldN ,
char * name ,
short direction ) ;
Set the name and sort direction of a given sort field.
| sortFieldN | The sort field which we are interested in. |
| name | The name of the sort field to set. |
| Direction | Either PCREJob.SF_ASCENDING or PCREJob.SF_DESCENDING to indicate the sort field direction. |
void DeleteNthSortField ( short sortFieldN ) ;
Delete a given sort field from a report.
| sortFieldN | The number of the sort field to delete. |
int GetNGroupSortFields ( ) ;
Get the number of group sort fields in the current report.
void GetNthGroupSortField ( short sortFieldN ,
char * & name ,
short * direction ) ;
Get the name and sort direction of a given group sort field.
| sortFieldN | The number of the sort field. |
| name | Where the group sort field name will be stored. |
| direction | The direction of the group sort field (PCREJob.SF_ASCENDING or PCREJob.SF_DESCENDING). |
void SetNthGroupSortField ( short sortFieldN ,
char * name ,
short direction ) ;
Set the name and sort direction of a given group sort field.
| sortFieldN | The number of the sort field. |
| name | The group sort field name to be set. |
| direction | The direction of the group sort field (PCREJob.SF_ASCENDING or PCREJob.SF_DESCENDING). |
void DeleteNthGroupSortField ( short sortFieldN ) ;
Delete a given group sort field from a report.
| sortFieldN | The number of the sort field to delete. |
void GetPrintDate ( short * year ,
short * month ,
short * day ) ;
Get the print date for the job's report.
| year | Where to return the year. |
| month | Where to return the month. |
| day | Where to return the day. |
void SetPrintDate ( short year ,
short month ,
short day ) ;
Set the print date for the job's report.
| year | The year to set. |
| month | The month to set. |
| day | The day to set. |
int GetNGroups ( ) ;
Get the number of groups in this report.
int GetNSections ( ) ;
Get the number of sections in this report.
int GetNSubreportsInSection ( short sectionCode ) ;
Get the number of subreports in a given section
| sectionCode | The code for the relevant section. |
void GetNthSubreportInSection ( short sectionCode ,
short subreportN ,
PESubreportInfo * info ) ;
Get the Nth subreport in a given section.
| sectionCode | The code for the relevant section. |
| subreportN | The ordinal number of the subreport required. |
| info | A pointer to a structure to contain the subreport info returned. |
int GetSectionCode ( short sectionN ) ;
Get the section code for the specified section. See Crystal Developer's help.
| sectionN | The number of the section which you want the code for. |
int GetMinimumSectionHeight ( short sectionN ) ;
Get the minimum height for a given section. See Crystal Developer's help.
| sectionN | The code for the section which you want the height for. |
void SetMinimumSectionHeight ( short sectionN ,
short height ) ;
Set the minimum height for a given section. See Crystal Developer's help.
| sectionN | The code for the section which you want to set the height for. |
| height | The minimum height for the specified section in twips. |
void GetAreaFormat ( short areaCode ,
PESectionOptions * options ) ;
Get the area format settings for the specified area.
| areaCode | The code for the report area you are interested in. |
| options | The section options for the specified area to be copied into. |
void SetAreaFormat ( short areaCode ,
PESectionOptions * options ) ;
Set the area format settings for the specified area.
| areaCode | The code for the report area you are interested in. |
| options | The section options you wish to set for the specified area. |
void SetAreaFormatFormula ( short areaCode ,
short formulaName ,
const char * formulaString ) ;
Sets the formatting options for a report area.
| areaCode | The code for the report area whose formatting options are being changed. |
| formulaName | See Crystal Developers help for a list for legal names. |
| formulaString | The new formula text. |
void SetGroupCondition ( short sectionCode ,
const char * conditionField ,
short condition ,
short sortDirection ) ;
Change the group condition for a group section.
| sectionCode | The code for the report section for which you wish to change the group condition. |
| conditionField | Specifies the field is a condition that triggers a summary whenever its value changes |
| condition | See Crystal Developer's Help. |
| sortDirection | Specifies the sort direction (PCREJob.SF_ASCENDING or PCREJob.SF_DESCENDING) |
void GetGroupCondition ( short sectionCode ,
char * & conditionField ,
short & condition ,
short & sortDirection ) ;
Examine the group condition for a group section.
| sectionCode | The code for the report section for which you wish to view the group condition. |
| conditionField | Specifies the field is a condition that triggers a summary whenever its value changes |
| condition | See Crystal Developer's Help. |
| sortDirection | Specifies the sort direction (PCREJob.SF_ASCENDING or PCREJob.SF_DESCENDING) |
void GetGroupSelectionFormula ( char * & selectionString ) ;
Examine the group selection string.
| selectionString | Where the selection string should be placed. |
void SetGroupSelectionFormula ( char * selectionString ) ;
Change the group selection string.
| selectionString | The new selection formula to use. |
void GetSectionFormat ( short sectionCode ,
PESectionOptions * options ) ;
Get the section format settings for specified section.
| sectionCode | The code for the section which you wish to modify. |
| options | The format options for the specified section will be copied here. |
void SetSectionFormat ( short sectionCode ,
PESectionOptions * options ) ;
Sets the section format settings for specified section.
| sectionCode | The code for the section which you wish to modify. |
| options | The new format options which you wish to apply to the section. |
void SetFont ( short sectionCode ,
short scopeCode ,
const char * faceName ,
short fontFamily ,
short fontPitch ,
short charSet ,
short pointSize ,
short isItalic ,
short isUnderlined ,
short isStruckOut ,
short weight ) ;
Set Font Details. See Crystal Developer's Guide for more information.
| sectionCode | The section to change font for |
| scopeCode | The scopt code - See Crystal Developers help |
| faceName | The name of the font |
| fontFamily | The family of the font |
| fontPitch | The font pitch |
| charSet | The character set code |
| pointSize | The point size of the font |
| isItalic | Is the font intalic? |
| isUnderlined | Is the font underlined? |
| isStruckOut | Is the font struck out? |
| weight | The density, or boldness, of the font |
void GetGraphType ( short sectionCode ,
short graphN ,
short * graphType ) ;
Get information about the type of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphType | The code describing the graph type, will be copied here. See Crystal Developer's Help. |
void SetGraphType ( short sectionCode ,
short graphN ,
short * newType ) ;
Set information about the type of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphType | The new graph code to use. |
void GetGraphData ( short sectionCode ,
short graphN ,
PEGraphDataInfo * graphDataInfo ) ;
Get information about the data of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphData | The structure describing the graph data, will be copied here. See Crystal Developer's Help. |
void SetGraphData ( short sectionCode ,
short graphN ,
PEGraphDataInfo * graphDataInfo ) ;
Set information about the data of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphData | The new graph data to use for this graph. |
void GetGraphText ( short sectionCode ,
short graphN ,
PEGraphTextInfo * graphTextInfo ) ;
Get information about the text of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphText | The structure describing the graph text, will be copied here. See Crystal Developer's Help. |
void SetGraphText ( short sectionCode ,
short graphN ,
PEGraphTextInfo * graphTextInfo ) ;
Set information about the text of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphText | The new graph text to use for this graph. |
void GetGraphOptions ( short sectionCode ,
short graphN ,
PEGraphOptions * graphOptions ) ;
Get information about the options of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphOptions | The structure describing the graph options, will be copied here. See Crystal Developer's Help. |
void SetGraphOptions ( short sectionCode ,
short graphN ,
PEGraphOptions * graphOptions ) ;
Set information about the text of a given graph.
| sectionCode | The code for the section which the graph is in. |
| The | number of the graph within its section. |
| graphOptions | The new graph options to use for this graph. |
char * GetSQLQuery ( ) ;
GetSQLQuery () returns the same query as appears in the Show SQL Query dialog in CRW, in syntax specific to the database driver you are using.
void SetSQLQuery ( char * queryString ) ;
Set the SQL query for this report.
SetSQLQuery () is mostly useful for reports with SQL queries that
were explicitly edited in the Show SQL Query dialog in CRW, i.e. those
reports that needed database-specific selection criteria or joins.
(Otherwise it is usually best to continue using function calls such as
SetSelectionFormula () and let CRW build the SQL query automatically.)
SetSQLQuery () has the same restrictions as editing in the Show SQL Query dialog; in particular that changes are accepted in the FROM and WHERE clauses but ignored in the SELECT list of fields.
| queryString | The new SQL Query string. |
int GetNTables ( ) ;
Get the number of tables in this report.
void GetNthTableType ( short tableN ,
PETableType * tableType ) ;
Get information about the type of a given database table.
| tableN | The number of the table. |
| tableTyple | A PETableType object giving information about the table type. |
void GetNthTableSessionInfo ( short tableN ,
PESessionInfo * sessionInfo ) ;
Get the session information for an MS Access table being used by the report.
| tableN | The number of the table. |
| sessioninfo | A PCRESessionInfo object giving information about the access session. |
void SetNthTableSessionInfo ( short tableN ,
PESessionInfo * sessionInfo ,
BOOL propagateAcrossTables ) ;
Set the session information for an MS Access table being used by the report.
| tableN | The number of the table. |
| sessioninfo | A PCRESessionInfo object giving information about the access session. |
| propagateAcrossTable | Indicates whether the new session infomation should be used for opening all tables used in the report. |
BOOL TestNthTableConnectivity ( short tableN ) ;
This function tests whether a database table's settings are valid and ready to be reported on. It returns true if the database session, log on, and location info is all correct.
This is useful, for example, in prompting the user and testing a server password before printing begins.
This function may require a significant amount of time to complete, since it will first open a user session (if required), then log onto the database server (if required), and then open the appropriate database table (to test that it exists). It does not read any data, and closes the table immediately once successful. Logging off is performed when the print job is closed.
If it fails in any of these steps, the error code set indicates which database info needs to be updated using functions above:
| tableN | The number of the table to test. |
void GetNthTableLogOnInfo ( short tableN ,
PELogOnInfo * logOnInfo ) ;
Get the SQL connection information for the nth table in this job's report.
| tableN | The number of the table. |
| logOnInfo | The SQL connection information will be copied here. |
void SetNthTableLogOnInfo ( short tableN ,
PELogOnInfo * logOnInfo ,
BOOL propagateAcrossTables ) ;
Set the SQL connection information for the nth table in this job's report.
| tableN | The number of the table. |
| logOnInfo | The new SQL connection information to use. |
| propagateAcrossTable | Indicates whether the new session infomation should be used for opening all tables used in the report. |
void GetNthTableLocation ( short tableN ,
PETableLocation * location ) ;
Get the location information for a given table in the report.
| tableN | The number of the table. |
| location | A PETableLocation object giving information about the tables location. |
void SetNthTableLocation ( short tableN ,
PETableLocation * location ) ;
Set the location information for a given table in the report.
| tableN | The number of the table. |
| location | The new PETableLocation object to use for this table. |
int GetNDetailCopies ( ) ;
Returns the number of copies of each Details section in the report that are to be printed.
void SetNDetailCopies ( short nCopies ) ;
Change the number of detail copies
| nCopies | The number of multiple copies of the Details section of the report to print. |
void GetMargins ( short * left ,
short * right ,
short * top ,
short * bottom ) ;
retrieve the margin settings for this report.
| left | Where to return the left margin setting to. |
| right | Where to return the right margin setting to. |
| top | Where to return the top margin setting to. |
| bottom | Where to return the bottommargin setting to. |
void SetMargins ( short left ,
short right ,
short top ,
short bottom ) ;
Set the margins for this report.
| left | The value to use for the left margin |
| right | The value to use for the right margin |
| top | The value to use for the top margin |
| bottom | The value to use for the bottom margin |
int GetNPages ( ) ;
Get the number of pages in the report. This should only be called after the report has been run.
void GetReportSummaryInfo ( PEReportSummaryInfo * info ) ;
Retrieve the summary information for the report.
| info | A structure that will hold the report summary information. |
void SetReportSummaryInfo ( PEReportSummaryInfo * info ) ;
Change the summary information for the report.
| info | The new report summary information to use. |
void GetParameterField ( char * fieldName ,
PEParameterFieldInfo * output ) ;
Retieve the paramter information for a parameter with the specified name.
| fieldName | The name of the parameter that we are interested in looking at. |
| output | Where to retrieve the information. This pointer will be NULL if the field cannot be found. |
BOOL SetParameterField ( char * fieldName ,
PEParameterFieldInfo * newInfo ) ;
Change the paramter information for a parameter with the specified name.
| fieldName | The name of the parameter that we are interested in changing. |
| output | The new information to set for this parameter. |
void GetAreaFormatFormula ( short areaCode ,
short formulaName ,
char * & text ) ;
void GetGroupOptions ( short groupN ,
PEGroupOptions * groupOptions ) ;
void SetGroupOptions ( short groupN ,
PEGroupOptions * groupOptions ) ;
void GetSectionFormatFormula ( short sectionCode ,
short formulaName ,
char * & text ) ;