khang_1 Posted August 28, 2019 Share Posted August 28, 2019 Hi there,I am trying to add markers into a google map component in Jaspersoft Studio Professional.While it works with lat/long, the thing does not work with address.Instead I am getting this error net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Address request failed (see status: REQUEST_DENIED). at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:539) at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$17(ReportController.java:514) at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:432) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)Caused by: net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Address request failed (see status: REQUEST_DENIED). at net.sf.jasperreports.components.map.fill.FillPlaceItem.getCoords(FillPlaceItem.java:167) at net.sf.jasperreports.components.map.fill.FillPlaceItem.getEvaluatedValue(FillPlaceItem.java:72) at net.sf.jasperreports.components.items.fill.FillItem.evaluateProperties(FillItem.java:75) at net.sf.jasperreports.components.items.fill.FillItemData.evaluateItems(FillItemData.java:104) at net.sf.jasperreports.components.items.fill.FillItemData.getEvaluateItems(FillItemData.java:123) at net.sf.jasperreports.components.map.fill.MapFillComponent.evaluateMap(MapFillComponent.java:210) at net.sf.jasperreports.components.map.fill.MapFillComponent.evaluate(MapFillComponent.java:154) at net.sf.jasperreports.engine.fill.JRFillComponentElement.evaluate(JRFillComponentElement.java:110) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:548) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalFiller.java:447) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnHeader(JRVerticalFiller.java:496) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:260) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135) at java.lang.Thread.run(Thread.java:748)Caused by: net.sf.jasperreports.engine.JRException: Address request failed (see status: REQUEST_DENIED). at ne.sf.jasperreports.components.map.fill.FillPlaceItem.getCoords(FillPlaceItem.java:160) ... 16 more[/code]This could be an error from Google API, but I have enabled all the map-related APIs there are. Link to comment Share on other sites More sharing options...
khang_1 Posted August 29, 2019 Author Share Posted August 29, 2019 I found these lines of codepublic static final String PLACE_URL_PREFIX = "https://maps.googleapis.com/maps/api/geocode/xml?address=";public static final String PLACE_URL_SUFFIX = "&sensor=false&output=xml&oe=utf8";String urlStr = MapFillComponent.PLACE_URL_PREFIX + URLEncoder.encode(address, MapFillComponent.DEFAULT_ENCODING) + MapFillComponent.PLACE_URL_SUFFIX;URL url = new URL(urlStr); byte[] response = JRLoader.loadBytes(url);[/code]I think the API key was not used in the address API call to Google, and therefore REQUEST_DENIED was returned. Link to comment Share on other sites More sharing options...
beny.lagache Posted October 14, 2020 Share Posted October 14, 2020 Hi,I have the same problem, have you found a solution ?Thanks ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now