I am working on an embedded app using jasperserver-pro 6 for aws, using a combination of java rest controllers and visualize.js. I was working on setting up a CSVMetadataExporter and followed the documentation, adding it to the `flows/viewReportBeans.xml` and then commented out the others (we only want the slimmed down csv export option) but for some reason when I looked at a report's export options returned by visualize I was getting a completely different list. After much confusion and searching I found the files `applicationContext-web-services.xml` and `applicationContext-remote-services.xml` both of which have their own list of exporter maps and bean configurations... I'm playing around with how/if these relate to eachother and how that corresponds to what is returned by visualize but I was wondering if anyone here understood the reasoning for three lists of exporters which ones are for what.
Thanks in advance!
1 Answer:
Posting the last 2 comments here for reference since it will be easier for somebody else to follow:
marianol - 1 day 19 hours ago I will look into this.. applicationContext-web-services.xml should be only for the REST API and applicationContext-remote-services.xml should be the one visualize.js uses. I'm not sure what do you refer when you talk about " export options list returned by visualize" which method are you talking about? Can you send me a fiddel with a bare bones sample of what you ate attemting so I can replicate it? srang - 1 day 16 hours ago I think I figured out part of my problem. I assumed that jasper/visualize determined the export options available to a report at the time of report generation by checking with the server. Under this assumption I didn't think that visualize.js would change ever so I curled visualize down when we first upgraded to 6.0 and put it inside the project with the rest of the javascript, so I could minfy them together at deployment. Upon further inpection I found that the "export map" I was looking at configuring in the beans is actually an enum within visualize. What I'm guessing now is that when the server builds and deploys it generates visualize based on the configured beans, which in hind sight makes a lot of sense. I haven't had a chance to test this but I imagine if I pull down visualize from the server now that I've configured the beans, it will have the proper export options. That being said, I really don't know and would love your insight
I think visualize is pulling its list from the remote-services but for some reason when I add or remove items from the exporter map they don't always disappear. Not sure why that is.
Another interesting wrinkle I've come across: I created a remote csv metadata exporter bean and configured it in the list of remote export options, and then reloaded the server. When I went into my webapp the option wasn't there but I hardcoded the key for that new exporter as the export type and ran it and it worked. Also as hinted above, when I comment out a bean from the remote exporters map the option doesn't disappear but if I try to export it, it fails. This leads me to believe that it is configuring the server correctly but just isn't updating the list of export options to reflect that... Not sure where to go from here
I will look into this.. applicationContext-web-services.xml should be only for the REST API and applicationContext-remote-services.xml should be the one visualize.js uses.
I'm not sure what do you refer when you talk about " export options list returned by visualize" which method are you talking about?
Can you send me a fiddel with a bare bones sample of what you ate attemting so I can replicate it?
I think I figured out part of my problem. I assumed that jasper/visualize determined the export options available to a report at the time of report generation by checking with the server. Under this assumption I didn't think that visualize.js would change ever so I curled visualize down when we first upgraded to 6.0 and put it inside the project with the rest of the javascript, so I could minfy them together at deployment. Upon further inpection I found that the "export map" I was looking at configuring in the beans is actually an enum within visualize. What I'm guessing now is that when the server builds and deploys it generates visualize based on the configured beans, which in hind sight makes a lot of sense. I haven't had a chance to test this but I imagine if I pull down visualize from the server now that I've configured the beans, it will have the proper export options. That being said, I really don't know and would love your insight