Customize Report Widget in Web App Builder

616
1
03-20-2020 06:46 AM
JessieShapiro
New Contributor II

I'd like to make edits to the report widget using ESIRs Web AppBuilder Developers Edition. My web app has an interactive map and infographics. I want to create a report widget that prints out the map as well as the infographics. The report widget I have can print out the map but I'm getting stuck on how to write the Javascript to also print out the infographics from the web map? The infographic widgets I'm using are the out of the box ones that come with the Web AppBuilder. I'm new to Javascript so any help would be appreciated. Here is the report widgt.js:

define(['dojo/_base/declare', 'jimu/BaseWidget', 'jimu/dijit/Report', 'jimu/dijit/PageUtils'],
function(declare, BaseWidget, Report, PageUtils) {
//To create a widget, you need to derive from BaseWidget.
return declare([BaseWidget], {
// DemoWidget code goes here

//please note that this property is be set by the framework when widget is loaded.
//templateString: template,

baseClass: 'jimu-widget-report',

postCreate: function() {
this.inherited(arguments);
console.log('postCreate');
},

startup: function() {
this.inherited(arguments);

this.report = new Report({
footNotes: "Report Generated by James",
printTaskUrl: "http://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",
reportLayout: {
"pageSize": PageUtils.PageSizes.A4,
"orientation": PageUtils.Orientation.Landscape
}
});

console.log('startup');
},

onOpen: function(){
console.log('onOpen');
},

onClose: function(){
console.log('onClose');
},

onMinimize: function(){
console.log('onMinimize');
},

onMaximize: function(){
console.log('onMaximize');
},

onSignIn: function(credential){
/* jshint unused:false*/
console.log('onSignIn');
},

onSignOut: function(){
console.log('onSignOut');
},

_onBtnPrintClicked: function(){
var printData = [
{
addPageBreak: true,
type: "map",
map: this.map
}


					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
1 Reply
AndrewMcDonagh
New Contributor II

Hello Jessie,

Were you ever able to create a solution for this request?
I am brand new at javascripting and would love to do the same process as you -

Create a report that includes what has been filtered down in the map, and the infographics.

Any ideas or help you have I would appreciate!

Thank you!
Andrew

0 Kudos