@@ -948,6 +948,115 @@ function _Report_ApplyCustomLayout() {
948
948
} ) ;
949
949
}
950
950
951
+ function _Report_HideAllVisualHeaders ( ) {
952
+
953
+ // New settings to hide all the visual headers in the report
954
+ const newSettings = {
955
+ visualSettings : {
956
+ visualHeaders : [
957
+ {
958
+ settings : {
959
+ visible : false
960
+ }
961
+ // No selector - Hide visual header for all the visuals in the report
962
+ }
963
+ ]
964
+ }
965
+ } ;
966
+
967
+ // Get a reference to the embedded report HTML element
968
+ var embedContainer = $ ( '#embedContainer' ) [ 0 ] ;
969
+
970
+ // Get a reference to the embedded report.
971
+ report = powerbi . get ( embedContainer ) ;
972
+
973
+ // Update the settings by passing in the new settings you have configured.
974
+ report . updateSettings ( newSettings )
975
+ . then ( function ( ) {
976
+ Log . log ( "Visual header was successfully hidden for all the visuals in the report." ) ;
977
+ } )
978
+ . catch ( function ( error ) {
979
+ Log . log ( errors ) ;
980
+ } ) ;
981
+
982
+ }
983
+
984
+ function _Report_ShowAllVisualHeaders ( ) {
985
+ // New settings to show all the visual headers in the report
986
+ const newSettings = {
987
+ visualSettings : {
988
+ visualHeaders : [
989
+ {
990
+ settings : {
991
+ visible : true
992
+ }
993
+ // No selector - Show visual header for all the visuals in the report
994
+ }
995
+ ]
996
+ }
997
+ } ;
998
+
999
+ // Get a reference to the embedded report HTML element
1000
+ var embedContainer = $ ( '#embedContainer' ) [ 0 ] ;
1001
+
1002
+ // Get a reference to the embedded report.
1003
+ report = powerbi . get ( embedContainer ) ;
1004
+
1005
+ // Update the settings by passing in the new settings you have configured.
1006
+ report . updateSettings ( newSettings )
1007
+ . then ( function ( ) {
1008
+ Log . log ( "Visual header was successfully shown for all the visuals in the report." ) ;
1009
+ } )
1010
+ . catch ( function ( error ) {
1011
+ Log . log ( errors ) ;
1012
+ } ) ;
1013
+
1014
+ }
1015
+
1016
+ function _Report_HideSingleVisualHeader ( ) {
1017
+
1018
+ // Define settings to hide the header of a single visual
1019
+ var newSettings = {
1020
+ visualSettings : {
1021
+ visualHeaders : [
1022
+ {
1023
+ settings : {
1024
+ visible : true
1025
+ }
1026
+ // No selector - Show visual header for all the visuals in the report
1027
+ } ,
1028
+ {
1029
+ settings : {
1030
+ visible : false
1031
+ } ,
1032
+ selector : {
1033
+ $schema : "http://powerbi.com/product/schema#visualSelector" ,
1034
+ visualName : "VisualContainer7"
1035
+ // The visual name can be retrieved using getVisuals()
1036
+ // Hide visual header for a single visual only
1037
+ }
1038
+ }
1039
+ ]
1040
+ }
1041
+ } ;
1042
+
1043
+ // Get a reference to the embedded report HTML element
1044
+ var embedContainer = $ ( '#embedContainer' ) [ 0 ] ;
1045
+
1046
+ // Get a reference to the embedded report.
1047
+ report = powerbi . get ( embedContainer ) ;
1048
+
1049
+ // Update the settings by passing in the new settings you have configured.
1050
+ report . updateSettings ( newSettings )
1051
+ . then ( function ( ) {
1052
+ Log . log ( "Visual header was successfully hidden for 'Total Sales Variance by FiscalMonth and District Manager' visual." ) ;
1053
+ } )
1054
+ . catch ( function ( error ) {
1055
+ Log . log ( errors ) ;
1056
+ } ) ;
1057
+
1058
+ }
1059
+
951
1060
function _Report_FullScreen ( ) {
952
1061
// Get a reference to the embedded report HTML element
953
1062
var embedContainer = $ ( '#embedContainer' ) [ 0 ] ;
0 commit comments