KoolReport's Forum

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

ExportToXLSX to saveAS() #1499

Open sevgi opened this topic on on Jun 23, 2020 - 5 comments

sevgi commented on Jun 23, 2020

save the prepared excel report to the server without downloading the browser

David Winterburn commented on Jun 24, 2020

It's possible to use saveAs() after exportToXLSX() to save the exported excel files on your server, just like exportToExcel().

sevgi commented on Jun 24, 2020

Could not save file ; return false;

David Winterburn commented on Jun 24, 2020

Did you try toBrowser("report.pdf") first to see if the file exported correctly? If the file did export,there could be a permission problem with the path you tried to save the file as. Please make sure that your php user on your server has the write permission for that path.

Please try to run this php script to see if it works on your server:

<?php
//testCopy.php
        if(copy($pathOfExistedFile, $pathToSaveAsFile)) {
            echo "Can copy to $pathToSaveAsFile";
        } else {
            echo "Can NOT copy to $pathToSaveAsFile";
        }

Let us know the result. Thanks!

sevgi commented on Jun 24, 2020

I just want to upload excel to the / attachment folder on the server. browser will not save.

David Winterburn commented on Jun 24, 2020

The exported file is created on your server where you host koolreport. saveAs($path) just copies the created file to your desired path. There's no upload here. toBrowser($name) is downloading the created file to your browser. If toBrowser() works while saveAs() doesn't it means that the file is created but can not be copy to your path on 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