KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

DataStore reset #1300

Closed thailon opened this topic on on Feb 13 - 6 comments

thailon commented on Feb 13

Hello KoolReport! Please, is there any way to reset DataStore? I literally list 5 the same charts with different data range from the same table, but I have to create 5 DataStores, 5 graphs :(

thanks! Peter

KoolReport commented on Feb 14

May be what you are looking for is the pipeTree() method. You still need to create 5 datastores but all datastores generated from same source. Meaning you do not need to query again.

thailon commented on Feb 17

Hi, thank you for your answer. I thought something different. My case: I need to show 5 graphs on the same page. Each graph: looks & and is the same (number of columns, style), has the same dataSource, but shows different data range from the same table. I have to create 5 dataStore(s) to handle different data (make sanse) and 5 the same looking graph definitions in view file (just because of those 5 dataStore(s). What do I look for: is there any change to have something like graph template I just fill with data? thanks!

KoolReport commented on Feb 17

Okay, another way is to use dataStore filter. For example, you store your data in a datastore $this->dataStore("main"), you can do filter for each chart like this


more on filter().

Hope that helps.

thailon commented on Feb 17

Thank you for very quick reply, yep, this saves dataStores count to one. But If I understand it correctly, you still have to have 5 graph definitions, just with filtered dataStore. Or generate graph definition in the loop of 5, right?

KoolReport commented on Feb 17

Yes, you make array with 5 different date conditions, then you can loop through conditions and create a chart per condition.

thailon commented on Feb 17

yes, this is it, many 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