#1 2024-05-18 09:20:30

ianef
Member
From: UK
Registered: 2024-05-04
Website

Report images not visible for non-admin users

Hi, I'm evaluating ReportServer Enterprise edition and I am experiencing a problem with report logos for non-admin users.

I am using Jasper reports and have put a logo file in the File System, created a Global Constant and added a parameter to the report so that it gets replaced with the Global Constant definition of the logo when the report is run.

This all works fine if I view the report as an admin user, other users can see the report but the logo is missing.

The non-admin users can view the logo using file system URL.

I have also looked at Permissions Management and added the containing OU for the non-admin users to the Global Constants ACEs. Still no luck.

Any help in resolving this blocking problem would be greatly appreciated.

Last edited by ianef (2024-05-18 09:20:56)

Offline

#2 2024-05-22 14:36:52

ianef
Member
From: UK
Registered: 2024-05-04
Website

Re: Report images not visible for non-admin users

FYI, here are the security settings. The 'plm' user looks like it has read and execute set:

rs-missing-logo.png

rs-user-role-and-ou.png

Offline

#3 2024-05-23 11:36:53

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Report images not visible for non-admin users

Hi ianef,

ianef wrote:

I am experiencing a problem with report logos for non-admin users.

what are exactly admin users in your case? Can you pls also post some screenshots of the user/permissions where this is working?


ianef wrote:

I have also looked at Permissions Management and added the containing OU for the non-admin users to the Global Constants ACEs. Still no luck.

The file has to be readable by your non-admin users. Pls change to the "File system", select your logo (or the resources directory) and add the OU in the permissions tab. I see in your screenshot that the OU seems to have an inherited permission on the object. Can you pls check with "haspermission" if the user has permission to see the logo? Pls post the result of the command.
https://reportserver.net/en/guides/admi … ermission/

Also, pls make sure that the "resources" folder is "web accessible". Just click on the folder and select the checkbox.

If this doesn't solve the problem: what exactly do you see in the jasper report ? Can you pls post a screenshot? Also pls check your tomcat logs and look for any error message after you open the report.

Regards,
Eduardo

Offline

#4 2024-06-07 15:20:55

ianef
Member
From: UK
Registered: 2024-05-04
Website

Re: Report images not visible for non-admin users

Hi eduardo. Apologies for the slow response, I'd had a lot of varied things to look at with production systems.

I have done as you suggested:
1. Added the OU to the permissions of the logo.
2. Ran the command 'haspermission id:User:83607 id:FileServerFile:18493 Read' and this returned 'true'.
3. The resources folder is marked as 'web accessible'.

Here is a picture of the report run with httpauthexport, logo missing:
http://127.0.0.1/reportserver/reportser … load=false
rs-report-missing-logo.png


If I run the report  using 'inlinereport' the logo appears:
http://127.0.0.1/reportserver/ReportSer … XXXXXXXXXX
rs-report-with-logo.png


I've checked the reportserver log and there were no relevant errors reported.

Inspecting the HTML of the report page with no logo shows the img tag src attribute has no value assigned:
<td colspan="4">
<img src="" style="height: 56px" alt=""></td>


Many thanks for your help.

Last edited by ianef (2024-06-07 15:38:20)

Offline

#5 2024-06-20 11:59:33

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Report images not visible for non-admin users

Hi ianef,

unfortunately, we are unable to reproduce this issue. Could you please create a minimal report containing only the image and some static text so we can attempt to reproduce the problem? Then, post the Jasper report here.

Additionally, please create two test users: one where this works and one where it does not. Export these users and send us the resulting XML files, along with your exact ReportServer version.

Regards,
Eduardo

Offline

#6 2024-06-21 06:32:30

Felix
Moderator
Registered: 2022-08-01

Re: Report images not visible for non-admin users

hi,

so

http://127.0.0.1/reportserver/reportserver/httpauthexport?key=PLM-CurrentStock&user=plm&apikey=XXXXXXXXXXXXXXX&format=HTML&download=false

is working and

