Hey, guys, just wanted to check something on the J...
# gd-beginners
a
Hey, guys, just wanted to check something on the Java API implementation. I’m trying to use this one https://www.javadoc.io/doc/com.gooddata/gooddata-java/latest/index.html) ver 3.11.1 + api3 and trying to get PNG of the graph for the report via ExportService. So far it’s working, but I can’t apply filters on it. Could you show me the right way?
@Jan Soubusta may be you could help as it’s stated you “talks about API” on your profile description?
Or anyone else from the API team, please @Robert Moucha @Jan Rehanek?
j
I suppose that the Java client you mentioned is only for the former GoodData platform, not for GoodData.CN/GoodData cloud.
Do you use GoodData cloud / CN?
j
Hi Alexey. The Java SDK is not currently in active development. See: https://github.com/gooddata/gooddata-java
Copy code
The project is currently NOT in "active development". Meaning that feature request may or may not be implemented. You are welcomed to contribute your code and create an issue.
I’ll try to find you somebody who can answer, but it might take some time. And yes, as @Jan Soubusta says, it’s GoodData Platform only.
a
@Jan Soubusta yeah, it’s not related to the GoodData cloud.
@Jan Rehanek thanks, looking forward to the answer, it should be really easy for the person how knows it I guess
👍 1
a
Yes
This “context” -> “filters” fields
Simply saying - there is a report on the dashboard with the filter for the last year only
But then I exporting it as PNG via api it shows me all data from the beginning
Question is how to apply this filter or may be is there any other solution
May be I could create my own filter while doing export
It’s not clear from the SDK documentation unfortuntately
j
All right. Thanks for the added detail. I’ll see what I can find.
a
Thanks again, looking forward
a
Great, thanks for the support, will try that out!
One more short questions. Now I have project -> dashboard -> then tab in the dashboard where I can find filters
l
You can first try to prepare the report with the filter in the UI (Reports tab -> Filter) and check the Network communication - you would see there a request like https://DOMAIN.gooddata.com/gdc/md/WORKSPACE/obj?createAndGet=true with payload like
Copy code
{"reportDefinition":{"links":{"explain2":"/gdc/md/WORKSPACE/obj/2444/explain2"},"content":{"filters":[{"expression":"[/gdc/md/WORKSPACE/obj/2167] IN ([/gdc/md/WORKSPACE/obj/2167/elements?id=42767])"}],...
This should help you construct those objects accordingly 😉
👍 1
a
Thanks
l
Or maybe the easier way for you would be to save the report with the filter as the new report (report definition) and then just use the URI to this one for exporting. It's up to you, what makes more sense in your use case.