KoolReport's Forum

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

How to close datastores and release memory? #1931

Open Richb201 opened this topic on on Feb 27, 2021 - 1 comments

Richb201 commented on Feb 27, 2021

I am having an issue elsewhere in my code and thought it might be a good idea to close koolreport assets at the end of a session. How?

David Winterburn commented on Mar 1, 2021

Hi,

Once a report page is rendered and returned all of report's datastores and variable will be cleared by PHP and web server. In case you want to clear a datastore's memory in the middle of a report rendering (in its view or after that) you could try the following command:

    //MyReport.view.php or some page include it
    $this->dataStore("myDatatstore)->data([]); // set its data to be an empty array

    $this->dataStore("myDatatstore)->meta([]); // set its meta to be an empty array

Let us know if we understand your question correctly. Thanks!

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
None yet

None