Select to view content in your preferred language

Web AppBuilder Print widget and Layers

7216
18
04-28-2016 07:42 AM
FlorianCADOZ
Occasional Contributor

Hi everyone,

I've got a problem with the print widget ! When I try to "print" a pdf (or something else) the graphicLayers are shown but not the Layers...

When I use a proxy, layer are just forgotten, and when i tried without, i get an error (screen joined)

I really have no idea how to do ...

Thank you in advance

Tags (1)
0 Kudos
18 Replies
FlorianCADOZ
Occasional Contributor

Hi everyone and thank you for your answers but :

- I -

I tried with the sample print service and I had the same problem that I had with the first arcgis service that was configured ! (see attached image below)1_map_to_print.png

2_map_printed.png

- II -

After I tried with my own print service located on my server but it doesn't work to ...

3_trying_with_my_own_print_service.png

And in the console, I've got that message :

4_error_when_trying_with_my_own_print_service.png

Can you confirm me that the only thing I've to do is to set the url of the print service in the config.json of my print widget like that ?

{
  "serviceURL": "https://urlOfMyServer:portUsed/arcgis/rest/services/Utilities/PrintingTools/GPServer",
  "defaultTitle": "ArcGIS Web Map",
  "defaultAuthor": "Web AppBuilder for ArcGIS",
  "defaultCopyright": "",
  "defaultFormat": "PDF",
  "defaultLayout": "Letter ANSI A Landscape"
}

Thank you by advance for your answer !

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Florian,

  You set the print widgets url in the Settings UI for the print widget (no need to edit json manually). Your print server url should look like this:

protocol://urlOfMyServer/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task

You would use the port number in the above url if you do not have ArcGIS Web Adaptor installed (not sure why you would not though).

FlorianCADOZ
Occasional Contributor

Robert,

Oh ! I forgot the "Export Web Map Task" in the end of the URL...

But the problem seems to be elsewhere ! In fact, the print widget works fine but only when I ask him to export a small number of elements ...

Is there a way around this limitation, or is it that it is required for ArcGIS Server and there is nothing to do there?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Florian,

   The whole purpose of using the proxy is to get past that limit  as Rebecca was mentioning. So are you testing on a deployed WAB app (meaning you have deployed it to your web server)? If so then did you add the proxy url to your apps main config.json?

0 Kudos
FlorianCADOZ
Occasional Contributor

Hello Robert,

Yes, I'm developping on WAB DE and i deployed an app on my own server but for the part of the proxy, I didn't do anything by myself. It's a colleague which done this job and after I didn't config the proxy's parameters in the main config.json...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Florian,

So make sure that you have added the proxy url to the main config.json for your app then.

0 Kudos
BarnabyRockwell
Regular Contributor

Robert and Rebecca,

I think that I am having the same problem with printing from a WAB Dev 1.3 app.  Perhaps you could help.  My setup:

  • Public-facing IIS server (behind enterprise reverse proxy), url = http://public.gov
  • ArcGIS for Server 10.4 + Web Adaptor are running on it. No Portal.
  • This machine has another name on our internal network, I will use http://intserver.xx.xxy.net.
  • The Web Adaptor is configured thus: http://intserver.xx.xxy.net:6080.
  • Given what was written in this thread, I set up a local proxy on web site:  /prox/proxy.ashx
  • In config.json of WAB app, I entered:

"httpProxy":{"useProxy":true,"alwaysUseProxy":false,"url":"/prox/","rules":[{

        "urlPrefix": "http://public.gov/arcgis/rest/services/Utilities/PrintingTools/",   ****I tried many things for this, to no avail******

        "proxyUrl": "/prox/proxy.ashx"

    }]},

  • config_Print.json in my app:

{

  "serviceURL": "http://public.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",

  "defaultTitle": "ArcGIS Web Map",

  "defaultAuthor": "blah blah",

  "defaultCopyright": "",

  "defaultFormat": "PDF",

  "defaultLayout": "Letter ANSI A Landscape"

}

  • My /prox/proxy.config.  I also tried an "empty" one as Rebecca suggested, but that didn't work, either.

<?xml version="1.0" encoding="utf-8" ?>

<ProxyConfig allowedReferers="*"

            mustMatch="false">   *****also tried true here - didn't work*******

    <serverUrls>

        <serverUrl url="http://services.arcgisonline.com"

                  matchAll="true"/>

        <serverUrl url="http://public.gov"   *****I also tried the entire serviceURL from the config_Print.json shown above - didn't work******

                  matchAll="true"/>

        <serverUrl url="http://myorg.maps.arcgis.com"

                  matchAll="true"/>

        <serverUrl url="http://utility.arcgisonline.com"

                  matchAll="true"/>

        <serverUrl url="http://intserver"

                  matchAll="true"/>

    </serverUrls>

</ProxyConfig>

What am I doing wrong?    Even without a proxy set up, I get an error like Florian did, "Unable to load" the long print url, which is about ~1800 characters long.  I wonder if my problem is related to the enterprise reverse proxy, which could be blocking requests......  I have no idea.

Thanks in advance,

Barnaby

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Barnaby,

  I do not have a specific rule setup in my main config.json for the print service. Mine just looks like this:

"httpProxy": {
    "useProxy": true,
    "alwaysUseProxy": false,
    "url": "/WAB/Proxy/proxy.ashx",
    "rules": []
  }
BarnabyRockwell
Regular Contributor

Ok, thanks, Robert.  I'll try that.  I've also contacted our reverse proxy security people to see if the print command is being blocked by them....

Cheers,

Barnaby

P.S.:  With your suggestion, and the removal of a security blockage by reverse proxy people, the printing works perfectly now!  🙂

0 Kudos