Select to view content in your preferred language

Print Widget EB 1.9.0

17240
63
05-17-2021 01:51 PM

Print Widget EB 1.9.0

All,

   Here is my Print widget for all of you to use.

What's new in version 1.9.0: 

  1. Updated to work with EB 1.9

Note: This is for EB 1.9.0 or higher (not backward compatible).

Live Preview Site

To install this widget extract the contents of the zip file to your EB\client\your-extensions\widgets. So once you extract the whole path would look like: \client\your-extensions\widgets\print. Refresh your client and server windows (easiest way is to close both and 'npm start' them like you normally do to start EB). Next open the config.json and make your edits. Now the print widget will appear in your apps widget menu. Add the widget to your app. Now use the widgets settings panel to configure the widget.

 

Enjoy, Robert

Tags (1)
Attachments
Comments
AndyWells
Occasional Contributor II

Robert,

Thank you for providing this widget. I expect it will be used quite often. I was able to install it, and it works like it should up until I click "Print" and the file displays in the "Printed files" section. Afterwards, the file is grayed out, and hovering over it reveals "An error occurred while exporting the web map." I have tried this using your default config.json settings. I have also tried using "https://utility.arcgisonline.com/arcgis/rest/services/Utilities/...." I even tried it with no server listed, like it was in the last WAB print widget config. I am just trying to print using the default ArcGIS Online print service. I don't see any errors in the development console or anything like that. Any advice would be greatly appreciated. 

RobertScheitlin__GISP
MVP Emeritus

@AndyWells the url would be "https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%.... Do you not have your own print server (no Portal or ArcGIS Server)?

 

AndyWells
Occasional Contributor II

No, we do not have a print server (wish we did.) We are just trying to use the ArcGIS Online print service. I had that tried that same URL, and I have just now tried copying the one out of your reply, just in case I did it wrong, but it is still not working. The widget seems to find the list of Layouts and Formats ok, so it seems like it is at least finding the AGO print service, but it keeps giving me the error "An error occurred while exporting the web map."

RobertScheitlin__GISP
MVP Emeritus

@AndyWells 

Does your webmap contain any secured layers? Have you tried with a different webmap in your app?

AndyWells
Occasional Contributor II

@RobertScheitlin__GISP There was only one publicly shared layer, and an ESRI background. But I also tried it with a different map, with the same results. And I am using version 1.4. I've tried it in the live view in Experience Builder, as well as the preview tab. The PDF title appears almost instantly, and as soon as it does, you can hover over it and see the error message.

AndyWells_0-1621963322064.png

 

RobertScheitlin__GISP
MVP Emeritus

@AndyWells 

Can you share the webmap id or the public layer id or url from me to test?

Also do you see any errors in the browser console?

AndyWells
Occasional Contributor II

The webmap id is 

id=24c7783cf439413bad50f3816680b9f8

 

The only layer in it is

id=2cec89e3452d43f6ab5bb324f83545a5

 

I have not seen any errors in the browser dev console when clicking the widget, or the print button in the widget. I appreciate all your help.

RobertScheitlin__GISP
MVP Emeritus

@AndyWells  OK it seems that you might have missed one of the most basic steps of setting up widgets that deal with a map. That is to set the map that the widget will interact with in the setting of the widget after you have added it to your app. In the right panel of EB once you click on the print widget you will see where you can specify the map widget that the print widget will use. This is something you need to get use to as EB can have one or more maps in an app.

AndyWells
Occasional Contributor II

@RobertScheitlin__GISP 

Yes! That was it. Thank you for setting me straight. I'm new with using Experience Builder and have to get used to the fact that there can be multiple, or no, maps. I really appreciate you helping me out. Thanks.

Kishore
Occasional Contributor

@RobertScheitlin__GISP 

Can we use secured service and configure the proxy URL? 

Do we need to configure any options for printing the secured service from the same portal?

RobertScheitlin__GISP
MVP Emeritus

@Kishore 

There is no proxy url in EB like there was in WAB. The support for the esri proxy is going away. See my response to your other thread for more details.

HeatherBell
Occasional Contributor

Hi @RobertScheitlin__GISP , this looks like a useful widget - do I need to use it in the developer version, or will it work in standard the Experience Builder app? Thank you. 

DanMallett
Esri Contributor
HeatherBell
Occasional Contributor

Okay, thank you @DanMallett . Hopefully it will come soon. 

DavidColey
Frequent Contributor

Hi Robert - thought I'd let you know I plugged in the widget into dev 1.7.  Seems to still work well, only there is a strange behavior with clustered point layers, in that if a point layer is clustered, the base map will not print out completely under the cluster:

DavidColey_0-1642714554976.png

 

My deployment thus far:

https://ags3.scgov.net/gisdataexp/

 

RobertScheitlin__GISP
MVP Emeritus

@DavidColey 

Unfortunately that seems to be a print service issue and not a widget issue. Which print service url are you using?

DavidColey
Frequent Contributor

Thanks @RobertScheitlin__GISP . After testing, I would agree this is likely a print service issue that began some time ago with certain basemaps in the WAB.

The default print services are continuing to not handle the vector tile basemaps with any consistency.

I initially used the default service in your config from sample server 6, changed it again to the default arcgisonline utility print service, and finally my own federated servers' print service at 10.9.1.  All produced not-good-results; some better, some worse depending on the basemap . . . 

These samples are about the best I can get with my own print service and my own vector tile basemap:

parcelOutputMap.jpg

facilityOutputMap.jpg

cw_mund
New Contributor II

@RobertScheitlin__GISP I was wondering if there might be anyway to specify the scale to print from? It's been a request from on of my users? I know it's available in WAB, but I was hoping there might be a way to do this through ExB.

RobertScheitlin__GISP
MVP Emeritus

@cw_mund 

I will look at adding this enhancement to the next release.

JorgeKappa
Occasional Contributor

I followed the recipe to the letter, the Print widget shows, but it won't add. What could be wrong? 

JorgeKappa_0-1649867771095.png

 

RobertScheitlin__GISP
MVP Emeritus

@JorgeKappa 

Are there any errors in the web-console? What version of EB are you using?

JorgeKappa
Occasional Contributor

Hey, Robert. Yes, this one: 

JorgeKappa_0-1649869840406.png

I'm on "exbVersion": "1.7.0"

Sounded a little drastic, but I'm running npm audit fix --force on both.

Update: the server is clean, but the client was an error fest. I'm restarting from scratch now.

Update 2: I reinstalled everything. Does it matter if you do the patch first or second to installing the widget?

Anyway, I did it both ways, but this keeps coming back:

JorgeKappa_0-1649875004941.png

It does get a little weird while installing the patch here:

JorgeKappa_1-1649875083112.png

but then he only specifies the client in the EB install folder once, so I assumed that the rest of the of the time he mentions the client folder in the patch folder. In the end though, I don't have a server folder in the patch folder so I suppose he's talking about the EB install folder.

In any case, everything looks good, except the widget doesn't add on.

RobertScheitlin__GISP
MVP Emeritus

@JorgeKappa 

The patch is for 1.6 only you are at 1.7 so it is unnecessary. Could be causing you an issue. I would start with a clean 1.7 install and try again. Also just to be sure we are not miscommunicating. The browsers web console is different then the Command window that you are showing in your attachments above. Once you do your clean install and try and add the print widget check your browsers web console for any errors.

JorgeKappa
Occasional Contributor

Got it. Now it adds, but I'm getting this:

JorgeKappa_0-1649943047639.png

 

RobertScheitlin__GISP
MVP Emeritus

perfect so the fact that you now see the widget placeholder (the little printer icon), that tells me that you have not set the widgets map that it will using in the widgets settings pane.

JorgeKappa
Occasional Contributor

Works tip top! Thank you Robert. I can't kudos or mark as solution, it's grayed out.

JorgeKappa_0-1649943587637.png

 

RobertScheitlin__GISP
MVP Emeritus

@JorgeKappa those options (mark as solution, etc) are only available if you start a new question yourself. Here you are just commenting on a document I posted.

JorgeKappa
Occasional Contributor

Good work, Robert. The product is outstanding for its helpfulness. 

Last question, and I don't mean to hijack your thread, but when I publish my experiences, they don't go to my Organization's AGOL. I am logged in. So a) Where do they go? and b) How do I get them to the AGOL?

RobertScheitlin__GISP
MVP Emeritus

@JorgeKappa When working with EB Developer the experiences are local (not published to AGOL). There will never be a way to get a EB project that uses a custom widget like this uploaded to AGOL. Soon there will be a way to get custom widgets in ArcGIS enterprise (Portal). Like you are to in WAB with custom widgets. You only option is to publish and then download your EB developer app and then host the app on your own  web server. If that is not an option for you then you will have to wait for the next version of EB that is projected to include a print widget OTB.

Ming
by
Occasional Contributor

Hello @RobertScheitlin__GISP , thank you very much for your excellent print widget, it works well for map with layers and legend.

With Experience Builder 1.6, d3 and react-data-grid, I created some react component like charts and tables.

Is is possible to print out those charts and tables below the map?

Any idea is appreciated.

RobertScheitlin__GISP
MVP Emeritus

@Ming This Print widget is designed to just print the Map. So adding charts and tables is not possible with this widget.

Ming
by
Occasional Contributor

@RobertScheitlin__GISP Got it, thanks for the response.

SerjStol
Occasional Contributor

