From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
Used to store the report pages after a report has been run. It is part of the Reports module.
The RBReportDocument class is part of the Reports module. It returns the document after a report has been run. A report consists of one or more pages as Picture objects. You can refer to a page using its index. You can display the pages to the user in a Canvas control or print the pages.
See the modified Example Database project that returns both a simple report and report with a break level. See also the Gas Report project that prints a simple listing without a break levels.
In the Gas Report example project, the RBReportDocument returned by the reporting engine is passed to the instance of the Report class:
Var ps As New PrinterSetup
Var rpt As New GasPricesReport
If rpt.Run(ds, ps) Then
If rpt.Document <> Nil Then ReportViewer1.SetDocument(rpt.Document)
The SetDocument method gets the current page of the report so that it can be imaged.
mDocument = doc
mCurrentPage = 1
If doc.PageCount > 0 Then SetCurrentPage(mCurrentPage)
SetCurrentPage gets the picture of the current page.
mCurrentPage = pageNum
mCurrentPicture = mDocument.Page(mCurrentPage)
ScrollBar1.Maximum = mCurrentPicture.Height - Canvas1.Height
ScrollBar1.Value = 0
If mCurrentPicture <> Nil Then
g.DrawPicture(mCurrentPicture, 0, 0, Me.Width, Me.Height, 0, _
Scrollbar1.Value, Me.Width, Me.Height)
g.DrawRectangle(0, 0, Me.Width, Me.Height)