shsamara77 Posted April 20, 2018 Share Posted April 20, 2018 Hi All,I have installed Jaspersoft Studio Community Edition latest version (v.6.5.1) and JasperReports Server Community Edition latest version (v.6.4.3).1. First, I have created a report in Jaspersoft Studio, using a template containing an image (cherry) (cherry.jpg), using a data adapter connecting to MariaDB database and retrieving data of a Person table in MariaDB. Report is PersonReport.jrxml.2. Next, I have my JasperReports Server up and running.3. Next, I have added the JasperReports Server in my Jaspersoft Studio and published the report to the JasperReports Server.4. Next, I open a browser and login to the JasperReports Server (http://localhost:8080/jasperserver/login.html) using jasperadmin (Administrator) login and navigate to the Reports context menu in the Folders tree, and I can see the published report (PersonReport) in the Reports list.5. Next, I select the PersonReport and click "Edit". ***Under the Edit, when I go to the Resources I could NOT see the Cherry image being added there. Hence, I add the image Cherry.jpg from the file system into the resources. ***In the same "Edit", when I go to the Data Sources I could not see the MariaDB adapter being added. Hence, I also added the MariaDB JDBC Data Source (MariaDBDS) under the Data Sources menu and then set the newly added MariaDBDS as the Data Source under the Edit menu of the report. Then, I Submit the Edit changes.6.***Next, I run the report and I get the error message:Error Message There was an error on the server. Try again or contact site administrators. (Error UID: 5f4e8c35-1a5c-435d-8c53-e77514c3d4ca) When I check the logs, I could see the below Stack Trace:2018-04-20 16:30:17,659 ERROR AsyncJasperPrintAccessor,pool-4-thread-3:321 - Error during report execution net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error opening input stream from URL: repo:cherry.jpg. at net.sf.jasperreports.repo.DefaultRepositoryService.getInputStream(DefaultRepositoryService.java:116) at net.sf.jasperreports.repo.InputStreamPersistenceService.load(InputStreamPersistenceService.java:45) at net.sf.jasperreports.repo.DefaultRepositoryService.getResource(DefaultRepositoryService.java:149) at net.sf.jasperreports.repo.RepositoryUtil.findInputStream(RepositoryUtil.java:190) at net.sf.jasperreports.repo.RepositoryUtil.getBytesFromLocation(RepositoryUtil.java:206) at net.sf.jasperreports.renderers.util.RendererUtil.getNonLazyRenderable(RendererUtil.java:163) at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:538) at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:482) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:381) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:500) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:312) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:248) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:115) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:586) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:945) at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:169) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:896) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1812) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1143) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1072) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:967) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: net.sf.jasperreports.engine.JRException: Error opening input stream from URL: repo:cherry.jpg. at net.sf.jasperreports.engine.util.JRLoader.getInputStream(JRLoader.java:343) at net.sf.jasperreports.repo.DefaultRepositoryService.getInputStream(DefaultRepositoryService.java:99) ... 24 more Caused by: java.io.IOException: Repository file resource /reports/SidathReports/PersonReport_files/cherry.jpg could not be loaded at com.jaspersoft.jasperserver.api.engine.jasperreports.util.repo.RepositoryConnection.getInputStream(RepositoryConnection.java:103) at java.net.URL.openStream(Unknown Source) at net.sf.jasperreports.engine.util.JRLoader.getInputStream(JRLoader.java:339) ... 25 more 2018-04-20 16:30:17,696 ERROR ErrorPageHandlerAction,http-apr-8080-exec-10:118 - Error UID 5f4e8c35-1a5c-435d-8c53-e77514c3d4ca com.jaspersoft.jasperserver.api.JSShowOnlyErrorMessage: Repository file resource /reports/SidathReports/PersonReport_files/cherry.jpg could not be loaded Arguments: at com.jaspersoft.jasperserver.war.action.ViewReportAction.executeReport(ViewReportAction.java:646) at com.jaspersoft.jasperserver.war.action.ViewReportAction.executeReport(ViewReportAction.java:530) at com.jaspersoft.jasperserver.war.action.ViewReportAction.runReport(ViewReportAction.java:406) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.webflow.action.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:98) at org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:123) at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188) at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51) at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:77) at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188) at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145) at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51) at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101) at org.springframework.webflow.engine.State.enter(State.java:194) at org.springframework.webflow.engine.Transition.execute(Transition.java:227) at org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:393) at org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214) at org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119) at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555) at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:388) at org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210) at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:232) at org.springframework.webflow.engine.ViewState.resume(ViewState.java:196) at org.springframework.webflow.engine.Flow.resume(Flow.java:545) at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:261) at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169) at sun.reflect.GeneratedMethodAccessor292.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy83.resumeExecution(Unknown Source) at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183) at org.springframework.webflow.mvc.servlet.FlowController.handleRequest(FlowController.java:174) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:951) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:853) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.owasp.csrfguard.CsrfGuardFilter.doFilter(CsrfGuardFilter.java:88) at com.jaspersoft.jasperserver.api.security.csrf.JSCsrfGuardFilter.doFilter(JSCsrfGuardFilter.java:72) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.jaspersoft.jasperserver.api.security.csrf.CrossDomainCommunicationFilter.doFilter(CrossDomainCommunicationFilter.java:116) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.jaspersoft.jasperserver.war.NullFilter.doFilter(NullFilter.java:43) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at com.jaspersoft.jasperserver.api.security.IPadSupportFilter.doFilter(IPadSupportFilter.java:67) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.common.JSSwitchUserProcessingFilter.doFilter(JSSwitchUserProcessingFilter.java:157) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.metadata.user.service.impl.MetadataAuthenticationProcessingFilter.doFilter(MetadataAuthenticationProcessingFilter.java:143) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.util.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:99) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:235) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.NullFilter.doFilter(NullFilter.java:43) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:235) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.logging.filter.BasicLoggingFilter.doFilter(BasicLoggingFilter.java:57) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.security.WebAppSecurityFilter.doFilter(WebAppSecurityFilter.java:80) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.MultipartRequestWrapperFilter.doFilter(MultipartRequestWrapperFilter.java:95) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.NullFilter.doFilter(NullFilter.java:43) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.security.encryption.EncryptionFilter.doFilter(EncryptionFilter.java:150) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.jaspersoft.jasperserver.war.util.SessionDecoratorFilter.doFilter(SessionDecoratorFilter.java:63) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.jaspersoft.jasperserver.war.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:67) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.jaspersoft.jasperserver.war.httpheaders.ResourceHTTPHeadersFilter.doFilter(ResourceHTTPHeadersFilter.java:77) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.jaspersoft.jasperserver.war.SessionXssNonceSetterFilter.doFilter(SessionXssNonceSetterFilter.java:64) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.jaspersoft.jasperserver.war.P3PFilter.doFilter(P3PFilter.java:43) 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:94) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:616) 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:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2527) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2516) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) ***The problem seems to be that the Image (Cherry.jpg) is not being retrieved from the Repository and hence cannot generate the report.Hence, the error. Jaspersoft and somebody can you please check into this and let me know. This seems to be a BUG. Thanks Link to comment Share on other sites More sharing options...
m.kamran Posted April 20, 2018 Share Posted April 20, 2018 Hi Samara,You do not need to upload the resource separately. I understand the appraoch you have tried should have worked ideally but the actual solution is to upload the image along with the report. Please note when you export the report, you would see the cherry image on the list as well, please select that too. For subsequent report uploads, you would always have to set the report resources to "overwrite" because if you do not, jasper assumes the report does not need the resource anymore and breaks, hope it helps.Thanks. Link to comment Share on other sites More sharing options...
mlopez_1 Posted April 21, 2018 Share Posted April 21, 2018 To reference well to repository resources you must understand how to reference them.If you take a look at your error log: Error opening input stream from URL: repo:cherry.jpg , the problem is that Jasper Server cannot find cherry.jpg resource as a repository resource.What I use to do is create a repository resource an then copy and paste as link in Report Unit. With the name of link you can use "repo: name_of_link" to reference it but, if you use it as a Report Unit local resource you can use it with "cherry.jpg" (this one last can't remember exactly, recomend to read the manual).Mariano Link to comment Share on other sites More sharing options...
hozawa Posted April 21, 2018 Share Posted April 21, 2018 When saving your report from Jaspersoft Studio to JasperReports Server, there should be a dialog asking you if you want to also save the images to the server. You'll need to save all the resources into the server with the report. Link to comment Share on other sites More sharing options...
shsamara77 Posted April 23, 2018 Author Share Posted April 23, 2018 Hi All, Question Continued.. I have checked what is said by m.kamran and hozawa. When publishing the report from Jaspersoft Studio to JasperReports Server, Yes, I have had selected the resource cherry.jpg and published. However, I am still getting the error. So that is not the solution (is it a Bug then?) mlopez_1: Can you please elaborate more on what you have mentioned ? How to create a repository resource ? Then, how to copy and paste as link in Report Unit ? What is the meaning of: "With the name of link you can use "repo: name_of_link" to reference it" ? PS: I have checked the below query on the Repository:SELECT * FROM public.jiresourcefolder ORDER BY id ASC I can see below records: "16" 0 "/images" false "images" "Images" "Folder containing reusable images" "9" "2018-04-20 14:48:49.88" "2018-03-27 11:33:28.677""303" 10 "/reports/SidathReports/PersonReport_files" true "PersonReport_files" "PersonReport" "301" "2018-04-20 15:06:51.662" "2018-04-20 15:06:51.662"Also, when I run the below query on the Repository: SELECT * FROM public.jiresource ORDER BY id ASC I CANNOT see any records! ***I also have the question: where are the files of the PersonReport (i.e. /reports/SidathReports/PersonReport_files) stored in the file system ?(I checked for the folder path: /reports/SidathReports/PersonReport_files in the file system, but could not see such path) Thanks,Sid Link to comment Share on other sites More sharing options...
Solution mlopez_1 Posted April 23, 2018 Solution Share Posted April 23, 2018 Hi Sid, there are two approach for what you want to do.First, include the resource as a Report Unit local resource, Second, create a Repository Resource and use it inside Report Unit as a link of these resource.In both cases you have to reference the resource with "repo: resource_or_link_name".I use the second approach but both are goods.Take a look at https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v621/understanding-repo-syntaxAnd see: repo: used without a pathMariano Link to comment Share on other sites More sharing options...
shsamara77 Posted April 23, 2018 Author Share Posted April 23, 2018 Hi All, Hi Mariano, The SECOND approach solution provided by you WORKED!!!I first created an Image resource: cherry.jpg in the Repostory. Then, when I publish the report within Jaspersoft Studio, I had to modify the below line:[CDATA["repo:cherry.jpg"]] as follows: [CDATA["repo:/images/cherry.jpg"]]. Then it worked! I was able to see the report with images from within the JasperReports Server console. Note that the documentation (the link given by you - https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v621/understanding-repo-syntax) states to use the syntax: repo:/Images/myimage.jpg which also has a minor error.The 'I' in 'Images' must be 'i' -> 'images' . Please also note that the first approach: <imageExpression><![CDATA["repo:cherry.jpg"]]></imageExpression> still did not work. Thanks Mariano and Thanks All for your support. Sid 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