AnsweredAssumed Answered

Error jimu/dijit/Report with the Table

Question asked by juanma93_6 on Apr 5, 2018
Latest reply on Jul 31, 2018 by juanma93_6

Hi Guys, i am deploying a report widget in web app builder, i guide by this code example,Report class—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers . I dont know when i change the table col size the table percist with the default value 3 Columos like i show in this example:

 

My Code looks like this i just copy the js file:

 

define(['dojo/_base/declare',
'jimu/BaseWidget',
'jimu/dijit/Report',
'jimu/dijit/PageUtils',
'esri/tasks/query',
'esri/tasks/QueryTask',
'dojo/_base/array',
'dojo/_base/lang',
'dojo/on',
'dojo/dom'],
function(declare, BaseWidget, Report, PageUtils,Query,QueryTask,array,lang,on,dom) {
//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-demo',

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

startup: function() {
this.inherited(arguments);
this.report = new Report({
footNotes: "Reporte Generador por Juan Manuel Angel",
printTaskUrl: "http://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",
reportLayout: {
"pageSize": PageUtils.PageSizes.A4,
"orientation": PageUtils.Orientation.Portrait
}
});
console.log('Inicio Widget');
},
_onBtnPrintClicked: function(){
var DatosReporte2 = [];
var queryTask = new QueryTask("https://localhost:6443/arcgis/rest/services/EVENTOS/FeatureServer/1");
var query = new Query();
query.returnGeometry = false;
query.outFields = ["CODPTO_EVENTO","FECHA_INGRESO","MUNICIPIO","CONFIRMADOS"];
query.where = "1=1";
queryTask.execute(query, lang.hitch(this, function(results) {

DatosReporte = array.map(results.features, function (feature) {
Datos = [feature.attributes["CODPTO_EVENTO"],feature.attributes["FECHA_INGRESO"],feature.attributes["MUNICIPIO"],feature.attributes["CONFIRMADOS"]];
DatosReporte2.push(Datos);
});
}));

var printData = [
{
addPageBreak: true,
type: "map",
map: this.map
},
{
title: "Resumen de Eventos",
addPageBreak: false,
type: "table",
tableCols : 4,
data: {
showRowIndex: false,
rows: DatosReporte2,
cols: ["CODIGO DEPARTAMENTO", "FECHA INGRESO", "MUNICIOIPIO","CONFIRMADOS"]
}
},
{
title: "Photos",
type: "html",
data: '<style>table, th, td {border: 1px solid black;}</style><table><tr><td>Cell A</td><td>Cell B</td></tr></table>'

}];
this.report.print("Reporte Eventos", printData);
console.log(DatosReporte2);
}
});
});

Outcomes