Restrict a paginated report from a console with multiple filter fields

Archibus often contains a large amount of data; to generate reports, you typically need a complex console to restrict the report to just the data needed, for example, to just records for a specific site, building, month, or approving manager. You can then generate a paginated report for this restricted data.

Use the following code to construct a restriction object:

var restriction = new Ab.view.Restriction();
restriction.addClause('bl.bl_id', 'H%', "LIKE");
restriction.addClause('rm.rm_type’, 'OFFICE', "=");

You can then call the paginated report job passing the restriction and the ID of the datasource to which it applies as parameters:

View.openPaginatedReportDialog(
'ab-my-paginated-report.axvw',
{ ‘dataSourceName1’ : restriction } );

The method has the form:

View.openPaginatedReportDialog(
paginatedReportUrlParameters,
listOfDataSourcesAndRestrictions ) ;

The paginatedReportUrlParameters value specifies the parameters that are to be passed to the standard ab-paginated-report-job.axvw. Using this parameter is

equivalent:

View.openDialog('ab-paginated-report-job.axvw?ab-my-paginated-report.axvw' );

Applying Restrictions to Multiple Data Sources

If you have multiple restrictions to be applied to different dataSources within the view, pass them as a structured list with an invocation like the following:

var restrictionForDataSource1 = …
var restrictionForDataSource2 = …
View.openDialog('some report', {
'dataSourceId1': restrictionForDataSource1,
'dataSourceId2': restrictionForDataSource2 } ;