http://127.0.0.1/reportserver/ReportServer.html#inlinereport/key:PLM-CurrentStock&user:plm&apikey:XXXXXXXXXXX 

is not working?
have you tried to replace those ":" to "=" as well as the slash between "inlinereport/key" to "inlinereport?key"  in the second URL?

kind regards,

Felix


Softwareentwickler bei Infofabrik

Offline

#7 2024-07-09 11:11:05

ianef
Member
From: UK
Registered: 2024-05-04
Website

Re: Report images not visible for non-admin users

Hi Felix, apologies for not replying sooner, the end of June is a very busy time for me outside of work.

I now have to reinstall everything and start from scratch as the evaluation period for ReportServer has expired. I will try and do this over the next few days but I could really do without the hassle of this. Fingers crossed I can get this re-installed the same way as I originally had so that I can reproduce this issue.

Offline

#8 2024-07-10 06:22:02

Felix
Moderator
Registered: 2022-08-01

Re: Report images not visible for non-admin users

Hi,

we're also very busy finalizing the ReportServer 4.7!
I cross my fingers for your installation... keep me on track if you need some advices/help

kind regards

Felix


Softwareentwickler bei Infofabrik

Offline

#9 2024-07-24 16:19:17

ianef
Member
From: UK
Registered: 2024-05-04
Website

Re: Report images not visible for non-admin users

Hi Felix

I've finally managed to re-install ReportServer and I'm still experiencing exactly the same issue.

In your comment on 2024-06-21 06:32:30 #6 you have the error the wrong way round. It's the httpauthexport that is failing to display the logo.

I have tried to create a very simple report but I can't get that to run in ReportServer, this is very frustrating, everywhere I turn I seem to hit problem after problem.

This is a very simple report, it's about as basic as you can get, but whether I run it with a data source or not it fails. It doesn't need a data source, it has no fields or SQL. It runs fine in Jaspersoft Studio. I have a data source that works fine with the original report, but not this simple report:

```
Error: An error occurred during report execution.
The report could not be executed: ConnectException: Connection refused
To get help please contact an administrator.
Details
Report could not be executed. {"error":"ConnectException: Connection refused","report_id":6839,"report_name":"RS-Test","base_report_id":6839,"base_report_name":"RS-Test","executing_user_id":6,"report_output_format":"PDF","report_uuid":"16b0c942-c5a6-4673-a1d7-d4105c061043"} net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: ConnectException: Connection refused at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:280) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:161) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.executeReport(ReportExportServlet.java:563) at
```

Here is the report source. I really wish there was a way to attach files to posts in the board, it really is the most frustrating forum board I have ever used. It's totally nuts that I have to upload images to webservers so that I can include an image in a post.

```
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.17.0.final using JasperReports Library version 6.17.0-6d93193241dd8cc42629e188b94f9e0bc5722efd  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RS-Test" pageWidth="1100" pageHeight="750" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="1060" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryWithPageHeaderAndFooter="true" uuid="d3b47d1e-1108-4006-ab8a-e74fae7f4966">
    <property name="com.jaspersoft.studio.unit." value="pixel"/>
    <property name="ireport.jasperserver.url" value="http://xact-wir-web:8080/jasperserver/"/>
    <property name="ireport.jasperserver.user" value="jasperadmin"/>
    <property name="ireport.jasperserver.reportUnit" value="/CMT/CurrentStock"/>
    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="NO_DATA_ADAPTER"/>
    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
    <property name="ireport.jasperserver.report.resource" value="/CMT/CurrentStock_files/main_jrxml"/>
    <parameter name="TEST_LOGO" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["rs-logo-2-250.png"]]></defaultValueExpression>
    </parameter>
    <title>
        <band height="78" splitType="Stretch">
            <staticText>
                <reportElement x="293" y="2" width="475" height="60" forecolor="#4682B4" uuid="233f1159-e84b-44ae-ae8c-1f22b7643783"/>
                <textElement textAlignment="Center" markup="none">
                    <font size="40" isBold="false"/>
                </textElement>
                <text><![CDATA[Logo Test]]></text>
            </staticText>
            <image>
                <reportElement x="-3" y="6" width="197" height="56" uuid="73897af3-6bfb-4288-830c-ffb9dbda8523">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <imageExpression><![CDATA[$P{TEST_LOGO}]]></imageExpression>
            </image>
        </band>
    </title>
    <detail>
        <band height="22"/>
    </detail>
    <pageFooter>
        <band height="27" splitType="Stretch">
            <textField pattern="MMMM d, yyyy">
                <reportElement x="856" y="6" width="204" height="18" uuid="37e7deee-84e5-43c2-afd2-0a0d80249810"/>
                <textElement textAlignment="Right"/>
                <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER} + "/" + $V{PAGE_COUNT}]]></textFieldExpression>
            </textField>
            <textField pattern="MMMM d, yyyy">
                <reportElement x="2" y="7" width="180" height="18" uuid="a60ba33f-3741-4df2-b1c6-b8d1ee60a172"/>
                <textFieldExpression><![CDATA[NOW( )]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
</jasperReport>
```

