[{"id":"5efffa63-6bf4-4819-8af7-0f6b8e1c53a4","tags":[{"name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e"}]},{"id":"dfd416a6-eef9-49a0-bb8b-2e739da5cc1c","tags":[{"name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e"}]},{"id":"3b1e4fc6-fe58-48c3-b090-4335186ca05c","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"7f93f7b9-9f7f-46b2-b05f-494017b34eae","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"95079239-11e6-44bd-8e3f-4c5b9f8e172c","tags":[{"name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e"}]},{"id":"43ece935-4016-4eb3-a3f8-5951257cb2a7","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"b2fdc309-b91f-42a8-b6f5-5c04d366748e","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"bb982598-dc4e-4495-884c-64f4338def46","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"c632c625-e3a4-4a10-abfa-66bf4a2cd520","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"8fc7bf9e-d24f-43cd-a915-6f8a991152c4","tags":[{"name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e"}]},{"id":"7e488fdd-64d8-4c8f-9f96-7a9590f02070","tags":[{"name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e"}]},{"id":"4d93a50e-208e-44ef-8ea6-8e81d4c8f339","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"e77dbdc2-200d-4c9c-9bf7-907a453eccb0","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"eecc4b5c-431b-4677-887b-a523a0d10cfd","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"ba126ca3-9e37-4aed-b486-a79bd39b3d86","tags":[{"name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e"}]},{"id":"5792319e-7207-4871-a69d-aa3b6eabad63","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"eb1cc175-3766-46e9-9659-c125771a58d4","tags":[{"name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3"}]},{"id":"212b23f1-4bfe-46f9-91cf-f24eca55418d","tags":[{"name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601","links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e"}]}]
With the release of ActiveReportsJS v4.0, we've introduced a new API for programmatically setting, validating, and resolving default values for report parameters. As a result, the existing API has been deprecated and will be removed in the next major version. This document provides a list of deprecated API members and their respective replacements in v4.0.
A common use case for programmatically setting parameter values is exporting a report to one of the supported formats. Before v4.0, you would use the parameters
property of the PageReport class instance, as demonstrated in the following code snippet:
import {Core} from "@grapecity/activereports";
var report = new Core.PageReport();
await report.load(`assets/Products.rdlx-json`);
report.parameters["Header"].values = ["Product List"]; // string single value parameter
report.parameters["SupplierIds"].values = [1,2,3]; // integer multi value parameter
The parameters
property is now deprecated. Instead, you can use one of two alternatives.
The load
method now accepts the parameters values:
import {Core} from "@grapecity/activereports";
var report = new Core.PageReport();
await report.load(`assets/Products.rdlx-json`, {
reportParameters: [{
Name: 'Header',
Value: ['Product List']
}, {
Name: 'SupplierIds',
Value: [1,2,3]
}]
});
The PageReport
class instance now exposes a reportParameters
object with an applySteps
method for setting parameter values in various advanced scenarios:
var report = new Core.PageReport();
await report.load(`assets/Products.rdlx-json`);
report.reportParameters.applySteps([
{
Name: "Header",
Value: "Product List",
Type: "Set",
},
{
Name: "SupplierIds",
Value: [1, 2, 3],
Type: "Set",
},
]);
Previously, if a report parameter had a default value, you needed to call the resolveParametersValues
method of the PageReport
class instance before exporting a report. In v4.0, this method has been deprecated, and default values are resolved automatically.
The validateParameters
method of the PageReport
class has been deprecated. Instead, use the validate method of the reportParameters
object:
import {Core} from "@grapecity/activereports";
var report = new Core.PageReport();
await report.load(`assets/Products.rdlx-json`, {
reportParameters: [{
Name: 'Header',
Value: ['Product List']
}, {
Name: 'SupplierIds',
Value: [1,2,3]
}]
});
const validationResult = report.reportParameters.validate();
if(!validationResult['SupplierIds'].isValid)
console.log('Invalid SupplierIds value: ', validationResult['SupplierIds'].message);