Report Data Type

Version: Available or changed with runtime version 1.0.

Is used to display, print, or process information from a database.

Static methods

The following methods are available on the Report data type.

Method name Description
DefaultLayout(Integer) Gets the default built-in layout type that is used on a specified report.
ExcelLayout(Integer, InStream) Gets the Excel layout that is used on a report and returns it as a data stream.
Execute(Integer, Text [, RecordRef]) Runs a report in preview or processing-only mode without showing the request page in the client. The preview document will be downloaded as a PDF file to the user's browser client, where it can be read with the PDF reader. It won't open the Business Central preview page in the browser. The method gets the request page parameter values as an input parameter string from a RunRequestPage method call. The OnOpen and OnClose triggers on the request page will run even though the request page is not shown.
GetSubstituteReportId(Integer) Gets the ID of the report that will be run by the platform after considering any substitutions made by extensions.
Print(Integer, Text [, Text] [, RecordRef]) Prints a specified report without running the request page. Instead of using the request page to obtain parameters at runtime, the method gets the parameter values as an input parameter string, typically from a RunRequestPage method call.
RdlcLayout(Integer, InStream) Gets the RDLC layout that is used on a report and returns it as a data stream.
Run(Integer [, Boolean] [, Boolean] [, var Record]) Loads and executes the report that you specify.
RunModal(Integer [, Boolean] [, Boolean] [, var Record]) Loads and executes the report that you specify.
RunRequestPage(Integer [, Text]) Runs the request page for a report without running the report. Returns an XML string that contains the request page parameters that are entered on the request page.
SaveAs(Integer, Text, ReportFormat, var OutStream [, RecordRef]) Runs a specific report without a request page and saves the report as a PDF, Excel, Word, HTML, or XML file. Instead of using the request page to obtain parameters at runtime, the method gets the parameter values as an input parameter string, typically from the return value of a RunRequestPage method call.
SaveAsExcel(Integer, Text [, var Record]) Saves a report on the computer that is running the server as a Microsoft Excel (.xls) workbook.
SaveAsHtml(Integer, Text [, var Record]) Saves a report as an HTML file. The file is saved on the computer where the server instance is running, and then downloaded to the client when ready. > This method is only supported when a report uses a Word report layout when it is run.
SaveAsPdf(Integer, Text [, var Record]) Saves a report as a .pdf file.
SaveAsWord(Integer, Text [, var Record]) Saves a report on the computer that is running the server as a Microsoft Word (.doc) document.
SaveAsXml(Integer, Text [, var Record]) Saves the resulting data set of a query as an .xml file. The following code shows the syntax of the SAVEASXML function. The first line of code is the syntax for an instance method call. The second line of code is the syntax for a static method call.
ValidateAndPrepareLayout(Integer, InStream, var InStream, ReportLayoutType) Validates if the provided report layout is compatible with the specified report and performs the required modifications so that it can be used for rendering.
WordLayout(Integer, InStream) Gets the Word report layout that is used on a report and returns it as a data stream.
WordXmlPart(Integer [, Boolean]) Returns the report data structure as structured XML that is compatible with Microsoft Word custom XML parts. The method has an instance call and a static call. The following code shows the syntax of the WORDXMLPART function. The first line of code is the syntax for an instance method call. The second line of code is the syntax for a static method call.

Instance methods

The following methods are available on instances of the Report data type.

Method name Description
Break() Exits from a loop or a trigger in a data item trigger of a report or XmlPort.
CreateTotals(var Decimal [, var Decimal,...]) Maintains totals for a variable in AL.
CreateTotals(Array of [Decimal]) Maintains totals for a variable in AL.
DefaultLayout() Gets the default built-in layout type that is used on a specified report.
ExcelLayout(var InStream) Gets the Excel layout that is used on a report and returns it as a data stream.
Execute(Text [, RecordRef]) Runs a report in preview or processing-only mode without showing the request page in the client. The preview document will be downloaded as a PDF file to the user's browser client, where it can be read with the PDF reader. It won't open the Business Central preview page in the browser. The method gets the request page parameter values as an input parameter string from a RunRequestPage method call. The OnOpen and OnClose triggers on the request page will run even though the request page is not shown.
FormatRegion([Text]) Gets or sets the current format region setting for the report.
IsReadOnly() Gets if the current report's data access intent is readonly.
Language([Integer]) Gets or sets the current language setting for the report.
NewPage() Forces a page break when printing a report.
NewPagePerRecord([Boolean]) Gets or sets the current setting of the NewPagePerRecord property.
ObjectId([Boolean]) Gets or sets the name or number of the report.
PageNo([Integer]) Gets or sets the current page number of a report.
PaperSource(Integer [, Integer]) Gets or sets the paper source used for the current page or a specified page.
Preview() Indicates whether a report is being printed in preview mode.
Print(Text [, Text] [, RecordRef]) Prints a specified report without running the request page. Instead of using the request page to obtain parameters at runtime, the method gets the parameter values as an input parameter string, typically from a RunRequestPage method call.
PrintOnlyIfDetail([Boolean]) Gets or sets the current settings of the PrintOnlyIfDetail property.
Quit() Aborts the processing of a report or XmlPort.
RDLCLayout(var InStream) Gets the RDLC layout that is used on a report and returns it as a data stream.
Run() Loads and executes the report that you specify.
RunModal() Loads and executes the report that you specify.
RunRequestPage([Text]) Runs the request page for a report without running the report. Returns an XML string that contains the request page parameters that are entered on the request page.
SaveAs(Text, ReportFormat, var OutStream [, RecordRef]) Runs a specific report without a request page and saves the report as a PDF, Excel, Word, or XML file. Instead of using the request page to obtain parameters at runtime, the method gets the parameter values as an input parameter string, typically from the return value of a RunRequestPage method call.
SaveAsExcel(Text) Saves a report on the computer that is running the server as a Microsoft Excel (.xls) workbook.
SaveAsHtml(Text) Saves a report as an HTML file. The file is saved on the computer where the server instance is running, and then downloaded to the client when ready. > This method is only supported when a report uses a Word report layout when it is run.
SaveAsPdf(Text) Saves a report as a .pdf file.
SaveAsWord(Text) Saves a report on the computer that is running the server as a Microsoft Word (.doc) document.
SaveAsXml(Text) Saves the resulting data set of a query as an .xml file.The following code shows the syntax of the SAVEASXML method. The first line of code is the syntax for an instance method call. The second line of code is the syntax for a static method call.
SetTableView(var Record) Applies the table view on the current record as the table view for the page, report, or XmlPort.
ShowOutput() Returns the current setting of whether a section should be printed, and changes this setting.
ShowOutput(Boolean) Returns the current setting of whether a section should be printed, and changes this setting.
Skip() Skips the current iteration of the current report or XmlPort.
TotalsCausedBy() Determines which field caused a group total to be calculated. This determines which field changed contents and thereby concluded a group.
UseRequestPage([Boolean]) Gets or sets whether a request page is presented to the user.
ValidateAndPrepareLayout(InStream, var InStream, ReportLayoutType) Validates if the provided report layout is compatible with the specified report and performs the required modifications so that it can be used for rendering.
WordLayout(var InStream) Gets the Word report layout that is used on a report and returns it as a data stream.
WordXmlPart([Boolean]) Gets the report data structure as structured XML that is compatible with Microsoft Word custom XML parts.

See Also

Report object properties (AL Language Reference)
Report, Report Dataitem, and Report Extension Properties (AL Language Reference)
Report overview
Get Started with AL
Developing Extensions