@RobertScheitlin__GISP thank you for the widget! Strange that ExB still doesn't have one since its a core functionality for most customers. We require scales to be selected in the widget just like the WAB one, I was thinking to migrate the WAB code to combine with your Print widget, but could be challenging.

RobertScheitlin__GISP
MVP Emeritus

@cw_mund , @SerjStol 

Scale specific printing is now available.

WalterSimonazzi_VicPol
New Contributor III

Thanks heaps Robert. 

Just a comment to the Experience Builder product managers. It's a bit sad and surrprising that the community need to wait for a retired esri user to developed a tool that should be in the Experiecne Builder since v1.0.

Likewise with the group layers funcitonality in WebApp Builder... I really can't understand why. 

 

AxelLévy
New Contributor III

Thank you Robert.

 

Totally agree with Walter. This is obviously an essential widget. ESRI focus on useless "new" widgets.

RodWoodfordOld
Occasional Contributor III

Yep totally agree Walter. Robert keep up the good work hopefully ESRI will start to implement some of the fundamentals in your widgets. The eSearch widget should be a no brainer for ESRI to look at.

cheers

Rod

Jianxia
Esri Regular Contributor

@WalterSimonazzi_VicPol , @AxelLEVY ,  @RodWoodfordOld , Thanks for sharing your thoughts with us. Understand your frustration on the Print widget and will share your comments with the team.

Like Web AppBuilder, It is a collaborative effort across multiple teams to add widgets into Experience Builder, therefore some of the new widgets may not be the core widgets you would expect due to development resources.

Currently the Print widget is planned for the upcoming June update. Per the feedback on the Print widget in Web AppBuilder, the new design pulls those advanced options into the setting other than the runtime while highlighting the printing area - one of the highly asked enhancements.

Thank @RobertScheitlin__GISP for his great work as always! 

SerjStol
Occasional Contributor

@RobertScheitlin__GISP wow, thanks, I will check it out! 

ZhujingXia
Occasional Contributor II

@RobertScheitlin__GISP 

I am ne to EB, this is my first time to add the custom widget into EB 1.7 developer edition. I followed your instruction, copy past the extracted print folder to EB\client\your-extensions\widgets. After that i did the steps for  nmp like i normally do to start my EB.

But the print widget is not avaliable in EB.  Could you help?

Thanks

Zhuijng

RobertScheitlin__GISP
MVP Emeritus

@ZhujingXia  Strange. What version of EB developer are you using? I have tested up to 1.8. Also you have to have be attempting to add the widget to a controller in EB and then the print widget will appear in the custom section of widgets (in 1.8)

Ming
by
Occasional Contributor

Hi @ZhujingXia 

With VS Code, please make sure the print folder is under folder "your-extensions/widgets", then with EX Builder make sure it opens the project that has the print folder, in case you have more than one EX projects.

FYI:

Ming_0-1655300729660.png

 

Ming_2-1655300983019.png

 

 

ZhujingXia
Occasional Contributor II

Thank you all, I installed the new version of node.js , it worked after that.

 

 

Ming
by
Occasional Contributor

Here is my experience about label print, hope it can help who has same problem.

If the layer label is generated on fly like this: 

$feature["label_no"] + " - " + $feature["facility_name_location"]

Then by default this print widget can't print the label out in pdf. Solution is to set forceFeatureAttributes of print templae as true then it works well, like this:

AndreV
by
Occasional Contributor

Hi @Jianxia

your wrote there will be a June Update, where those advanced options in print widget will be included in EB AGOL version. Can you give us a date for this update? Or did I misunderstand something?

Andre

SerjStol
Occasional Contributor

@RobertScheitlin__GISP testing this on the new 1.9 Dev edition and it does not work anymore for me. I am getting error on the PrintTask, but its not deprecated so not sure whats going on. Also watchUtils are now deprecated, but should work.

SerjStol_0-1658482837863.png

 

SerjStol_1-1658482924665.png

 

Edit: I know the new Print widget came out but it has a bug for me where the "customTextElement" is not displayed properly, it displays it in one long line, overruling the print template where its word wrapped, configuration while this custom print widget works perfectly...

Edit 2: ok, i've just read the release blog and support for esri/tasks has been removed since JS 4.24 so that makes sense... https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/rest-is-up-to-the-task/

 

RobertScheitlin__GISP
MVP Emeritus

@SerjStol my print widget has not been updated to WAB 1.9 yet.

Jianxia
Esri Regular Contributor

@SerjStol can you share the screenshot of the "customTextElement" bug or printing service with us? @ShengdiZhang 

SerjStol
Occasional Contributor

@Jianxia I have made a post about this which has screenshots, not sure if I've posted in the right "forum" - ExB Developer Edition 1.9 Print Widget customTextE... - Esri Community

Jianxia
Esri Regular Contributor

Great! Thanks @SerjStol.

Version history
Last update:
‎11-17-2022 08:13 AM
Updated by: