Use JavaScript to apply restrictions and parameters to a paginated report
Use JavaScript to apply restrictions and parameters to a paginated report
Technologies > Business Process Owner Views > Paginated Reports > Report with Passed Restriction and Parameters
The core has been expanded to support passing restrictions and parameters to a paginated report. Some existing JavaScript files need to be changed to reflect these core changes. The following is an example of how to do this in JavaScript:
//pass just restrictions without parameters
restrictions_parameters_reporting_onPassingRestrictions: function() {
//a paginated view name
var reportViewName = "ab-test-restrictions-reporting.axvw";
var restriction = new Ab.view.Restriction();restriction.addClause('fl.bl_id', 'HQ', '=');
var anotherRestriction = new Ab.view.Restriction();
anotherRestriction.addClause('rm.fl_id', '18', '=');
//paired dataSourceId with Restriction objects
var passedRestrictions = {'ds_abExRmxflRpt_owner': restriction, 'ds_abExRmxflRpt_data': anotherRestriction};
//parameters
var parameters = null;
//passing restrictions
View.openPaginatedReportDialog(reportViewName, passedRestrictions, parameters);
},
//pass just parameters without restrictions
restrictions_parameters_reporting_onPassingParameters: function() {
//a paginated view name
var reportViewName = "ab-test-parameters-reporting.axvw";
var passedRestrictions = null;
//paired parameter names with parameter values
var parameters = {'ds_abExRmxflRpt_owner_bl_id':'HQ','ds_abExRmxflRpt_data_dp_id':'ENGINEERING'};
//passing parameters
View.openPaginatedReportDialog(reportViewName, passedRestrictions, parameters);
},
//pass both restrictions and parameters
restrictions_parameters_reporting_onPassingBoth: function() {
//a paginated view name
var reportViewName = "ab-test-restrictions-and-parameters-reporting.axvw";
var restriction = new Ab.view.Restriction();
restriction.addClause('fl.bl_id', 'HQ', '=');
var anotherRestriction = new Ab.view.Restriction();
anotherRestriction.addClause('rm.fl_id', '18', '=');
//paired dataSourceId with Restriction objects
var passedRestrictions = {'ds_abExRmxflRpt_owner': restriction, 'ds_abExRmxflRpt_data': anotherRestriction};
//paired parameter names with parameter values
var parameters = {'ds_abExRmxflRpt_data_dp_id':'ENGINEERING'};
//passing restrictions and parameters
View.openPaginatedReportDialog(reportViewName, passedRestrictions, parameters);
}
View: http://localhost:8080/archibus/schema/ab-test-passing-restrictions-parameters-reporting.axvw