Thank you for the quick reply, I appreciate it.
I put the code in the print.js file of the Print widget, I believe in the correct spots, however, the print widget does not do anything now, just shows a blank panel (see code below). If this is of any help, this information is going to a custom print service and the map window in the printout is small, 2.5in x 3.5in. Am I missing something else?
Thanks again.
print: function() {
var myExtent = this.map.infoWindow.getSelectedFeature()._extent;
this.map.setExtent(myExtent.expand(1.25), true);
setTimeout(function(){
if (this.printSettingsFormDijit.isValid()) {
var form = this.printSettingsFormDijit.get('value');
lang.mixin(form, this.layoutMetadataDijit.get('value'));
lang.mixin(form, this.forceAttributesFormDijit.get('value'));
lang.mixin(form, this.labelsFormDijit.get('value'));
this.preserve = this.preserveFormDijit.get('value');
lang.mixin(form, this.preserve);
this.layoutForm = this.layoutFormDijit.get('value');
var mapQualityForm = this.mapQualityFormDijit.get('value');
var mapOnlyForm = this.mapOnlyFormDijit.get('value');
lang.mixin(mapOnlyForm, mapQualityForm);
var elementsObj = this.customTextElementsDijit.get('value');
var cteArray = [], hasDate = false, locale = dojoConfig.locale || 'en';
for (var p in elementsObj) {
var cte = {};
if (p === 'Date') {
hasDate = true;
}
cte[p] = elementsObj[p];
cteArray.push(cte);
}
if(!hasDate) {
cteArray.push({ Date: new Date().toLocaleString(locale) });
}
var templateInfo = this._currentTemplateInfo;
var hasAuthorText = lang.getObject('layoutOptions.hasAuthorText', false, templateInfo);
var hasCopyrightText = lang.getObject('layoutOptions.hasCopyrightText',
false, templateInfo);
var hasTitleText = lang.getObject('layoutOptions.hasTitleText', false, templateInfo);
var template = new PrintTemplate();
template.format = form.format;
template.layout = form.layout;
template.preserveScale = (form.preserveScale === 'true' || form.preserveScale === 'force');
template.forceFeatureAttributes = form.forceFeatureAttributes && form.forceFeatureAttributes[0];
template.label = form.title;
template.exportOptions = mapOnlyForm;
template.showLabels = form.showLabels && form.showLabels[0];
template.layoutOptions = {
authorText: hasAuthorText ? form.author : "",
copyrightText: hasCopyrightText ? (form.copyright || this._getMapAttribution()) : "",
legendLayers: this._getLegendLayers(),
titleText: hasTitleText ? form.title : "",
customTextElements: cteArray,
scalebarUnit: this.layoutForm.scalebarUnit
};
var cTextElements = [];
var gra = this.map.infoWindow.getSelectedFeature();
var obj1 = { val_ADDRESS: gra.attributes.ADDRESS };
cTextElements.push(obj1);
var obj2 = { val_NEIGHBORHOOD: gra.attributes.NEIGHBORHOOD };
cTextElements.push(obj2);
var obj3 = { val_POLLING_PLACE_ZIP: gra.attributes.POLLING_PLACE_ZIP };
cTextElements.push(obj3);
var obj3 = { val_ZONING: gra.attributes.ZONING };
cTextElements.push(obj3);
var obj4 = { val_ZONEDESC: gra.attributes.ZONEDESC };
cTextElements.push(obj4);
var obj5 = { val_SCHOOL_DIST: gra.attributes.SCHOOL_DIST };
cTextElements.push(obj5);
var obj6 = { val_ELEM_SCHOOL: gra.attributes.ELEM_SCHOOL };
cTextElements.push(obj6);
var obj7 = { val_MIDDLE_SCHOOL: gra.attributes.MIDDLE_SCHOOL };
cTextElements.push(obj7);
var obj8 = { val_HIGH_SCHOOL: gra.attributes.HIGH_SCHOOL };
cTextElements.push(obj8);
var obj9 = { val_FEMA_FLDZN: gra.attributes.FEMA_FLDZN };
cTextElements.push(obj9);
var obj10 = { val_PARK_COUNT: gra.attributes.PARK_COUNT };
cTextElements.push(obj10);
var obj11 = { val_NEAREST_PARK: gra.attributes.NEAREST_PARK };
cTextElements.push(obj11);
var obj12 = { val_ELECTION_DISTRICT: gra.attributes.ELECTION_DISTRICT };
cTextElements.push(obj12);
var obj13 = { val_POLLING_PLACE: gra.attributes.POLLING_PLACE };
cTextElements.push(obj13);
var obj14 = { val_POLLING_PLACE_ADD: gra.attributes.POLLING_PLACE_ADD };
cTextElements.push(obj14);
var obj15 = { val_RECYCLEDAY: gra.attributes.RECYCLEDAY };
cTextElements.push(obj15);
var obj16 = { val_ELEC_COMP: gra.attributes.ELEC_COMP };
cTextElements.push(obj16);
var obj17 = { val_ELEC_LINK: gra.attributes.ELEC_LINK };
cTextElements.push(obj17);
var obj18 = { val_MNSENATE: gra.attributes.MNSENATE };
cTextElements.push(obj18);
var obj19 = { val_MNHOUSE: gra.attributes.MNHOUSE };
cTextElements.push(obj19);
var obj20 = { val_CP_OFFICER: gra.attributes.CP_OFFICER };
cTextElements.push(obj20);
var obj21 = { val_MAYOR: gra.attributes.MAYOR };
cTextElements.push(obj21);
var obj22 = { val_COUNCIL1: gra.attributes.COUNCIL1 };
cTextElements.push(obj22);
var obj23 = { val_COUNCIL2: gra.attributes.COUNCIL2 };
cTextElements.push(obj23);
var obj24 = { val_COUNCIL3: gra.attributes.COUNCIL3 };
cTextElements.push(obj24);
var obj25 = { val_COUNCIL4: gra.attributes.COUNCIL4 };
cTextElements.push(obj25);
var obj26 = { val_CITYCLEANUP: gra.attributes.CITYCLEANUP };
cTextElements.push(obj26);
var obj27 = { val_GAS_COMP: gra.attributes.GAS_COMP };
cTextElements.push(obj27);
var obj28 = { val_GAS_LINK: gra.attributes.GAS_LINK };
cTextElements.push(obj28);
var obj29 = { val_ASSESS_PHOTO: gra.attributes.ASSESS_PHOTO };
cTextElements.push(obj29);
var obj30 = { val_BUS_ROUTE: gra.attributes.BUS_ROUTE };
cTextElements.push(obj30);
var obj31 = { val_UTILITYBILLING: gra.attributes.UTILITYBILLING };
cTextElements.push(obj31);
var obj32 = { val_FEMA_FLDZN_DESC: gra.attributes.FEMA_FLDZN_DESC };
cTextElements.push(obj32);
template.layoutOptions.customTextElements = cTextElements;
this.printparams.template = template;
this.printparams.extraParameters = {
printFlag: true
};
this.printparams.outSpatialReference = undefined;
var outWkid = +this.wkidInput.get('value');
if (srUtils.isValidWkid(outWkid) && outWkid !== this.map.spatialReference.wkid) {
this.printparams.outSpatialReference = new SpatialReference(outWkid);
}
var fileHandel = this.printTask.execute(this.printparams);
var result = new printResultDijit({
count: this.count.toString(),
icon: (form.format === "PDF") ? this.pdfIcon : this.imageIcon,
docName: form.title,
title: form.format + ', ' + form.layout,
fileHandle: fileHandel,
nls: this.nls
}).placeAt(this.printResultsNode, 'last');
result.startup();
domStyle.set(this.clearActionBarNode, 'display', 'block');
this.count++;
} else {
this.printSettingsFormDijit.validate();
}
}.bind(this, 1000);
},