
- •Application Development with Crystal Smart Viewers
- •Seagate Crystal Smart Viewer for ActiveX
- •Adding the Smart Viewer to a Visual Basic project
- •Using the CRViewer object
- •The Crystal Smart Viewer Java Bean
- •Adding the Smart Viewer Bean to the project
- •Creating a simple applet with the Smart viewer
- •Overview of the Report Designer Object Model
- •Object Naming Conflicts
- •Objects and Collections
- •Application Object
- •Application Object Methods
- •CanClose Method (Application Object)
- •LogOffServer Method (Application Object)
- •LogOnServer Method (Application Object)
- •OpenReport Method (Application Object)
- •SetMatchLogOnInfo Method (Application Object)
- •SetMorePrintEngineErrorMessages Method (Application Object)
- •Area Object
- •Area Object Properties
- •Areas Collection
- •Areas Collection Properties
- •BlobFieldObject Object
- •BlobFieldObject Object Properties
- •BoxObject Object
- •BoxObject Object Properties
- •CrossTabObject Object
- •CrossTabObject Object Properties
- •Database Object
- •Database Object Properties
- •Database Object Methods
- •LogOffServer Method (Database Object)
- •LogOnServer Method (Database Object)
- •SetDataSource Method (Database Object)
- •Verify Method (Database Object)
- •DatabaseFieldDefinition Object
- •DatabaseFieldDefinition Object Properties
- •DatabaseFieldDefinitions Collection
- •DatabaseFieldDefinitions Collection Properties
- •DatabaseTable Object
- •DatabaseTable Object Properties
- •DatabaseTable Object Methods
- •SetDataSource Method (DatabaseTable Object)
- •SetLogOnInfo Method (DatabaseTable Object)
- •SetPrivateData Method (Database Table Object)
- •SetSessionInfo Method (Database Table Object)
- •TestConnectivity Method (Database Table Object)
- •DatabaseTables Collection
- •DatabaseTables Collection Properties
- •ExportOptions Object
- •ExportOptions Object Properties
- •ExportOptions Object Methods
- •PromptForExportOptions Method (ExportOptions Object)
- •Reset Method (ExportOptions Object)
- •FieldObject Object
- •FieldObject Object Properties
- •FormattingInfo Object
- •FormattingInfo Object Properties
- •FormulaFieldDefinition Object
- •FormulaFieldDefinition Object Properties
- •FormulaFieldDefinition Object Methods
- •Check Method (FormulaFieldObject)
- •FormulaFieldDefinitions Collection
- •FormulaFieldDefinitions Collection Properties
- •GraphObject Object
- •GraphObject Object Properties
- •GroupNameFieldDefinition Object
- •GroupNameFieldDefinition Object Properties
- •GroupNameFieldDefinitions Collection
- •GroupNameFieldDefinitions Collection Properties
- •LineObject Object
- •LineObject Object Properties
- •MapObject Object
- •MapObject Object Properties
- •OLEObject Object
- •OLEObject Object Properties
- •Page Object
- •Page Object Properties
- •Page Object Methods
- •RenderEPF Method (Page Object)
- •RenderHTML Method (Page Object)
- •PageEngine Object
- •PageEngine Object Properties
- •PageEngine Object Methods
- •CreatePageGenerator Method (PageEngine Object)
- •RenderTotallerETF Method (PageEngine Object)
- •RenderTotallerHTML Method (PageEngine Object)
- •PageGenerator Object
- •PageGenerator Object Properties
- •PageGenerator Object Methods
- •DrillOnGraph Method (PageGenerator Object)
- •DrillOnMap Method (PageGenerator Object)
- •DrillOnSubreport Method (PageGenerator Object)
- •GetPageNumberForGroup Method (PageGenerator Object)
- •RenderTotallerETF Method (PageGenerator Object)
- •RenderTotallerHTML Method (PageGenerator Object)
- •SearchForText Method (PageGenerator Object)
- •Pages Collection
- •Pages Collection Properties
- •ParameterFieldDefinition Object
- •ParameterFieldDefinition Object Properties
- •ParameterFieldDefinition Object Methods
- •AddCurrentRange Method (ParameterFieldDefinition Object)
- •AddCurrentValue Method (ParameterFieldDefinition Object)
- •AddDefaultValue Method (ParameterFieldDefinition Object)
- •GetNthCurrentRange Method (ParameterFieldDefinition Object)
- •GetNthCurrentValue Method (ParameterFieldDefinition Object)
- •GetNthDefaultValue Method (ParameterFieldDefinition Object)
- •SetNthDefaultValueMethod (ParameterFieldDefinition Object)
- •ParameterFieldDefinitions Collection
- •ParameterFieldDefinitions Collection Properties
- •PrintingStatus Object
- •PrintingStatus Object Properties
- •Report Object
- •Report Object Properties
- •Report Object Methods
- •AddGroup Method (Report Object)
- •CancelPrinting Method (Report Object)
- •DiscardSavedData Method (Report Object)
- •Export Method (Report Object)
- •GetNextRows Method (Report Object)
- •OpenSubreport Method (Report Object)
- •PrintOut Method (Report Object)
- •ReadRecords Method (Report Object)
- •Save Method (Report Object)
- •SelectPrinter Method (Report Object)
- •SetDialogParentWindow Method (Report Object)
- •ReportObjects Collection
- •ReportObjects Collection Properties
- •RunningTotalFieldDefinition Object
- •RunningTotalFieldDefinition Object Properties
- •RunningTotalFieldDefinitions Collection
- •RunningTotalFieldDefinitions Collection Properties
- •Section Object
- •Section Object Properties
- •Section Object Event
- •Format Event (Section Object)
- •Sections Collection
- •Sections Collection Properties
- •SortField Object
- •SortField Object Properties
- •SortFields Collection
- •SortFields Collection Properties
- •SortFields Collection Methods
- •Add Method (SortFields Collection)
- •Delete Method (SortFields Collection)
- •SpecialVarFieldDefinition Object
- •SpecialVarFieldDefinition Object Properties
- •SQLExpressionFieldDefinition Object
- •SQLExpressionFieldDefinition Object Properties
- •SQLExpressionFieldDefinitions Collection
- •SQLExpressionFieldDefinitions Collection Properties
- •SubreportObject Object
- •SubreportObject Object Properties
- •SubreportObject Object Method
- •OpenSubreport Method (Subreport Object)
- •SummaryFieldDefinition Object
- •SummaryFieldDefinition Object Properties
- •SummaryFieldDefinitions Collection
- •SummaryFieldDefinitions Collection Properties
- •TextObject Object
- •TextObject Object Properties
- •TextObject Object Method
- •SetText Method (TextObject Object)
- •Crystal Data Source Object Models
- •Crystal Data Objects
- •CrystalComObject
- •CrystalComObject Properties
- •RowCount
- •CrystalComObject Methods
- •AddField
- •AddRows
- •DeleteField
- •GetColCount
- •getEOF
- •GetFieldData
- •GetFieldName
- •GetFieldType
- •MoveFirst
- •MoveNext
- •MoveTo
- •Reset
- •Crystal Data Source Type Library
- •CRDataSource
- •CRDataSource Properties
- •Bookmark
- •FieldCount
- •FieldName
- •FieldType
- •FieldValue
- •RecordCount
- •CRDataSource Methods
- •MoveFirst
- •MoveNext
- •CRVEventInfo Object
- •CRVEventInfo Object Properties
- •CRViewer Object
- •CRViewer Object Properties
- •CRViewer Object Methods
- •ActivateView
- •AddView
- •CloseView
- •Drag Method
- •ExportReport
- •GetCurrentPageNumber
- •GetViewPath
- •Move Method
- •PrintReport
- •Refresh
- •SearchByFormula
- •SearchForText
- •SetFocus
- •ShowFirstPage
- •ShowGroup
- •ShowLastPage
- •ShowNextPage
- •ShowNthPage
- •ShowPreviousPage
- •ShowWhatsThis
- •ViewReport
- •Zoom
- •ZOrder
- •CRViewer Object Events
- •Clicked Event
- •CloseButtonClicked Event
- •DblClicked Event
- •DownloadFinished Event
- •DownloadStarted Event
- •DragDrop Event
- •DragOver Event
- •DrillOnDetail Event
- •DrillOnGroup Event
- •ExportButtonClicked Event
- •FirstPageButtonClicked Event
- •GotFocus Event
- •GoToPageNClicked Event
- •GroupTreeButtonClicked Event
- •LastPageButtonClicked Event
- •LostFocus Event
- •NextPageButtonClicked Event
- •OnReportSourceError Event
- •PrevPageButtonClicked Event
- •PrintButtonClicked Event
- •RefreshButtonClicked Event
- •SearchButtonClicked Event
- •SearchExpertButtonClicked Event
- •SelectionFormulaBuilt Event
- •SelectionFormulaButtonClicked Event
- •ShowGroup Event
- •StopButtonClicked Event
- •Validate Event
- •ViewChanged Event
- •ZoomLevelChanged Event
- •CRVTrackCursorInfo Object
- •CRVTrackCursorInfo Object Properties
- •The Crystal Smart Viewer/Java Bean Properties
- •The Crystal Smart Viewer/Java Bean Methods
- •closeCurrentView
- •exportView
- •printView
- •refreshReport
- •searchForText
- •showLastPage
- •showPage
- •stopAllCommands
- •The Crystal Smart Viewer/Java Bean Events
- •ServerRequestEvent
- •ViewChangeEvent
- •Overview of Section Codes
- •Section Codes (32-bit)
- •Section Codes (16-bit)
- •ActiveX Controls Properties
- •Action
- •BoundReportFooter
- •BoundReportHeading
- •Connect
- •CopiesToPrinter
- •DataFiles
- •DataSource
- •Destination
- •DetailCopies
- •DialogParentHandle
- •DiscardSavedData
- •EMailCCList
- •EMailMessage
- •EMailSubject
- •EMailToList
- •EMailVIMBCCList
- •ExchangeFolder
- •ExchangePassword
- •ExchangeProfile
- •Formulas
- •GraphData
- •GraphOptions
- •GraphText
- •GraphType
- •GroupCondition
- •GroupSelectionFormula
- •GroupSortFields
- •LastErrorNumber
- •LastErrorString
- •LogOnInfo
- •MarginBottom
- •MarginLeft
- •MarginRight
- •MarginTop
- •ParameterFields
- •Password
- •PrintDay
- •PrinterCollation
- •PrinterCopies
- •PrinterDriver
- •PrinterName
- •PrinterPort
- •PrinterStartPage
- •PrinterStopPage
- •PrintFileCharSepQuote
- •PrintFileCharSepSeparator
- •PrintFileLinesPerPage
- •PrintFileName
- •PrintFileODBCPassword
- •PrintFileODBCSource
- •PrintFileODBCTable
- •PrintFileODBCUser
- •PrintFileType
- •PrintFileUseRptDateFmt
- •PrintFileUseRptNumberFmt
- •PrintMonth
- •PrintYear
- •ProgressDialog
- •RecordsPrinted
- •RecordsRead
- •RecordsSelected
- •ReportDisplayPage
- •ReportFileName
- •ReportLatestPage
- •ReportSource
- •ReportStartPage
- •ReportTitle
- •SectionFont
- •SectionFormat
- •SectionLineHeight
- •SectionMinHeight
- •SelectionFormula
- •SessionHandle
- •SortFields
- •SQLQuery
- •Status
- •StoredProcParam
- •SubreportToChange
- •UserName
- •WindowAllowDrillDown
- •WindowBorderStyle
- •WindowControlBox
- •WindowControls
- •WindowHeight
- •WindowLeft
- •WindowMaxButton
- •WindowMinButton
- •WindowParentHandle
- •WindowShowCancelBtn
- •WindowShowCloseBtn
- •WindowShowExportBtn
- •WindowShowGroupTree
- •WindowShowNavigationCtls
- •WindowShowPrintBtn
- •WindowShowPrintSetupBtn
- •WindowShowProgressCtls
- •WindowShowRefreshBtn
- •WindowShowSearchBtn
- •WindowShowZoomCtl
- •WindowState
- •WindowTitle
- •WindowTop
- •WindowWidth
- •ActiveX Controls Methods
- •FetchSelectionFormula
- •GetNSubreports
- •GetNthSubreportName
- •LogoffServer
- •LogonServer
- •PageCount
- •PageFirst
- •PageLast
- •PageNext
- •PagePrevious
- •PageShow
- •PageZoom
- •PageZoomNext
- •PrinterSelect
- •PrintReport
- •ReplaceSelectionFormula
- •Reset
- •RetrieveDataFiles
- •RetrieveLogonInfo
- •RetrieveSQLQuery
- •RetrieveStoredProcParams
- •SpecifyDataSourceField
- •ActiveX Controls Error Messages
- •Overview of the Crystal Report Engine Object Model
- •Object Hierarchy
- •Object Naming Conflicts
- •Object Model Events
- •Crystal Report Engine Object Model Reference
- •Objects and Collections
- •Application Object
- •Application Object Properties
- •Application Object Methods
- •CanClose
- •ClearError
- •LogOffServer
- •LogOnServer
- •OpenReport
- •Area Object
- •Area Object Properties
- •AreaOptions Object
- •AreaOptions Properties
- •Areas Collection
- •Areas Collection Properties
- •BlobFieldObject Object
- •BlobFieldObject Object Properties
- •BoxObject Object
- •BoxObject Object Properties
- •CrossTabObject Object
- •CrossTabObject Object Properties
- •Database Object
- •Database Object Properties
- •Database Object Methods
- •Verify
- •DatabaseFieldDefinition Object
- •Database FieldDefinition Object Properties
- •DatabaseFieldDefinitions Collection
- •Database FieldDefinitions Collection Properties
- •DatabaseParameter Object
- •Database Parameter Object Properties
- •DatabaseParameters Collection
- •DatabaseParameters Collection Properties
- •DatabaseTable Object
- •DatabaseTable Object Properties
- •DatabaseTable Object Methods
- •GetPrivateData
- •SetLogOnInfo
- •SetPrivateData
- •SetSessionInfo
- •TestConnectivity
- •DatabaseTables Collection
- •DatabaseTables Collection Properties
- •EventInfo Object (32-bit only)
- •EventInfo Object Properties
- •ExportOptions Object
- •ExportOptions Object Properties
- •ExportOptions Object Methods
- •PromptForExportOptions
- •Reset
- •FieldDefinitions Collection
- •FieldDefinitions Collection Properties
- •FieldObject Object
- •Field Object Object Properties
- •FieldValue Object (32-bit only)
- •FieldValue Object Properties
- •Font Object
- •Font Object Properties
- •FormulaFieldDefinition Object
- •FormulaFieldDefinition Properties
- •FormulaFieldDefinition Methods
- •Check
- •FormulaFieldDefinitions Collection
- •FormualFieldDefinitions Collection Properties
- •GlobalOptions Object
- •GlobalOptions Object Properties
- •GraphObject Object
- •GraphObject Object Properties
- •GroupAreaOptions Object
- •GraphAreaOptions Object Properties
- •GroupNameFieldDefinition Object
- •GroupNameFieldDefinition Object Properties
- •LineObject Object
- •LineObject Object Properties
- •OLEObject Object
- •OLEObject Object Properties
- •Page Object (32-bit only)
- •Page Object Properties
- •Page Object Methods
- •RenderEPF
- •RenderHTML
- •PageEngine Object (32-bit only)
- •PageEngine Object Properties
- •PageEngine Object Methods
- •CreatePageGenerator
- •RenderTotallerETF
- •RenderTotallerHTML
- •PageGenerator Object (32-bit only)
- •PageGenerator Object Properties
- •PageGenerator Object Methods
- •DrillOnGraph
- •GetPageNumberForGroup
- •SearchForText
- •Pages Collection (32-bit only)
- •Pages Collection Properties
- •PageSetup Object
- •PageSetup Object Properties
- •ParameterFieldDefinition Object
- •ParameterFieldDefinition Object Properties
- •ParameterFieldDefinition Object Methods
- •SetCurrentValue
- •SetDefaultValue
- •ParameterFieldDefinitions Collection
- •ParameterFieldDefinitions Collection Properties
- •PrinterInfo Object
- •PrinterInfo Object Properties
- •PrintingStatus Object
- •PrintingStatus Object Properties
- •PrintWindowOptions Object
- •PrintWindowOptions Object Properties
- •Report Object
- •Report Object Properties
- •Report Object Methods
- •AddGroup
- •CancelPrinting
- •ClearError
- •DiscardSavedData
- •Export
- •OpenSubreport
- •Preview
- •PrintOut
- •ReadRecords (32-bit only)
- •SelectPrinter
- •Report Object Events
- •ReadingRecords
- •Start
- •Stop
- •ReportObjects Collection
- •ReportObjects Collection Properties
- •ReportOptions Object
- •ReportOptions Object Properties
- •ReportSummaryInfo Object
- •ReportSummaryInfo Object Properties
- •Section Object
- •Section Object Properties
- •SectionOptions Object
- •SectionOptions Object Properties
- •Sections Collection
- •Sections Collection Properties
- •SortField Object
- •SortField Object Properties
- •SortFields Collection
- •SortFields Collection Properties
- •SortFields Collection Methods
- •Delete
- •SpecialVarFieldDefinition Object
- •SpecialVarFieldDefinition Object Properties
- •SubreportObject Object
- •Subreport Object Properties
- •SummaryFieldDefinition Object
- •SummaryFieldDefinition Object Properties
- •SummaryFieldDefinitions Collection
- •SummaryFieldDefinitions Collection Properties
- •TextObject Object
- •TextObject Object Properties
- •TrackCursorInfo Object
- •TrackCursorInfo Object Properties
- •View Object
- •View Object Properties
- •View Object Methods
- •Close
- •Export
- •NextMagnification
- •PrintOut
- •ShowFirstPage
- •ShowLastPage
- •ShowNextPage
- •ShowNthPage
- •ShowPreviousPage
- •ZoomPreviewWindow
- •Views Collection
- •Views Collection Properties
- •Window Object
- •Window Object Properties
- •Window Object Methods
- •Close
- •Window Object Events
- •ActivatePrintWindow
- •CancelButtonClicked
- •CloseButtonClicked
- •ClosePrintWindow
- •DeactivatePrintWindow
- •DrillOnDetail
- •DrillOnGroup
- •ExportButtonClicked
- •FirstPageButtonClicked
- •GroupTreeButtonClicked
- •LastPageButtonClicked
- •NextPageButtonClicked
- •PrevPageButtonClicked
- •PrintButtonClicked
- •RefreshButtonClicked
- •SearchButtonClicked
- •ShowGroup
- •ZoomLevelChanging
- •Error Codes
- •Automation Server Error Codes
- •Report Engine Error Codes
- •The Crystal NewEra Class Library
- •class CRPEngine
- •constructor CRPEngine::CRPEngine
- •class CRPEngine Methods
- •CRPEngine::CanClose
- •CRPEngine::Close
- •CRPEngine::GetEngineStatus
- •CRPEngine::GetErrorCode
- •CRPEngine::GetErrorText
- •CRPEngine::GetNPrintJobs
- •CRPEngine::GetVersion
- •CRPEngine::LogOffServer
- •CRPEngine::LogOnServer
- •CRPEngine::LogOnSQLServerWithPrivateInfo
- •CRPEngine::Open
- •CRPEngine::OpenJob
- •CRPEngine::PrintReport
- •class CRPEJob
- •constructor CRPEJob::CRPEJob
- •class CRPEJob Methods
- •CRPEJob::Cancel
- •CRPEJob::CheckFormula
- •CRPEJob::CheckGroupSelectionFormula
- •CRPEJob::CheckSelectionFormula
- •CRPEJob::Close
- •CRPEJob::CloseWindow
- •CRPEJob::DeleteNthGroupSortField
- •CRPEJob::DeleteNthSortField
- •CRPEJob::ExportPrintWindow
- •CRPEJob::ExportTo
- •CRPEJob::GetErrorCode
- •CRPEJob::GetErrorText
- •CRPEJob::GetExportOptions
- •CRPEJob::GetFormula
- •CRPEJob::GetGraphData
- •CRPEJob::GetGraphOptions
- •CRPEJob::GetGraphText
- •CRPEJob::GetGraphType
- •CRPEJob::GetGroupCondition
- •CRPEJob::GetGroupSelectionFormula
- •CRPEJob::GetJobHandle
- •CRPEJob::GetJobStatus
- •CRPEJob::GetLineHeight
- •CRPEJob::GetMargins
- •CRPEJob::GetMinimumSectionHeight
- •CRPEJob::GetNDetailCopies
- •CRPEJob::GetNFormulas
- •CRPEJob::GetNGroups
- •CRPEJob::GetNGroupSortFields
- •CRPEJob::GetNLinesInSection
- •CRPEJob::GetNParams
- •CRPEJob::GetNSortFields
- •CRPEJob::GetNTables
- •CRPEJob::GetNthFormula
- •CRPEJob::GetNthGroupSortField
- •CRPEJob::GetNthParam
- •CRPEJob::GetNthSortField
- •CRPEJob::GetNthTableLocation
- •CRPEJob::GetNthTableLogOnInfo
- •CRPEJob::GetNthTableSessionInfo
- •CRPEJob::GetNthTableType
- •CRPEJob::GetPrintDate
- •CRPEJob::GetPrintOptions
- •CRPEJob::GetReportTitle
- •CRPEJob::GetSectionFormat
- •CRPEJob::GetSelectedPrinter
- •CRPEJob::GetSelectionFormula
- •CRPEJob::GetSQLQuery
- •CRPEJob::IsJobFinished
- •CRPEJob::NextWindowMagnification
- •CRPEJob::OutputToPrinter
- •CRPEJob::OutputToWindow
- •CRPEJob::PrintControlsShowing
- •CRPEJob::PrintWindow
- •CRPEJob::SelectPrinter
- •CRPEJob::SetFont
- •CRPEJob::SetFormula
- •CRPEJob::SetGraphData
- •CRPEJob::SetGraphOptions
- •CRPEJob::SetGraphText
- •CRPEJob::SetGraphType
- •CRPEJob::SetGroupCondition
- •CRPEJob::SetGroupSelectionFormula
- •CRPEJob::SetLineHeight
- •CRPEJob::SetMargins
- •CRPEJob::SetMinimumSectionHeight
- •CRPEJob::SetNDetailCopies
- •CRPEJob::SetNthGroupSortField
- •CRPEJob::SetNthParam
- •CRPEJob::SetNthSortField
- •CRPEJob::SetNthTableLocation
- •CRPEJob::SetNthTableLogOnInfo
- •CRPEJob::SetNthTableSessionInfo
- •CRPEJob::SetPrintDate
- •CRPEJob::SetPrintOptions
- •CRPEJob::SetReportTitle
- •CRPEJob::SetSectionFormat
- •CRPEJob::SetSelectionFormula
- •CRPEJob::SetSQLQuery
- •CRPEJob::Show...Page
- •CRPEJob::ShowPrintControls
- •CRPEJob::StartJob
- •CRPEJob::TestNthTableConnectivity
- •CRPEJob::ZoomPreviewWindow
- •Other NewEra Classes
- •class CRPEExportOptions
- •Constructor CRPEExportOptions::CRPEExportOptions
- •class CRPEGraphDataInfo
- •Constructor CRPEGraphDataInfo::CRPEGraphDataInfo
- •class CRPEGraphOptions
- •Constructor CRPEGraphOptions::CRPEGraphOptions
- •class CRPEGraphTextInfo
- •Constructor CRPEGraphTextInfo::CRPEGraphTextInfo
- •class CRPEJobInfo
- •Constructor CRPEJobInfo::CRPEJobInfo
- •class CRPELogOnInfo
- •Constructor CRPELogOnInfo::CRPELogOnInfo
- •class CRPEPrintOptions
- •Constructor CRPEPrintOptions::CRPEPrintOptions
- •class CRPESectionOptions
- •Constructor CRPESectionOptions::CRPESectionOptions
- •class CRPESessionInfo
- •Constructor CRPESessionInfo::CRPESessionInfo
- •class CRPETableLocation
- •Constructor CRPETableLocation::CRPETableLocation
- •class CRPETableType
- •Constructor CRPETableType::CRPETableType
- •Class Constants
- •Chart Type Constants
- •Error Codes
- •Section Codes
- •Sort Order Constants
Seagate Crystal Reports™ 7.0
Technical Reference
Volume 3 - COM and Web
Component Reference
Seagate Software, Inc.
840 Cambie Street
Vancouver, B.C., Canada V6B 4J2
© 1999 (manual and software) Seagate Software, Inc. All Rights Reserved.
Seagate Software, Seagate, and the Seagate logo are registered trademarks of Seagate Technology, Inc., or one of its subsidiaries. Seagate Crystal Reports, Seagate Crystal Info, Seagate Info, the Seagate Crystal Reports logo, and Smart Navigation are trademarks or registered trademarks of Seagate Software, Inc. All other product names referenced are believed to be the registered trademarks of their respective companies.
Manual written by:
ELUCIDEX
655 Stuart Road
Bellingham, WA 98226 http://www.elucidex.com
1999
C O N T E N T S
Chapter 1 - Using Crystal Smart Viewers in Applications
Application Development with Crystal Smart Viewers . . . . . . . . . . . . . . . . . . . . . . . . . 2 Seagate Crystal Smart Viewer for ActiveX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 The Crystal Smart Viewer Java Bean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Chapter 2 - Report Designer Component Object Model |
|
Overview of the Report Designer Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
12 |
Objects and Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
12 |
Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
18 |
Area Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
22 |
Area Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
22 |
Areas Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
24 |
BlobFieldObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
25 |
BoxObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
27 |
CrossTabObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
29 |
Database Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
30 |
DatabaseFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
33 |
DatabaseFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
36 |
DatabaseTable Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
36 |
DatabaseTables Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
40 |
ExportOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
41 |
FieldObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
45 |
FormattingInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
50 |
FormulaFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
50 |
FormulaFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
53 |
GraphObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
54 |
GroupNameFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
64 |
GroupNameFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
66 |
LineObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
67 |
MapObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
68 |
OLEObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
70 |
Page Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
72 |
PageEngine Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
74 |
PageGenerator Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
77 |
Pages Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
83 |
i
ParameterFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
ParameterFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92
PrintingStatus Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92
Report Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
ReportObjects Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
RunningTotalFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
RunningTotalFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Section Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
Sections Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
SortField Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
SortFields Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
SpecialVarFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
SQLExpressionFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
SQLExpressionFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
SubreportObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118
SummaryFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
SummaryFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
TextObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
Chapter 3 - Crystal Data Source Object Models |
|
Crystal Data Source Object Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
128 |
Crystal Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
128 |
CrystalComObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
128 |
Crystal Data Source Type Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
135 |
CRDataSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
135 |
Chapter 4 - Smart Viewer Object Models
Crystal Smart Viewer/ActiveX Object Model Technical Reference . . . . . . . . . . . . . .140
CRVEventInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142
CRViewer Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143
CRVTrackCursorInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164
The Crystal Smart Viewer/Java Bean Technical Reference . . . . . . . . . . . . . . . . . . . .165
Chapter 5 - Crystal ActiveX Control Reference
Overview of Section Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172
ActiveX Controls Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174
ii
ActiveX Controls Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266
ActiveX Controls Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .278
Chapter 6 - Crystal Report Engine Object Model for the Automation Server
Overview of the Crystal Report Engine Object Model . . . . . . . . . . . . . . . . . . . . . . . .282 Crystal Report Engine Object Model Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . .283 Objects and Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284 Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290 Area Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .294 AreaOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .295 Areas Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .296 BlobFieldObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .297 BoxObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .298 CrossTabObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .299 Database Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .299 DatabaseFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .300 DatabaseFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .302 DatabaseParameter Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .303 DatabaseParameters Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .304 DatabaseTable Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305 DatabaseTables Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .309 EventInfo Object (32-bit only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .310 ExportOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .310 FieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .314 FieldObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .315 FieldValue Object (32-bit only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .316 Font Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .316 FormulaFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .318 FormulaFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .320 GlobalOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .321 GraphObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .322 GroupAreaOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .325 GroupNameFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .327 LineObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .329 OLEObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .329 Page Object (32-bit only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .330 PageEngine Object (32-bit only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .332
iii
PageGenerator Object (32-bit only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .335 Pages Collection (32-bit only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .337 PageSetup Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .338 ParameterFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .340 ParameterFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .345 PrinterInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .345 PrintingStatus Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .346 PrintWindowOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .347 Report Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .349 ReportObjects Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358 ReportOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358 ReportSummaryInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360 Section Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361 SectionOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361 Sections Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364 SortField Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364 SortFields Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .365 SpecialVarFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .367 SubreportObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369 SummaryFieldDefinition Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369 SummaryFieldDefinitions Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .372 TextObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .372 TrackCursorInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .373 View Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .375 Views Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .379 Window Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .379 Error Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .390
Chapter 7 - Crystal Class Library for NewEra Reference
The Crystal NewEra Class Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .394 class CRPEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .394 class CRPEJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .403 Other NewEra Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .461 Class Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .477
Index
iv
Volume 3 |
|
1 |
Using Crystal Smart Viewers in |
|
Applications |
What you will find in this chapter. . .
Application Development with Crystal Smart Viewers, Page 2
...an introduction.
Seagate Crystal Smart Viewer for ActiveX, Page 2
...including an introduction to programming with the Smart Viewer Object Model, and adding and using the Smart Viewer Object.
The Crystal Smart Viewer Java Bean, Page 9
...including an introduction, comments regarding adding the Smart Viewer Bean to your project and creating a simple applet with Smart Viewer.
Using Crystal Smart Viewers in Applications |
1 |
Application Development with Crystal Smart Viewers
Developing applications that display reports on screen is now a straightforward process. Seagate Crystal Reports includes the Seagate Crystal Smart Viewers as easy to use but complex components that can be embedded directly in an application. Once added to an application, reports accessed through the Report Engine Automation Server, the Report Designer Component, or the Crystal Web Reports Server can be displayed right inside your own applications. The Smart Viewer retains all of the powerful formatting, grouping, and totalling power of the original report, and your users get access to data in a dynamic and clear format.
Seagate Crystal Reports provides two Smart Viewers specifically designed for application development: the Crystal Smart Viewer for ActiveX and the Crystal Smart Viewer Java Bean. Both provide a complete object model for programming and manipulating the Smart Viewer at runtime inside your applications. Simply displaying a single report inside the Smart Viewer is a simple process requiring only a couple of lines of code. However, if necessary for your application, you have the option of complete control over how the Smart Viewer appears and functions.
With the Crystal Smart Viewer as a front-end user interface for viewing reports, Seagate Crystal Reports development technologies allow you to develop even complex client/server or multi-tier applications that access, manipulate, and display data for intranet systems, workgroups, or any group of people needing clear and informative data on a regular basis. Design robust Business Support systems and Enterprise Information Management applications delivering even the most complex data through the Crystal Smart Viewers.
This chapter describes both the ActiveX and Java Bean versions of the Smart Viewer in relation to designing applications using Seagate Crystal Reports development technologies. If you are interested in creating web sites that display reports, you should also review chapter 3, volume 1, which describes the HTML and Java applet versions of the Smart Viewer as well.
Seagate Crystal Smart Viewer for ActiveX
The Seagate Crystal Smart Viewer for ActiveX is a standard ActiveX control that can be added to an application in any development environment that supports ActiveX. Programmers using Visual Basic, Delphi, Visual C++, or Borland C++ programmers all receive the benefit of quickly adding a powerful report viewer to an application with little coding.
As a standard component, the ActiveX Smart Viewer exposes several properties at design time, but also provides a complete object model with properties, methods, and events that can be programmed at runtime. The following sections discuss various topics for working with the ActiveX Smart Viewer in Visual Basic. If you are using a development environment other than Visual Basic, use these topics as a guideline, but refer to your development software documentation for specific information on working with ActiveX controls.
The Seagate Crystal Smart Viewer, as an ActiveX control, includes a complete object model for controlling how it appears in an application, and how it displays reports. Simply displaying a report in the Smart Viewer window takes little code, but to truly make use of its power requires a broader understanding of how to work with the object model.
The following topics are discussed in this section.
Adding the Smart Viewer to a Visual Basic project, Page 3
Using the CRViewer object, Page 3
Using Crystal Smart Viewers in Applications |
2 |

Adding the Smart Viewer to a Visual Basic project
If you create a new report using the Create Report Expert in the Seagate Crystal Report Designer Component, the Smart Viewer control can be automatically added to a Form in your Visual Basic project. However, there may be times when you need to add the control by hand. In addition, the Smart Viewer control can be implemented in other environments, many of which may not support ActiveX designers, meaning the Create Report Expert is unavailable.
Use the following steps to add the Seagate Smart Viewer ActiveX control to a Form in your Visual Basic application. This tutorial assumes the Form already exists in your project and is named Form1.
1First, you must verify that a reference to the Smart Viewer control exists in your project. From the Project menu, select the Components command. The Components dialog box appears.
2On the Controls Tab of the Components dialog box, scroll through the list of ActiveX controls until you find Crystal Report Smart Viewer.
NOTE: If you do not see the Crystal Report Smart Viewer control in the list, use the Browse button to locate the CRVIEWER.DLL component in the C:\Program Files\Seagate Software\Viewers\ActiveXViewer directory.
3If the check box next to the Smart Viewer control is not toggled on, toggle it on now.
4Click OK, and the CRViewer control will appear in the Visual Basic toolbox.
5Click the CRViewer control on the toolbox, then draw the Smart Viewer control on your form by dragging a rectangle across the form with the mouse pointer. An instance of the control will be added to your Form.
6Adjust the size and position of the Smart Viewer on your form, and use the Properties window to adjust the overall appearance of the control.
Using the CRViewer object
The CRViewer object represents an instance of the Smart Viewer control that has been added to your project. If you have created a report using the Seagate Crystal Report Designer Component and accepted the defaults for adding the Smart Viewer to your project, the Smart Viewer control in your application will be named CRViewer1. CRViewer1 can be used in your code as a CRViewer object. For instance, the following code demonstrates a simple technique for assigning a report to the Smart Viewer, and displaying it:
CRViewer1.ReportSource = report
CRViewer1.ViewReport
For more information on the properties and methods available with this object, refer to the Smart Viewer object model and the CRViewer object.
Using Crystal Smart Viewers in Applications |
3 |
The topics listed below describe several aspects of the Smart Viewer object model and present examples of how to use the Smart Viewer objects, methods, properties and events in your Visual Basic code.
Using the CRViewer object, Page 3
Specifying a report, Page 4
Working with secure data in reports, Page 4
Handling Smart Viewer events, Page 5
Moving through a report, Page 5
Printing the report, Page 7
Controlling the appearance of the Smart Viewer, Page 7
Connecting to the Web Reports Server, Page 8
Specifying a report
The most important task with the Smart Viewer control is to specify a report and display it at runtime. This is easily handled with the ReportSource property and the ViewReport method.
Private Sub Form1_Load()
Dim report As New CrystalReport1
CRViewer1.ReportSource = report
CRViewer1.ViewReport
End Sub
In this example, assigning the report and displaying it in the Smart Viewer is handled when the Form containing the Smart Viewer object is loaded into the application. A reference to the report is first obtained in the form of a Report object representing a Seagate Crystal Report Designer Component that has been added to the Visual Basic project.
ReportSource is a property of the Smart Viewer’s CRViewer object which corresponds directly to the Smart Viewer control added to the project. In this case, that control has been named CRViewer1. The ReportSource property can accept a report in the form of a Report object exposed by the Report Designer Component’s object model. This property can also accept a Report object provided by the Crystal Report Engine Automation Server&, or the Seagate Crystal Web Reports Server.
Finally, the ViewReport method is called. This method has no parameters and has the job simply of displaying the specified report inside the Smart Viewer control.
Working with secure data in reports
If your report connects to a secure data source that requires log on information, you must release the Report object from the Smart Viewer before you can log off of the data source. This can be done by assigning a new Report object to the ReportSource property, or by closing the CRViewer object. Until this is done, the data source will not be released from the Report object and you can not log off.
Using Crystal Smart Viewers in Applications |
4 |
Handling Smart Viewer events
The Smart Viewer control allows you to write custom code for several events relating to user interaction with both the control window and the report displayed. For instance, if you design a drill down report using the Report Designer Component, your users are likely to want to drill down on detail data. You can provide custom handling of such an event by writing code fort the DrillOnGroup event.
To add event procedures to the Smart Viewer control for the DrillOnGroup and PrintButtonClicked events:
1In the Visual Basic Project window, select the Form containing the Smart Viewer control.
2Click the View Code button in the toolbar for the Project window. A code window for the form appears.
3In the drop-down list box at the upper left hand corner of the code window, select the CRViewer1 control. (This name will appear different if you changed the Name property of the control in the Properties window.)
4In the drop-down list box at the upper right corner of the code window, select the DrillOnGroup event. A procedure appears for handling the event.
5Add the following code to the DrillOnGroup event procedure:
Private Sub CRViewer1_DrillOnGroup(GroupNameList As Variant, _
ByVal DrillType As CRVIEWERLibCtl.CRDrillType, UseDefault As Boolean)
MsgBox "You're drilling down on the " & GroupNameList(0) & " group!"
End Sub
6In the drop-down list box at the upper right of the code window, select the PrintButtonClicked event. A new procedure appears for this event.
7Add the following code for the new event:
Private Sub CRViewer1_PrintButtonClicked(UseDefault As Boolean) MsgBox "You clicked the Print button!"
End Sub
The DrillOnGroup event is triggered when a user double-clicks on a chart, on a map, or on a report summary field. The code added to the event procedure will display a message box with the name of the group. The PrintButtonClicked event is fired if the user clicks the print button on the Smart Viewer window. Note that any code added to these event handlers replaces the default action of the event. A more practical use of these events would be to display custom dialogs or perform other report related calculations and procedures.
Moving through a report
Often, reports consist of several pages. The Smart Viewer control provides, by default, controls that allow a user to move through the pages of the report. However, you may need to implement a system through which your own code controls when separate pages are displayed.
Using Crystal Smart Viewers in Applications |
5 |
The CRViewer object provides several methods for moving through a report, including methods to move to specific pages:
●ShowFirstPage
●ShowLastPage
●ShowNextPage
●ShowPreviousPage
●ShowNthPage
●GetCurrentPageNumber
And methods for moving to specific groups in the report:
ShowGroup
Moving through pages
The first set of methods designed for moving through the pages of a report are straightforward and correspond directly to controls that normally appear on the Smart Viewer control window. ShowFirstPage, ShowLastPage, ShowNextPage, and ShowPreviousPage simply switch to the first, last, next, or previous page in the report, respectively. They are all used in the same manner in code:
CRViewer1.ShowFirstPage
CRViewer1.ShowLastPage
CRViewer1.ShowNextPage
CRViewer1.ShowPreviousPage
If the requested page can not be displayed, for instance, if the last page in the report is currently displayed and ShowNextPage is called, the currently displayed page will be refreshed.
For more controlled movements through the report, ShowNthPage can display a specific page of the report:
CRViewer1.ShowNthPage 5
This method accepts a page number as its only argument. If the selected page number does not exist, for example, page 10 is selected from a 6 page report, then either the last or first page will be displayed, depending on the page number requested.
As a convenience, the GetCurrentPageNumber method has also been included. You can obtain the currently displayed page from within your code at any time using this method:
Dim pageNum As Long
pageNum = CRViewer1.GetCurrentPageNumber
Using Crystal Smart Viewers in Applications |
6 |
Moving to a specific group
Grouping is a common feature of reports, and, since page numbers can frequently change based on current data, it may be more appropriate to navigate through a report using groups. For example, if a report is grouped by cities within states, and by states within countries, the following code would display the group for Los Angeles:
lNote the use of the colons to separate groups and subgroups. A safe array may also be used by this method.
Printing the report
Although the Smart Viewer control is designed primarily for displaying reports on screen, users frequently want a hard-copy of the data. The PrintReport method provides a simple means of allowing access to the Windows print features. Simply call the method as below, and Windows can take over.
Dim Report As New Crystalreport1
CRViewer1.ReportSource = Report
CRViewer1.PrintReport
Controlling the appearance of the Smart Viewer
By default, the Smart Viewer window includes several controls for allowing users to navigate through a report, enlarge the view of a report, refresh the data in a report, and more. There may be applications that you create in which you want to limit a user’s interaction, change the look of the Smart Viewer window, or provide an alternate means of accessing the same functionality.
For instance, you could turn off the navigation controls in the Smart Viewer, then create your own controls to navigate through the report that call the ShowFirstPage, ShowLastPage, ShowNextPage, ShowPreviousPage, and ShowNthPage methods. (See Moving through a report, Page 5.) For handling such custom features, the Smart Viewer object model provides several properties for enabling and disabling different features of the Smart Viewer ActiveX control:
●DisplayBackgroundEdge
●DisplayBorder
●DisplayGroupTree
●DisplayTabs
●DisplayToolbar
●EnableAnimationCtrl
●EnableCloseButton
●EnableDrillDown
●EnableGroupTree
●EnableNavigationControls
●EnablePrintButton
Using Crystal Smart Viewers in Applications |
7 |
●EnableProgressControl
●EnableRefreshButton
●EnableSearchControl
●EnableSelectExpertButton
●EnableStopButton
●EnableToolbar
●EnableZoomControl
Using these properties requires assigning a value of either True or False. True enables the specified control or feature of the Smart Viewer, while False disables it. All controls and features are, by default, enabled.
NOTE: The Enable properties can not be assigned a value at runtime. They must be set using the Properties window at design time.
The following code demonstrates how to disable the entire toolbar for the Smart Viewer window:
CRViewer1.DisplayToolbar = False
Connecting to the Web Reports Server
The Web Reports Server provides not only a powerful means of distributing reports across the web, but also provides a report distribution mechanism that can be incorporated into multi-tier applications. By using the Crystal Smart Viewer for ActiveX as a client-side report viewer, the Web Reports Server can become a report distribution engine within a larger application that runs over a network.
Connecting to the Web Reports Server requires accessing two new ActiveX components: the WebReportBroker and the WebReportSource. The following samples demonstrate how to connect to the Web Reports Server using
Connecting from Visual Basic, Page 8, and Connecting from VBScript, Page 9, inside a web page.
Connecting from Visual Basic
The following code is an example of how to connect to the Web Reports Server from Visual Basic and assign a report to the Crystal Smart Viewer for ActiveX. This assumes that you have added the ActiveX viewer control to a form named Form1, and the ActiveX viewer control is named CRViewer1.
Private Sub Form1_Load()
Dim webBroker, webSource
Set webBroker = CreateObject("WebReportBroker.WebReportBroker") Set webSource = CreateObject("WebreportSource.WebReportSource")
webSource.ReportSource = webBorker
webSource.URL = "http://<machinename>/scrreports/xtreme/hr.rpt" webSource.Title = "Employee Profiles"
CRViewer1.ReportSource = webSource
CRViewer1.ViewReport
End Sub
Using Crystal Smart Viewers in Applications |
8 |