Get a filtered report from the web service API

Ed Kilby shared this question 5 years ago
Answered

Hi,


I have a requirement to be able use the Yellowfin web service to generate a report (preferably in PDF, CSV or XLSX format, but HTML is also fine) with a filter applied to that report.


An example is a report built in yellowfin, that has a user filter for something like <name> and when the web service is invoked to generate the report, we pass in a specific <name> to pre filter the report before it is generated.


Looking at the API, I'm not sure how to do this.


Ultimately, these reports are being emailed out, so asking yellowfin to generate the filtered report and just email it is fine and I can see that there is a function to almost do that, minus the filtering, although the AlterationCommand seems promising, but it's not documented


Thanks

Replies (7)

photo
1

Hi Ed,

Thanks for reaching out. This should be possible via web services. Have you come across our Functional Report Services Wiki page?

Under Basic Functions you'll see an option for FILTEROPTIONS. This web service returns the filter values for a specified report. If you expand this you'll see a breakdown of the request elements required to accomplish this as well as a couple report example code.

Hopefully this gives you what you're looking for. Please take a look at the referenced Wiki page and let me know if you have any questions.

Regards,

Mike

photo
1

Hey Mike,


From what I can tell the FILTEROPTIONS web service method is only to get hold of the filter values for a report, this is not really what I'm after. I need to be able to actually get a the report by passing in some filter options. I'm really after something like SENDTOEMAIL method, with the ability to filter the report before the output is generated and emailed out.


Do you know if this is possible?


Kind regards

Edd

photo
1

Hi Ed,

Thanks for your response. If you again refer to the linked Functional Report Services Wiki and look under Miscellaneous > SENDTOEMAIL > Response Example, you can see that it looks like it's possible to pass in filter options, since what a prefiltered response is being returned:

However, I actually believe this is the drill result being returned from the AlterationCommand request element, as it can't actually be filtered results as these are the possible AlterationCommand values that can be passed:

SORT

SORTBYFIELD

RESET

RESETDRILLTHROUGH

RESETDRILLDOWN

DRILLDOWN

DRILLANYWHERE

CHANGEDRILL

UNITSELECTION

OTHER

RESETOTHER

MULTICHARTMETRIC

MULTISELECTED

MULTINOTSELECTED

CHARTMETRIC

CATEGORYCHARTMETRIC

MOVEUP

MOVEDOWN

MOVELEFT

MOVERIGHT

ZOOMIN

ZOOMOUT

DRILLDOWNOLAP

DRILLUP

DATEPERIOD

TAB

PAGE

RELATEDREPORT

DRILLJSON

DRILL

DIRECTLINK

TABCODISPLAY

SETDATES

GISMAPZOOMLEVEL

GISMAPZOOMXY

GISMAPLAYER

I don't know whether it possible to either add ReportFilter Report Object Definitions to existing Report Services or add a FILTER option to the AlterationCommand's, but if you'd like I can submit an Idea ticket on your behalf for this and submit an internal enhancement request and see what the dev team comes back with, as they're the one's in the position to say whether this is even a possibility, so please let me know if this would be an option you'd like to explore.

Regards,

Mike

photo
1

Hey Mike,


I've seen that list of alteration commands mentioned on someone else's community question. Firstly I'm surprised that this information isn't on the actual documentation provided online and secondly, these commands are not at all clear to me.


How would I use the DRILLDOWN command? what is it expecting to be passed? I can see from the wiki page that the example seems to be suffixed with a Pipe | and the same report ID, this make no sense. I can see other examples that have mentioned that there are a number of piped params that need to be provided (e.g. DRILLDOWN|1223|456|789). Before raising another ticket with your developers, for which I think a FILTER option would be great BTW, please can I first recommend that some much improved documentation is provided for your web services. The fact that alterationCommand is mentioned as alterationComment in a number of places suggests that this documentation is in need of some review.


When I currently call the SENDTOEMAIL method on the web service with no AlterationCommand I get :

YF:2019-05-29 09:25:49:ERROR (ReportService:invoke) - Error exporting data: java.lang.NullPointerException

java.lang.NullPointerException

at com.hof.mi.web.service.ReportService.remoteReportCall(ReportService.java:2072)

at sun.reflect.GeneratedMethodAccessor1445.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)

at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)

at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)

at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)

at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at com.hof.servlet.BrowserHeaderFilter.doFilter(BrowserHeaderFilter.java:43)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)


and then when I attempt to use the alterationCommand (not really knowing what should go in it) I get:


YF:2019-05-29 09:26:06: INFO (ReportBroadcastProcess:remoteReportCall) - Email failed: java.lang.NullPointerException

java.lang.NullPointerException

at com.hof.mi.process.ReportBroadcastProcess.sendBroadcastEmail(ReportBroadcastProcess.java:4707)

at com.hof.mi.process.ReportBroadcastProcess.A(ReportBroadcastProcess.java:4680)

at com.hof.mi.process.ReportBroadcastProcess.deliverEmail(ReportBroadcastProcess.java:3641)

at com.hof.mi.process.ReportBroadcastProcess.A(ReportBroadcastProcess.java:3598)

at com.hof.mi.process.ReportBroadcastProcess.A(ReportBroadcastProcess.java:3078)

at com.hof.mi.process.ReportBroadcastProcess.emailReportAdhoc(ReportBroadcastProcess.java:2760)

at com.hof.mi.web.service.ReportService.remoteReportCall(ReportService.java:2088)

at sun.reflect.GeneratedMethodAccessor1445.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)

at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)

at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)

at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)

at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at com.hof.servlet.BrowserHeaderFilter.doFilter(BrowserHeaderFilter.java:43)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

YF:2019-05-29 09:26:06: INFO (ReportService:invoke) - WebserviceException caught: BROADCAST_FAILED

photo
1

Hi Ed,

I'm in agreement that our Web Services documentation can use a considerable amount of work. This is something Support has brought up quite a few times and is trying to get addressed.

In terms of your specific query I've reached out for more specifics on how to configure the DRILLDOWN AlterationCommand, I.e. what the "DRILLDOWN | <id>" syntax is supposed to be. Once I obtain this information, I'll let you know and also reach out to the appropriate party add this to our documentation; at which point I'll also submit the Idea ticket on your behalf as well.

Regards,

Mike

photo
1

Hi Ed,

One of our consultants on our Australian team informed me that "all of this is possible and to use the ws_report_soap.jsp example from the examples folder." This can be found in <YellowfinInstal>/development/examples/webservices.

We're also in agreement that the report web services on the Wiki could be much better, we just don't have time to allocate for this right now.

While Support does its best to assist with any and all issues, investigating and writing code is not covered in the Support contract and it would be our consulting team, specifically our integration consultants, who'd be best equipped to handle this type of request. If you'd be interested in discussing consulting options I'd be happy to reach out on your behalf to your Account Manager to discuss further. Please let me know. Sorry there's not better news on this.

Regards,

Mike

photo
1

Hi Ed,

I'm going to go ahead and mark this one as Answered since I'm afraid there's not much else we can add here, but if you have further questions or concerns on this, if you respond, it will re-open the case and put it back in my queue and I'll be happy to assist further.

Regards,

Mike

Leave a Comment
 
Attach a file