KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Empty PDF when exported using remote IP #2252

Open Aqila Nasir opened this topic on on Aug 10, 2021 - 6 comments

Aqila Nasir commented on Aug 10, 2021

Hi,

For context the application is up and running. It is deployed on apache webserver. We have managed to export charts to PDF using localhost address inside the server. But once we access the server using remote IP (from a different machine), it returns an empty PDF.

Sebastian Morales commented on Aug 11, 2021

Can your server access the report page via its own ip address? For example, you remote to the server and open/curl the report page https://<server_ip>/<report_uri> does it work?

Aqila Nasir commented on Aug 12, 2021

I cannot. The connection has timed out appears.

I also tried locally on my machine, after deployed on port 8080 for example, I use ngrok application to create a mirror url to access application from another computer. The PDF file is blank as well.

I think this problem is quite similar with this thread.

Sebastian Morales commented on Aug 12, 2021

Hi, pls open the file koolreport/export/Handler.php and replace the following line:

        $http_host = (!empty($_SERVER['HTTP_HOST']))?"$protocol://".$_SERVER['HTTP_HOST']:"http://localhost";

with these ones:

        $host = "localhost"; //or 127.0.0.1 or your server local ip
        $http_host = (!empty($host))?"$protocol://".$host:"http://localhost";

We will add an option for users to set their server local address in the next version of Export package. Let us know if this approach works for you. Tks,

Aqila Nasir commented on Aug 12, 2021

Thank you so much! It works. In my case, I also include the port number in $host.

Aqila Nasir commented on Aug 12, 2021

There is a new error when we try it on client server.

Web firewall security policies that are contrary to the response/request has been blocked.

Do I have to whitelist certain request to pass through the firewall?

Sebastian Morales commented on Aug 13, 2021

Does the firewall block the client's server's own request to its local ip or the client's PC's request to the server?

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Export