Select to view content in your preferred language

AGOL Notebook crashing when creating PDF

1979
8
Jump to solution
02-18-2022 02:04 PM
LisaT
by
Occasional Contributor III

I am following this tutorial: https://www.esriuk.com/en-gb/news/we-talk-tech/printing-custom-layouts-from-arcgis-online.  My goal is to print an AGOL map with a custom template. We do not have Enterprise, only an Organizational AGOL account.  When going through the tutorial, everything appears to be working well: the code finds the APX and the layout, finds the title of the layout, etc.  However, as soon as I try to use the "exportToPDF" function I get a wine error and the kernal dies.  I am not new to programming, but am new to Notebooks and have not done a lot of Python (although I have used "exportToPDF in the past).  Am I missing an import or something?

0 Kudos
2 Solutions

Accepted Solutions
PhilipThompson11
New Contributor II

Hi Lisa, there was a bug introduced to runtime 5 which is causing this crash. Unfortunately you can no longer change the runtime version through the Notebook UI. However, you can use AGO Assistant to make that change. 
https://assistant.esri-ps.com/

When you then open the Notebook you should be able to verify that it runs under runtime 4 and the kernel won’t crash.

Hope that helps.

Philip

View solution in original post

0 Kudos
PhilipThompson11
New Contributor II

Hi Lisa, 

Click View Item JSON. Then you should be able to edit the json and the runtime version from there.

json.JPG

View solution in original post

0 Kudos
8 Replies
PhilipThompson11
New Contributor II

Hi Lisa, there was a bug introduced to runtime 5 which is causing this crash. Unfortunately you can no longer change the runtime version through the Notebook UI. However, you can use AGO Assistant to make that change. 
https://assistant.esri-ps.com/

When you then open the Notebook you should be able to verify that it runs under runtime 4 and the kernel won’t crash.

Hope that helps.

Philip

0 Kudos
LisaT
by
Occasional Contributor III

Thank you for replying so quickly! I am really hoping to get this working. I have not used the Assistant and cannot figure out how to change the runtime. When I click on the link you have above and I sign in, I can see my notebook. However, when I click on it the item details show but I only see the options to "View Item JSON", "View Item Resources", "Copy Item", and "Open in ArcGIS Online" (see attached screenshot).  I can't seem to open the Notebook in the assistant?  If I choose to open in AGOL, it takes a long time to redirect and open but, indeed, opens directly in AGOL with all of the same selections that AGOL has (It looks like I am running Python 3 for advanced 6).  I do not see anywhere to change the runtime.  Can you help me to find it?   Im not sure if it matters, but the notebook is not currently shared.

0 Kudos
PhilipThompson11
New Contributor II

Hi Lisa, 

Click View Item JSON. Then you should be able to edit the json and the runtime version from there.

json.JPG

0 Kudos
RaviNarayanan
Esri Contributor

Hello @PhilipThompson11 @LisaT 

You should be able to change the runtime associated with a notebook from the Notebook items settings pages. Not sure if this option worked?

 

https://doc.arcgis.com/en/arcgis-online/create-maps/specify-the-runtime-of-a-notebook.htm#ESRI_SECTI...

@LisaT Hopefully you were able to get past the issue with exporting a PDF. 

 

Screen Shot 2022-04-28 at 12.49.15 PM.png

 

0 Kudos
PhilipThompson11
New Contributor II

Hi Ravi, The workaround is to change the runtime version, not the runtime type. The version can only be edited through AGO Assistant. The bug is still open.

0 Kudos
RaviNarayanan
Esri Contributor

Hi @PhilipThompson11 You should be seeing a dropdown like this - for selecting a runtime (type/version). Please let us know if this doesn't help. Will check out the exportToPDF use case.

 

Screen Shot 2022-04-28 at 12.48.30 PM.png

 

 

IanTeh
by
New Contributor II

Hi @PhilipThompson11  and @LisaT. I'm also trying to set up a custom template for my organization. I just started following the tutorial.

I know it is off topic with the original post but regarding creating feature templates for the feature service,. I'm curious to know how to create a feature template that creates a rectangle polygon with the point (primary geometry) as the centroid.

IanTeh_0-1702590978146.png


I'm playing around with managing templates - creating group templates - with point as the primary geometry and the only option when choosing a builder is a buffer (which creates circular buffer from the point).

IanTeh_1-1702590978487.png

I also posted the question here

I hope this reaches you both!

 




0 Kudos
PhilipThompson11
New Contributor II

Hi Ian, 

Sorry for not responding sooner. 

The red extents shown in the screenshot are a bit of smoke and mirrors in order to create a better presentation. The feature template is simply red dots - the centre of the extent. During the print process, I calculated what the extent of the map frame will be and placed them into a separate (polygon) feature layer. This was set to refresh and so gave a visual cue as to when the pdf had been picked up off the que and generated.

I spent some time messing round with CIMSymbols to achieve the effect you're looking for but it was a lot of effort and I couldn't get it to work.

0 Kudos