Last edited by ianef (2024-07-24 16:25:58)

Offline

#10 2024-07-31 14:57:59

ianef
Member
From: UK
Registered: 2024-05-04
Website

Re: Report images not visible for non-admin users

Hi Felix. I've overcome the crash with my small test report. The exception message is very misleading, "ConnectException: Connection refused" was not relating to a data source connection but the replaced constant string for the logo file. I'll raise another ticket for this as it needs addressing.

So again, with my simple report, no data source, add your own image via a TEST_LOGO global constant and it doesn't work when using 'hhtpauthexport'.

Offline

#11 2024-08-01 08:11:52

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Report images not visible for non-admin users

ianef wrote:

The exception message is very misleading, "ConnectException: Connection refused" was not relating to a data source connection but the replaced constant string for the logo file. I'll raise another ticket for this as it needs addressing.

Hi ianef,

the ConnectException: Connection refused is indeed the  root cause of the issue. We always try to print the root cause of the error messages, as these are in most of the cases most accurate. Error messages are designed to pinpoint the exact problem, and stack traces provide a detailed pathway of where the error occurred. These root causes are typically the most accurate indicators of what went wrong.

In your example, the complete error stack trace is:

10:02:37.900 WARN  n.d.r.c.s.r.ReportExportServlet$$EnhancerByGuice$$2017333412 - The report could not be executed: ConnectException: Connection refused (Connection refused), details: Report could not be executed. {"error":"ConnectException: Connection refused (Connection refused)","report_id":381461,"report_name":"test","base_report_id":381461,"base_report_name":"test","executing_user_id":6,"report_output_format":"PDF","report_key":"27b46839e57130c9d48a5e7a879df70119c6bf74"}
net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: ConnectException: Connection refused (Connection refused)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:280)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:161)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.executeReport(ReportExportServlet.java:563)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doExportReport(ReportExportServlet.java:444)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReport(ReportExportServlet.java:367)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReportViaSession(ReportExportServlet.java:358)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doGet(ReportExportServlet.java:162)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$2017333412.GUICE$TRAMPOLINE(<generated>)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74)
	at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:64)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:112)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
	at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$2017333412.doGet(<generated>)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:670)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$2017333412.GUICE$TRAMPOLINE(<generated>)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:112)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
	at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55)
	at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$2017333412.service(<generated>)
	at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:290)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:280)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:184)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:89)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
	at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:94)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:750)
Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error opening input stream from URL: http://localhost:8091/ReportServer/reportserver/fileServerAccess?id=371023.
	at net.sf.jasperreports.repo.DefaultRepositoryService.getInputStream(DefaultRepositoryService.java:139)
	at net.sf.jasperreports.repo.InputStreamPersistenceService.load(InputStreamPersistenceService.java:51)
	at net.sf.jasperreports.repo.DefaultRepositoryService.getResource(DefaultRepositoryService.java:196)
	at net.sf.jasperreports.repo.RepositoryUtil.findInputStream(RepositoryUtil.java:195)
	at net.sf.jasperreports.repo.RepositoryUtil.getBytesFromLocation(RepositoryUtil.java:211)
	at net.sf.jasperreports.renderers.util.RendererUtil.getNonLazyRenderable(RendererUtil.java:179)
	at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:522)
	at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:450)
	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.fillTitle(JRVerticalFiller.java:335)
	at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:160)
	at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:631)
	at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:416)
	at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:120)
	at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:103)
	at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:530)
	at net.datenwerke.rs.base.service.reportengines.jasper.JasperReportEngine.executeReport(JasperReportEngine.java:304)
	at net.datenwerke.rs.base.service.reportengines.jasper.JasperReportEngine.doExecute(JasperReportEngine.java:108)
	at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:146)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:246)
	... 50 common frames omitted
