Changing Page Orientation Based on Image Orientation in Survey123 Report Templates

1051
1
Jump to solution
10-15-2019 09:05 AM
BenjaminZandarski
New Contributor II

I am having some issues with the latest update to survey123 report template. I worked very hard getting a report template to print photos that were taken in landscape to fill the page with landscape orientation and photos taken in portrait to fill the page with portrait orientation with metadata for each photo attached. I have attached the template below. This took a lot of trial and error to get working. It worked fine with the desired results during beta and even into the initial release. With the latest release the ability to bypass saving reports to an account was removed. Now the template says it cannot render images. The template searches for and displays all landscape images on a page with landscape orientation. Then I inserted a section break and ran a similar code but only displaying photos that are portrait on a page with portrait orientation 

${#photoLogBegin} ${if ((photo|getValue:"width")>2448)} ${photo|size:980:0}
Site: ${siteNumber} | Project: ${projectNumber} | Image: ${imageNumber} | Aspect: ${bearing} | Tilt: ${tilt} | Photo By: ${photographer} |${dateSubmited} | ${shotTime} | ${photoPoint|getValue:”x”} ${photoPoint|getValue:”y”}
${photoDescription} ${/} ${/photoLogBegin}

 

A section break is inserted here and the orientation is changed

 

${#photoLogBegin} ${if ((photo|getValue:"width")<3263)} ${photo|size:720:0}
Site: ${siteNumber} | Project: ${projectNumber} | Image#: ${imageNumber} | Aspect: ${bearing} | Tilt: ${tilt} | PhotoBy: ${photographer} |${dateSubmited}   ${shotTime} | ${photoPoint|getValue:”x”} ${photoPoint|getValue:”y”}
${photoDescription} ${/} ${/photoLogBegin}

Just curious if anyone has had any success manipulating images this way. Also in the past I've had to use a lot of experimentation. Now that the reports come at a cost it seems like any experimentation with report templates also comes at a cost? Has anyone found a way to test report templates without incurring a cost? 

0 Kudos
1 Solution

Accepted Solutions
BenjaminZandarski
New Contributor II

I was able to fix it. Basically doing the exact same thing only reversing the order of the portrait and landscape. I may have simply had a syntax error and rewriting the code caught the error not sure. Anyway if you have a photo log and want to show all landscape photos on a landscape page and portrait photos on a portrait page filling the entire page with the image and have a small amount of room at the bottom for photo attributes I have attached my form and report templates.

View solution in original post

0 Kudos
1 Reply
BenjaminZandarski
New Contributor II

I was able to fix it. Basically doing the exact same thing only reversing the order of the portrait and landscape. I may have simply had a syntax error and rewriting the code caught the error not sure. Anyway if you have a photo log and want to show all landscape photos on a landscape page and portrait photos on a portrait page filling the entire page with the image and have a small amount of room at the bottom for photo attributes I have attached my form and report templates.

0 Kudos