The report scores are not aligned to center

shraddha_agrawa
Tera Expert

Hi All,

I am trying to show a Single Score Report on the Service Portal through a Widget. its working fine for all types of Report, but for Single Score type, the content is not aligned to center.

Any help in the below code would be appreciated.

PFB Widget Code:

HTML:

<div class="panel panel-pink">

<!--<div class="panel-heading">Report Name</div> -->

<div class="panel-body">

<iframe class="not-active" ng-src="{{data.report}}" scrolling="no" frameborder="0" height="{{data.height}}" width="100%"></iframe>

<div></div>

CSS:

.panel.panel-pink .panel-heading {

  border-radius: 3px;

  color: #FFF;

  background-color: #D9853B;

}

.panel.panel-pink .panel-body {

  background-color: #e7e7e7;

  color: #4D4D4D;

}

.panel-pink > .panel-body{

 

min-height:100px;

}

.panel-pink > .panel-heading{

height:46px;

}

.panel-pink{

 

margin-top:-15px;

  width:100%;

 

}

Server Script:

(function() {

  /* populate the 'data' object */

  /* e.g., data.table = $sp.getValue('table'); */

  data.report = "show_report.do?report="+options.report;

  if (options.height) {

  data.height = options.height +"px";

  } else {

  data.height = "100px";

  }

})();

Client Script:

function() {

  /* widget controller */

  var c = this;

}

Option Schema:

[{"displayValue":"Report","name":"report","label":"Report","type":"reference","value":"sys_report","ed":{"reference":"sys_report"}},{"name":"height","label":"Height","type":"string"}]

Thanks

8 REPLIES 8

Aaron Munoz
Tera Guru

Hi shraddha.agrawal



If your instance is in Jakarta, the plugin "Performance Analytics and Reporting - Service Portal Widgets" may provide the functionality you need.


Gaurav Bajaj
Kilo Sage

Hi Shradha,



Please add below CSS in the show_report UI page.


This will allow the iframe to pick this CSS as its loaded within same UI page/



.single-score{



text-align: center !important;


}



find_real_file.png




Please mark correct/helpful based on the impact of the response.




Thanks


Gaurav


Hi Shradha,



Any update on this one??


Hi Gaurav,




I am not getting how to put this up in the ui page script:



Can you please help me out with that too.




HTMl:





#img_company_loader



#div_company_loader



















CLIENT




displayLoader(true);



embedReportByParams(jQuery("span[id=report]"),


);



setTimeout(function(){displayLoader(false);},2000);







function displayLoader(show) {



var winH = $j(window).height();



var winW = $j(window).width();





$j("#div_company_loader").css({



opacity: 0.5,



top: 0,



left: 0,



width: "100%",



height: "100%"



});





$j("#img_company_loader").css();





if (show) {



$j("#div_company_loader").show();



$j("#img_company_loader").show();



} else {



$j("#div_company_loader").hide();



$j("#img_company_loader").hide();



}



}






Thanks



On Wed, Nov 8, 2017 at 1:20 PM, gauravbajaj2007 <