Caused by: net.sf.jasperreports.engine.JRException: Error opening input stream from URL: http://localhost:8091/ReportServer/reportserver/fileServerAccess?id=371023.
	at net.sf.jasperreports.engine.util.JRLoader.getInputStream(JRLoader.java:290)
	at net.sf.jasperreports.repo.DefaultRepositoryService.getInputStream(DefaultRepositoryService.java:122)
	... 70 common frames omitted
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
	at java.net.Socket.connect(Socket.java:606)
	at java.net.Socket.connect(Socket.java:555)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:499)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:594)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:278)
	at sun.net.www.http.HttpClient.New(HttpClient.java:375)
	at sun.net.www.http.HttpClient.New(HttpClient.java:393)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1240)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1167)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1061)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:995)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1584)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1512)
	at java.net.URL.openStream(URL.java:1092)
	at net.sf.jasperreports.engine.util.JRLoader.getInputStream(JRLoader.java:286)
	... 71 common frames omitted

As you can see in the stack trace, the root cause is found in the lower part of the stack trace:

Caused by: java.net.ConnectException: Connection refused (Connection refused)

which is in fact the root cause of the problem.

In summary, the exception message ConnectException: Connection refused accurately reflects the root cause of the issue. The stack trace provides a detailed pathway leading to this error, which helps in diagnosing and addressing the problem.

Thus said, if you identify a place where we don't print the root cause of the message, pls don't hesitate to let us know.

Regards,
Eduardo

Offline

#12 2024-08-01 08:33:15

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Report images not visible for non-admin users

ianef wrote:

So again, with my simple report, no data source, add your own image via a TEST_LOGO global constant and it doesn't work when using 'hhtpauthexport'.

Hi ianef,

your simple report without datasource and with our own logo via TEST_LOGO global constant works with httpauthexport, pls refer to the following screenshot:

Bildschirmfoto-2024-08-01-um-10-20-10.png

Removing download=false also works: it downloads the pdf instead of displaying it inline. Again, the logo is visible.

Pls check your Tomcat logs for any error message, including your access logs.

We tested this using the latest 4.6.3 version.

Regards,
Eduardo

Offline

#13 2024-08-01 17:43:01

ianef
Member
From: UK
Registered: 2024-05-04
Website

Re: Report images not visible for non-admin users

Hi Eduardo

Did you try this is in a docker container? That's how I'm running the evaluation, or could it be an evaluation version issue? I don't know. All I can say 'lucky you' it works for you but not for me.

I can't emphasize more that this is a stumbling block in suggesting to my customer we implement ReportServer as a replacement for Jasper Report Server. I need to integrate the reports into their web based application so that I can serve up Jasper reports as part of that application.

I'll list here my docker file, build and run commands. Please use them to build a container and see if you have a problem or not.  I'd like to add them as an attachment to this post but I can't do that unless I upload them to a web server. Life is too short!

Dockerfile:
```
FROM infofabrik/reportserverenterprise:4.6.3.6104-standalone
LABEL "author": "<Ian Foulds>ianfoulds@x-act.co.uk", "description": "ReportServer evaluation"

USER root

RUN apt-get -q -y update

# SQL Server JDBC driver
ADD sqljdbc_12.6.3.0_enu.tar.gz .
RUN cp -p ./sqljdbc_12.6/enu/jars/mssql-jdbc-12.6.3.jre11.jar /usr/local/tomcat/webapps/ROOT/WEB-INF/lib/

EXPOSE 8080/TCP
```

