Printing using a custom template

6791
11
11-01-2017 03:25 AM
MarcHoogerwerf
Occasional Contributor

I'm trying to print a survey using a custom template. After configuring the template and saving it, it appears under the Custom Print (Beta) section. However, when clicking the Print icon, it turns into a spinning arrows but nothing happens, even after 10minutes, it's still spinning.

So as a next step, I've downloaded the default template, saved it on disk, and without changing anything in the file, uploaded it again. Same thing happens after clicking the print icon.

Am I doing something wrong?

0 Kudos
11 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Marc,

A couple of questions:

1) What browser are you using?  Currently, the print template functionality runs in the browser.

2) In the template file, it looks like you a repeated section (called 'attachments').  Is that in a group, or is there otherwise a sequence of groups/repeats inside each other?  Currently, the template processor doesn't support nested groups/repeats.

0 Kudos
MarcHoogerwerf
Occasional Contributor

I've tested this in Safari and Chrome on OS X, and in Chrome on Windows 7

It's a single repeats section, see attachments

I can see the following requests (I removed the token part to keep it readable) being fired off, retrieving the photos from the attachments table and the features from layer 0 (this one is executed twice). These seem to execute OK, but then everything goes silent.

https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task/execute?f=json&Web_Map_as_JSON={"mapOptions":{"showAttribution":true,"extent":{"xmin":1073228.0729566894,"ymin":4257022.937526825,"xmax":3421373.5818766793,"ymax":5626774.48439682,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":18489297.737236},"operationalLayers":[{"id":"layer2","title":"layer2","opacity":1,"minScale":591657527.591555,"maxScale":70.5310735,"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"},{"id":"map796615_graphics","opacity":1,"minScale":0,"maxScale":0,"featureCollection":{"layers":[{"layerDefinition":{"name":"pointLayer","geometryType":"esriGeometryPoint"},"featureSet":{"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":20.187846812828894,"y":40.520691087175045,"spatialReference":{"wkid":4326,"latestWkid":4326}},"symbol":{"angle":0,"xoffset":0,"yoffset":0,"type":"esriPMS","url":"https://survey123.arcgis.com/assets/img/survey-data/Location.png","width":18.75,"height":36.75}}]}}]}}],"exportOptions":{"outputSize":[460,280],"dpi":96}}&Format=JPG&Layout_Template=MAP_ONLY
https://services2.arcgis.com/D5Q9p2c0OJOw3foO/arcgis/rest/services/service_ec9e8fb00dc94f58ad0b34caf...
https://services2.arcgis.com/D5Q9p2c0OJOw3foO/arcgis/rest/services/service_ec9e8fb00dc94f58ad0b34caf...
https://services2.arcgis.com/D5Q9p2c0OJOw3foO/arcgis/rest/services/service_ec9e8fb00dc94f58ad0b34caf...
https://services2.arcgis.com/D5Q9p2c0OJOw3foO/arcgis/rest/services/service_ec9e8fb00dc94f58ad0b34caf...
https://services2.arcgis.com/D5Q9p2c0OJOw3foO/arcgis/rest/services/service_ec9e8fb00dc94f58ad0b34caf...{"xmin":2245414.1434902363,"ymin":4940889.5079574175,"xmax":2247860.1283954233,"ymax":4943335.492862606,"spatialReference":{"wkid":102100,"latestWkid":3857}}&geometryType=esriGeometryEnvelope&inSR=102100&outFields=*&outSR=102100&resultType=tile&token=
https://services2.arcgis.com/D5Q9p2c0OJOw3foO/arcgis/rest/services/service_ec9e8fb00dc94f58ad0b34caf...{"xmin":2245414.143499423,"ymin":4940889.507951193,"xmax":2247860.1284046136,"ymax":4943335.492856383,"spatialReference":{"wkid":102100,"latestWkid":3857}}&geometryType=esriGeometryEnvelope&inSR=102100&outFields=*&outSR=102100&resultType=tile&token=

0 Kudos
MarcHoogerwerf
Occasional Contributor

Hi James,

I did another test. I created another survey based on the same feature service that I used for my original survey. However, now I removed the repeats section (for the attachments related table), created my template and now it works.

Then I added the repeats section, published my survey again. I ran it with the same template (that doesn't have any references to the related photos) and the report still worked. Then I updated my template to include the attached photos, and I'm stuck again. No printout.

So it seems that it's not just repeats within groups as you mentioned, but also single repeats sections, that seems to cause the issue.

NickDierks
New Contributor III

Marc, have you tried uploading other templates? Or have you tried the attached template in another survey?

I'm having the same issue right now, and I noticed that it seems to be the survey that's causing the problem, not the template. The same template in another survey works just fine, and templates that have worked for other surveys still hang indefinitely for my one problem survey.

0 Kudos
MarcHoogerwerf
Occasional Contributor

I've also tried it with the default template. Same result

I've recreated the survey and tried again with a default template for that survey. Same result.

Also tried with IE11 this time. No change.

0 Kudos
NickDierks
New Contributor III

Ok, so just I got mine to work!

I tested my template on several other surveys, and found more that wouldn't work. One thing I found in common was each one that didn't work had image questions within a group. I also noticed your image question was within a repeat, so, close enough.

I tried creating a new survey from the existing one and this time removing that group, but it didn't work. However, after recreating it from scratch (images no longer in a group), I could finally use a custom print template successfully! I used ArcGIS Pro to append the existing feature service to the new one, and now I can print all my records.

It's probably worth testing to see if recreating a survey with images still in a group/repeat would work or not. Maybe that's the cause, or maybe it was just a coincidence. If I lose the ability to print to a template again, I'll be sure to update here with any changes I made in the meantime. For now, though, I suggest recreating your survey from scratch, and finding a way to somehow recreate the multiple-image functionality you want without putting them in a repeat or group.

0 Kudos
NickDierks
New Contributor III

One more update: after I tweaked the new survey's settings, description, etc. to match the original survey, custom print templates stopped working again. I removed the custom .tpk I had added to the survey's media folder and republished, and it worked again. Make of that what you will; I'm not sure if that applies to your situation at all.

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi Marc,

After downloading your XLSFrom and creating a subsequent survey and Custom Form Report Template, I was able to submit surveys and print them without issue.  In my testing, I was using the Survey123 Windows field app on my desktop computer and added photos to the attachments from the same computer.

I wanted to ask you for more information related to your collecting environment and ask you to explain the method which you are using to upload photos during collection (i.e. navigating to photos on device or taking pictures within the app).  I have attached a print result to this response which demonstrates my success with using your uploaded XLSForm and Custom Form Report Template.

MarcHoogerwerf
Occasional Contributor

Hi Brandon,

I create a new survey, taking my original survey as a template and deleting the submission url, so a new feature service would be created. I came to what is shown in HSE Visit 2_Report.docx. Which seemed pretty much ok.

Then I wanted to add long and lat underneath the map using ${geometry | getValue:"x"} and ${geometry | getValue:"y"} , but then the report generation got stuck again (progress icon kept spinning).

So I deleted the lat / lon section and tried again. However, this time my original report without the lat/lon didn't work anymore.

Then I noticed something else: Whenever I upload a new template, it seems to save that template, but when I start the edit process again, it shows the name of the previous template, see attached Edit_* images. I'm not sure ifr any of this is related to the issues I'm having, but I found it peculiar.

So it seems that creating a new survey with a newly associated feature service works, until the moment you get stuck. 

0 Kudos