Edit 'Run a Report' {{context}} in MapTipActions
Good Morning! I am having some serious issues with my reports being run from my Map Tip. When a facility is clicked in the map, the corresponding facility report that is run from the map tip does not match the original facility clicked, this is causing serious problems. I know the report link comes from the MapTipActions section in the Desktop.json...
{
"text": "@language-menu-run-report",
"description": "@language-menu-run-report-desc",
"command": "ListReports",
"commandParameter": "{{context}}",
"hideOnDisable": true
},
And
{{context}} is what is being passed to the report and this is of type - geocortex.essentialsHtmlViewer.mapping.infrastructure.Feature
What I'm wondering is how to edit the {{context}} portion of the map tip action. I need to pull a different unique id rather then the OID. Suggestions?
0
-
My guess is that just updating the {{context}} parameter in the viewer config won't work, plus that would change its settings for all layers.
I think the best workaround would be to remove the run reports link and replace it with a workflow link that you can run with the input field you want to use as its argument.0 -
My man John! Always coming through! Thanks so much for the suggestion, I think that is what we are going to need to do.
So I found the below thread where you provided a hyperlink to run a report from a workflow. Do you have an example of a workflow that runs a report that I could use as a starting point? Thanks so much again! I always learn so much from you!
https://support.geocortex.com/essentialsGSCForum?sub-nav=forum&main-nav=essentials&#!/feedtype=SINGLE_QUESTION_DETAIL&criteria=ALLQUESTIONS&id=9066000000009lpAAA0 -
Here are a couple of examples. In both cases, the link to put in your feature description or long description is:
<a href="command:RunWorkflowWithArguments?workflowId=ReportWorkflowId&id={yourField}">Run a report</a>
Here's a basic workflow to run a single report:
https://drive.google.com/open?id=0B_hHHiqcTKMfN25kZm1kbWtTYkk
Things to set:
1) your map service ID (variable)
2) your layer name (variable)
3) your report ID (variable)
4) your Report activity Where clause
5) your Report activity Output Format (if not pdf)
Here's an example of a workflow that lets you run multiple reports:
https://drive.google.com/open?id=0B_hHHiqcTKMfai1ic2lRZkFXcWM
Things to set:
1) your map service ID (variable)
2) your layer name (variable)
3) your report names and IDs in the display form combo box
4) your Report activity Where clause
5) your Report activity Output Format (if not pdf)0 -
THANK YOU JOHN! I used the first workflow to run a single report and it's working PERFECTLY! 0 -
John, I was trying to follow your instructions to run report by setting a link in the feature description section. But I am getting the following error: "There was a workflow error running activity: Cannot find report '0' ". I am not sure what I am missing, probably something simple in the workflow. Appreciate any help. Thank you. Nataliya 0 -
That error is coming up because the workflow can't find your report. Check your map layer and make sure you 1) added the report, and 2) what the report ID is.
If your report ID isn't 0, then you need to change the default value in your workflow.
0 -
I do have report added, and the id is '0'
0 -
The ID in the workflow should just be "0" with no single quotes, just the double quotes to define it as a string.
0 -
Yes, that is what I have. Thank you for your help.
0 -
Hmm, then I'm not sure what the issue is. Can you post your workflow here? 0 -
Nothing looks unusual about it. There are only a few other things I can think of to confirm:
- Turn debugging on for your Get Map Service Info activity to make sure you're getting the right output values for mapServiceUrl and layerId.
- Make sure the output format options on your report include pdf, like in the workflow.
- Add a Query Task activity and run your Where clause to make sure it's selecting a record successfully. You can add an alert activity with the text resultFeatureSet.Features.Count().ToString() to see how many records are getting returned.0 -
Is this a bug? Same thing happens here - run a report on a parcel and it intermittently creates a report for a COMPLETELY RANDOM other parcel!! This is really not okay. 0 -
Hi Bobbi, yeah that's not good. Did you use one of the workflow templates posted here, and if so which one?
Very weird that it's intermittently not working, if it's selecting a wrong parcel then the most likely culprit is the argument since it's what tells the workflow which feature to create a report for. Can you post your workflow here? That'll be the easiest way to troubleshoot.0 -
Sorry for the delayed response. It wasn't even my workflow - just the built-in functionality that accesses the reports attached to the layer. I removed the option to run a report from the map tip and have a button on my toolbar that runs a parcel report from there instead. The one from the workflow/button works just fine. I guess the difference is that the argument is not supplied on click, but rather is input by the user.
It still makes no sense and there was no rhyme or reason to the parcel that was selected - not the lowest or highest objectid or parcelid, wildly different geographical area, etc.
Here's an old, undeveloped scratch site I have that does it:
https://gisdev.kpb.us/map/index.html?viewer=OEM
The first report will be okay, but then everything goes bananas.0 -
I ran a few simple and detailed reports from your map tip, and it looks like it used the right parcel each time (based on the map and the address on the report matching the map tip). Maybe I'm not testing it right to cause the error? 0 -
Wow. Really? That's even more confusing. I can't see that you're doing it wrong... click on a parcel -> from Map Tip Run a Report -> simple or detailed -> download.
It's definitely not consistent. I can get three in a row that are good and then suddenly one is bananas. You can see by the shapes of the parcel selected here and the one on the report that they aren't the same.
Thank you very much for looking at it. It may be time to contact support directly. I'll post the solution here if we/they figure it out.
0 -
I am having the same problem, I am getting a cannt find report "0" error. We recently upgraded to the latest version of essentials and the HTML 5 viewer and it seemed to coincide with that. I used the workflow John created for the single report. I have a report 0 and it's set up correctly. (as it was working fine a couple days ago) 0 -
Hi Chris,
You may or may not be seeing this issue -
https://support.geocortex.com/essentialsGSCkba?sub-nav=kba&main-nav=essentials&#!/feedtype=SINGLE_ARTICLE_DETAIL&criteria=BESTANSWERS&id=kA3f2000000k9cGCAQ
Scroll to the bottom for the Report activity example.
Feel free to submit a support case if you cannot resolve it.
Regards,
Wayne0 -
In my case it was defitnitely on the arcgis server side. There was an issue with our spatial view that was auto-generating a second OID field within which the values were not constant. 0 -
Hi Bobbi,
I was wondering if you had found a solution to your issues. I am having the exact same problems with some of our spatial views when selecting a feature in the map, running the report from the maptip, selecting the report and downloading the results. It also works for us the first couple of times the report is run and then out of nowhere it starts running reports on features that were not selected.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
20 Kommentare