@@ -4,6 +4,7 @@ import * as models from 'powerbi-models';
44import * as wpmp from 'window-post-message-proxy' ;
55import * as hpm from 'http-post-message' ;
66import * as utils from './util' ;
7+ import * as errors from './errors' ;
78import { IFilterable } from './ifilterable' ;
89import { IPageNode , Page } from './page' ;
910import { Defaults } from './defaults' ;
@@ -38,7 +39,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
3839 static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled' ;
3940 static typeAttribute = 'powerbi-type' ;
4041 static type = "Report" ;
41-
42+
4243 public bookmarksManager : BookmarksManager ;
4344
4445 /**
@@ -129,6 +130,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
129130 * @returns {Promise<models.IFilter[]> }
130131 */
131132 getFilters ( ) : Promise < models . IFilter [ ] > {
133+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
134+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
135+ }
136+
132137 return this . service . hpm . get < models . IFilter [ ] > ( `/report/filters` , { uid : this . config . uniqueId } , this . iframe . contentWindow )
133138 . then ( response => response . body ,
134139 response => {
@@ -165,6 +170,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
165170 * @returns {Promise<Page[]> }
166171 */
167172 getPages ( ) : Promise < Page [ ] > {
173+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
174+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
175+ }
176+
168177 return this . service . hpm . get < models . IPage [ ] > ( '/report/pages' , { uid : this . config . uniqueId } , this . iframe . contentWindow )
169178 . then ( response => {
170179 return response . body
@@ -203,6 +212,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
203212 * Prints the active page of the report by invoking `window.print()` on the embed iframe component.
204213 */
205214 print ( ) : Promise < void > {
215+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
216+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
217+ }
218+
206219 return this . service . hpm . post < models . IError [ ] > ( '/report/print' , null , { uid : this . config . uniqueId } , this . iframe . contentWindow )
207220 . then ( response => {
208221 return response . body ;
@@ -222,6 +235,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
222235 * @returns {Promise<void> }
223236 */
224237 removeFilters ( ) : Promise < void > {
238+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
239+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
240+ }
241+
225242 return this . setFilters ( [ ] ) ;
226243 }
227244
@@ -237,6 +254,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
237254 * @returns {Promise<void> }
238255 */
239256 setPage ( pageName : string ) : Promise < void > {
257+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
258+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
259+ }
260+
240261 const page : models . IPage = {
241262 name : pageName ,
242263 displayName : null ,
@@ -267,6 +288,11 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
267288 * @returns {Promise<void> }
268289 */
269290 setFilters ( filters : models . IFilter [ ] ) : Promise < void > {
291+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
292+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
293+ }
294+
295+
270296 return this . service . hpm . put < models . IError [ ] > ( `/report/filters` , filters , { uid : this . config . uniqueId } , this . iframe . contentWindow )
271297 . catch ( response => {
272298 throw response . body ;
@@ -290,6 +316,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
290316 * @returns {Promise<void> }
291317 */
292318 updateSettings ( settings : models . ISettings ) : Promise < void > {
319+ if ( utils . isRDLEmbed ( this . config . embedUrl ) && settings . customLayout != null ) {
320+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
321+ }
322+
293323 return this . service . hpm . patch < models . IError [ ] > ( '/report/settings' , settings , { uid : this . config . uniqueId } , this . iframe . contentWindow )
294324 . catch ( response => {
295325 throw response . body ;
@@ -375,6 +405,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
375405 * @returns {Promise<boolean> }
376406 */
377407 isSaved ( ) : Promise < boolean > {
408+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
409+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
410+ }
411+
378412 return utils . isSavedInternal ( this . service . hpm , this . config . uniqueId , this . iframe . contentWindow ) ;
379413 }
380414
@@ -386,6 +420,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
386420 * ```
387421 */
388422 applyTheme ( theme : models . IReportTheme ) : Promise < void > {
423+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
424+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
425+ }
426+
389427 return this . applyThemeInternal ( theme ) ;
390428 }
391429
@@ -397,6 +435,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
397435 * ```
398436 */
399437 resetTheme ( ) : Promise < void > {
438+ if ( utils . isRDLEmbed ( this . config . embedUrl ) ) {
439+ return Promise . reject ( errors . APINotSupportedForRDLError ) ;
440+ }
441+
400442 return this . applyThemeInternal ( < models . IReportTheme > { } ) ;
401443 }
402444
0 commit comments