docker build -t reportserverenterprise .

docker run -dt --name reportserver -p 8081:8080 reportserverenterprise

Last edited by ianef (2024-08-01 17:44:08)

Offline

#14 2024-08-02 09:06:53

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Report images not visible for non-admin users

Hi ianef,

we found out that this is a Jasper issue:

Lazy Loading Images
The isLazyflag attribute (see isLazy()method) specifies whether the image should be loaded and processed during report filling or during exporting. This can be useful in cases in which the image is loaded from a URL and is not available at report-filling time, but will be available at report-export or display time. For instance, there might be a logo image that has to be loaded from a public web server to which the machine that fills the reports does not have access. However, if the reports will be rendered in HTML, the image can be loaded by the browser from the specified URL at report-display time. In such cases, theisLazyflag should be set to true (it is false by default) and the image expression should be of typejava.util.String, even if the specified image location is actually a URL, a file, or a classpath resource. When lazy loading an image at fill time, the engine will no longer try to load the image from the specified String location but only store that location inside the generated document. The exporter class is responsible for using that String value to access the image at report-export time.

so it it enough to change this:

<image>
   <reportElement x="-3" y="6" width="197" height="56" uuid="73897af3-6bfb-4288-830c-ffb9dbda8523" >
      <property name="local_mesure_unitheight" value="pixel"/>
      <property name="com.jaspersoft.studio.unit.height" value="px"/>
   </reportElement>
   <imageExpression><![CDATA[$P{TEST_LOGO}]]></imageExpression>
</image>

to

<image isLazy="true">
   <reportElement x="-3" y="6" width="197" height="56" uuid="73897af3-6bfb-4288-830c-ffb9dbda8523" >
      <property name="local_mesure_unitheight" value="pixel"/>
      <property name="com.jaspersoft.studio.unit.height" value="px"/>
   </reportElement>
   <imageExpression><![CDATA[$P{TEST_LOGO}]]></imageExpression>
</image>

Setting this to isLazy="true" solves the HTML export problem.

As you are using docker, this will not work per-default, as the ports are different as you previously noted. We suggest either using a manual installation ( https://reportserver.net/de/dokumentati … -on-ubuntu ) or using a different port for HTML export and for PDF export.

Regards,
Eduardo

Offline

#15 2024-08-02 16:23:20

ianef
Member
From: UK
Registered: 2024-05-04
Website

Re: Report images not visible for non-admin users

Thanks Eduardo. I've reinstalled my docker container to use 8080 on the host and container. Adding isLazy="true" makes it work. Thank you.

I'm not sure I understand why, when the ports are the same i.e. 8080 as it is now, and the Global Constant uses 8080, it fails to render the image at report-filling time, as this URL is visible within the container.

I can run "curl http://localhost:8080/reportserver/fileServerAccess?id=5369" from within the container and it returns the image.

Many thanks for your patience.

Offline

#16 2024-08-05 06:26:10

Felix
Moderator
Registered: 2022-08-01

Re: Report images not visible for non-admin users

Hi Ianef,

ianef wrote:

I'm not sure I understand why, when the ports are the same i.e. 8080 as it is now, and the Global Constant uses 8080, it fails to render the image at report-filling time, as this URL is visible within the container.

On Dockercontainers there is an "outside port" connected to an "inside port".

If your reportserver renders your report as PDF (serverside rendering) he needs to access the internal url ==> 8080 in your case.

If you receive the report as html and display it outside your container (client side rendering) you need to refere to the outside port to get the image. In the responded html the url to the image has 8080 but 8080 isn't available from outside of the container... and it should be 8081 (for example)

So there are 2 possible solutions: Change the global constant to an url with the outside port OR change the outside port to the same as used inside of your container (8080:8080)

please have a look at publishing ports in docker


Softwareentwickler bei Infofabrik

Offline

Board footer

Powered by FluxBB