#1 2017-09-20 20:02:23

gary.knapp
Member
Registered: 2016-05-12

Run report by URL without login

I am trying to run a report with a date parameter without a login. We are using the community version, so a script report is not an option.  The URL below is similar to my failed attempt.

http://SERVER:PORT/reportserverbasedir/reportserver/httpauthexport?id=5000&user=exportuser&apikey=79PKXGScP8r8&key=dateparameter=yyyy-mm-dd&format=HTML&download=false

We also have reports with 3 to 5 cascading parameters that we would like to run without login.

Offline

#2 2017-09-21 15:35:11

Rodion
Member
Registered: 2017-05-17

Re: Run report by URL without login

Dear gary,

Here is a simple example for executing a report (with Date-parameter) via URL :

http://SERVER:PORT/myLocalReportServerMainDir/reportserver/reportserver/httpauthexport?id=YOUR_REPORTID&user=YOUR_USER&apikey=YOUR_KEY&key=dateparameter=yyyy-mm-dd&format=HTML&download=false

Hint : myLocalReportServerMainDir might not be necessary!
For example, I used just :

http://SERVER:PORT/reportserver/reportserver/httpauthexport?id=YOUR_REPORTID&user=YOUR_USER&apikey=YOUR_KEY&key=dateparameter=yyyy-mm-dd&format=HTML&download=false

It works on a simple dynamic list with following query on a MS SQL Server :

SELECT '2017-09-21' as Textdate, ${key1} as Dateparam

${key1} is a Date-Parameter defined in the Parameters-Block

You should also verify whether the user has the execute Right on this report.

If u still have problems, please don't hesitate to contact us and please provide the Error

Greetings,
Rodion

Last edited by Rodion (2017-09-21 15:36:51)

Offline

#3 2017-09-21 18:30:11

gary.knapp
Member
Registered: 2016-05-12

Re: Run report by URL without login

The report is running, but returning data for today's data, not yesterdays as given in the URL.  The report was written in BIRT. The data is being stored in MariaDB. Using format=HTML sometimes only returns the  Grid  layout. Sometimes returns the full report. format=PDF always returns the full report.

http://SERVER:PORT/reportserver/httpauthexport?id=YOUR_REPORTID&user=YOUR_USER&apikey=YOUR_KEY&key=dateparameter=yyyy-mm-dd&format=HTML&download=false

Under  Parameters

Key = Shiftdate
Name = Shiftdate
Type = Date/Time Parameter
Parameter Properties
Editable = yes
Specific Properties
Use Current Time as Default= yes

When changing "Use Current Time as Default= no" the following error is generated.

Error: An error occurred during report execution.
The report could not be executed: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorRuntimeException
To get help please contact an administrator.
Details
net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorRuntimeException at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:218) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:119) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exeucteReport(ReportExportServlet.java:545) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doExportReport(ReportExportServlet.java:417) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReport(ReportExportServlet.java:347) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReportById(ReportExportServlet.java:273) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReportByIdViaRequest(ReportExportServlet.java:264) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doGet(ReportExportServlet.java:167) at net.datenwerke.rs.incubator.server.httpauthexecute.HttpAuthExecuteServlet.doGet(HttpAuthExecuteServlet.java:82) at net.datenwerke.rs.incubator.server.httpauthexecute.HttpAuthExecuteServlet$$EnhancerByGuice$$82354499.CGLIB$doGet$0() at net.datenwerke.rs.incubator.server.httpauthexecute.HttpAuthExecuteServlet$$EnhancerByGuice$$82354499$$FastClassByGuice$$378e1965.invoke() at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52) at net.datenwerke.rs.incubator.server.httpauthexecute.HttpAuthExecuteServlet$$EnhancerByGuice$$82354499.doGet() at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at net.datenwerke.rs.incubator.server.httpauthexecute.HttpAuthExecuteServlet$$EnhancerByGuice$$82354499.CGLIB$service$17() at net.datenwerke.rs.incubator.server.httpauthexecute.HttpAuthExecuteServlet$$EnhancerByGuice$$82354499$$FastClassByGuice$$378e1965.invoke() at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52) at net.datenwerke.rs.incubator.server.httpauthexecute.HttpAuthExecuteServlet$$EnhancerByGuice$$82354499.service() at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263) at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178) at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62) at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:89) at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorRuntimeException: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorRuntimeException at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.executeReport(BirtReportEngine.java:81) at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.doExecute(BirtReportEngine.java:67) at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:148) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:186) ... 59 more Caused by: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorRuntimeException at net.datenwerke.rs.birt.service.reportengine.output.generator.BirtPDFOutputGenerator.exportReport(BirtPDFOutputGenerator.java:45) at net.datenwerke.rs.birt.service.reportengine.sandbox.BirtEngineEnvironment.call(BirtEngineEnvironment.java:178) at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.executeReport(BirtReportEngine.java:79) ... 62 more Caused by: org.eclipse.birt.report.engine.api.impl.ParameterValidationException: Required parameter Shiftdate is not set. at org.eclipse.birt.report.engine.api.impl.EngineTask.validateAbstractScalarParameter(EngineTask.java:806) at org.eclipse.birt.report.engine.api.impl.EngineTask.access$0(EngineTask.java:792) at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitScalarParameter(EngineTask.java:709) at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visit(EngineTask.java:1540) at org.eclipse.birt.report.engine.api.impl.EngineTask.doValidateParameters(EngineTask.java:695) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:95) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77) at net.datenwerke.rs.birt.service.reportengine.output.generator.BirtPDFOutputGenerator.exportReport(BirtPDFOutputGenerator.java:33) ... 64 more

Offline

#4 2017-09-25 06:51:25

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Run report by URL without login

Hi gary.knapp,

ok, so if I see this correctly, the problem is not in running the report without prior authorization, since you get this error in "the normal case". Is this right? So the parameter seems not to be passed correcty.
Looking at your URL:
http://SERVER:PORT/reportserver/httpauthexport?id=YOUR_REPORTID&user=YOUR_USER&apikey=YOUR_KEY&key=dateparameter=yyyy-mm-dd&format=HTML&download=false

I see this: ... &apikey=YOUR_KEY&key=dateparameter=yyyy-mm-dd& ...
the key parameter is empty (key=) ? Are you trying to pass an empty key or what are you trying to do here?
Could you try leaving this out? With the url:
http://SERVER:PORT/reportserver/httpauthexport?id=YOUR_REPORTID&user=YOUR_USER&apikey=YOUR_KEY&dateparameter=yyyy-mm-dd&format=HTML&download=false

Regards,
Eduardo

Offline

#5 2017-09-25 08:58:50

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Run report by URL without login

Further, parameters are passed by: p_parametername as explained here:
https://reportserver.net/en/guides/admi … a-the-URL/

So try: http://SERVER:PORT/reportserver/httpauthexport?id=YOUR_REPORTID&user=YOUR_USER&apikey=YOUR_KEY&p_dateparameter=2017-01-01&format=HTML&download=false

The date format is depending on your local configuration as explained here: https://forum.reportserver.net/viewtopic.php?id=641
You have to change the configuration file: datasources/parameter.cf , set your urlpattern ( <urlpattern>yyyy-MM-dd</urlpattern> ) and then "config reload" with your terminal. Then you can set the parameter by the url e.g.:

http://localhost/reportserver/reportserver/httpauthexport?id=YOUR_REPORTID&user=YOUR_USER&apikey=YOUR_APIKEY&p_key1=2017-09-26&format=HTML&download=false

In this case, my urlpattern is: <urlpattern>yyyy-MM-dd</urlpattern>

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB