Error in printing Buffer with parcels highlighted in graphics layer

3311
7
Jump to solution
11-05-2013 11:59 AM
CarlosVulgamott
New Contributor
Good afternoon forum friends!

I was hoping someone could help us with a.   Our current software version is ArcGIS Server 10.1 and we are using the ESRI JavaScript 3.6 API.

We have two major issues 1) printing text symbol graphics when exporting a map and 2) we get an error in printing when we buffer a parcel and trying to print all the highlighting graphics layer to a map. 

1) Text Issue: When printing a map with graphic text symbols the graphic is not captured there for it will not display on the printed map.
We are not seeing any error issues it just appears that the graphic is not being captured. 

2) Buffering issue:  We get an error in printing when we buffer a parcel and trying to print all the highlighting graphics layer to a map. 
Error message:  JS ??? Error:
"Error executing tool.: Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Failed to execute (Export Web Map).
Failed to execute (Export Web Map Task)."




Print Task Snippet:
//CREATE PRINT TEMPLATE
    var template = new esri.tasks.PrintTemplate();
    template.exportOptions = {
        width: 530,
        height: 620,
        dpi: 96
    };
    template.format = "jpg"; // pdf | png32 | png8 | jpg | gif | eps | svg | svgz ;
    template.layout = "MAP_ONLY";
    template.preserveScale = true;
    template.showAttribution = false;

    //CREATE PRINT PARAMS
    var params = new esri.tasks.PrintParameters();
    params.map = pMap;
    params.template = template;

    //EXECUTE PRINT
    if (printTask) {
        printTask.execute(params, getMapImageForPDFResult, getMapImageForPDFError);
    }


JS ??? Error:
"Error executing tool.: Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Layer "map_graphics": Invalid r value in color: 0.
Failed to execute (Export Web Map).
Failed to execute (Export Web Map Task)."

[ATTACH=CONFIG]28882[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
StevenWhite
New Contributor
I see this is old but using the Javascript 3.9 API I get the same error message. I have one polygon and thats it. It renders on the map fine but get "Invalid r value in color: 0." when trying to print.

Actually. All it prints is the base map. The dynamic map service contents also render fine but don't show up in the PDF. the dynamic map service layer doesn't generate any errors though.

Of note. Zero is not an invalid red value.

Heh. As always. as soon as I post I fix it. Well. The error message anyway. If you pass something like "#ffffff" it will render ok but not print. For printing to work you need to use dojo.Color("#ffffff").

View solution in original post

7 Replies
JasonZou
Occasional Contributor III
Without code details, hard to tell what went wrong.

Due to some issues with the PrintTask, the best suggestion I can give to you is to save each type of graphics into a separate graphics layer. Basically, one layer for points, one layer for text graphics, one layer for lines and one for polygons. Refer to this thread for some details.
0 Kudos
StevenWhite
New Contributor
I see this is old but using the Javascript 3.9 API I get the same error message. I have one polygon and thats it. It renders on the map fine but get "Invalid r value in color: 0." when trying to print.

Actually. All it prints is the base map. The dynamic map service contents also render fine but don't show up in the PDF. the dynamic map service layer doesn't generate any errors though.

Of note. Zero is not an invalid red value.

Heh. As always. as soon as I post I fix it. Well. The error message anyway. If you pass something like "#ffffff" it will render ok but not print. For printing to work you need to use dojo.Color("#ffffff").
Kathleen_Crombez
Occasional Contributor III

Steven White​ seems to have the correct answer.

I had the same problem printing graphics layers (and feature layers) that had graphics assigned using RGB colors.

I wanted to use RGB so I could set an alpha value to the graphic.

As a work around I set the colors using hexadecimal color and just set an opacity value on the graphics layer and / or feature layer.

0 Kudos
BillFox
MVP Frequent Contributor

Thank you for posting this issue.

I just hit the same issue with Portal for ArcGIS 10.5

Do you know a fix for it?

0 Kudos
BillFox
MVP Frequent Contributor

I opened a case with ESRI support for this 10.5 issue.

0 Kudos
JasonHarshman
Occasional Contributor

Did you get a solution from Esri? I just ran into the same problem running Portal 10.5. 

0 Kudos
BillFox
MVP Frequent Contributor

Hi Jason,

[BUG-000104266 : Unable to Print when including graphical layer generated from Incident Analysis Widget in Portal 10.5 Web AppBuilder]

Hopefully it gets fixed in 10.5.1

-Bill

0 Kudos