Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
predefinedFilter1Clicked() {
console.log('predefinedFilter1Clicked');
const predefinedFilter1 = new pbi.models.AdvancedFilter({
table: "Store",
column: "Name"
}, "Or",
{
operator: "Contains",
value: "Direct"
},
{
operator: "None",
value: "x"
}
);
this.report.setFilters([predefinedFilter1.toJSON()]);
},
onSubmit() {
const data = {
target: this.getFilterTypeTarget(),
operator: this.getFilterOperatorAndValues(),
filterable: this.getFilterableTarget()
};
let filter;
if (data.operator.type === "Basic") {
filter = new pbi.models.BasicFilter(data.target, data.operator.operator, data.operator.values);
}
else if (data.operator.type === "Advanced") {
filter = new pbi.models.AdvancedFilter(data.target, data.operator.logicalOperator, data.operator.conditions);
}
this.get('onAddFilter')(filter, data.filterable);
},
predefinedFilter3Clicked() {
console.log('predefinedFIlter3Clicked');
const predefinedFilter3 = new pbi.models.AdvancedFilter({
table: "Store",
column: "Name"
}, "Or",
{
operator: "Contains",
value: "Wash"
},
{
operator: "Contains",
value: "Park"
}
);
this.report.page('ReportSection2').setFilters([predefinedFilter3.toJSON()]);
}
},
import Ember from 'ember';
import fetch from 'ember-network/fetch';
import pbi from 'powerbi-client';
const filter = new pbi.models.AdvancedFilter({
table: "Store",
column: "Name"
}, "Or", {
operator: "Contains",
value: "Wash"
},
{
operator: "Contains",
value: "Park"
});
export default Ember.Route.extend({
model() {
return fetch('https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad')
.then(response => response.json())
.then(embedConfiguration => {
const validateConfig = config => {
switch (config.type) {
case 'report':
return pbi.models.validateReportLoad(config);
case 'dashboard':
return pbi.models.validateDashboardLoad(config);
default:
return 'Unknown config type';
}
};