KoolReport's Forum

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

Assets location change without extending \Koolreport #610

Open gkurl opened this topic on on Jan 23, 2019 - 2 comments

gkurl commented on Jan 23, 2019

Hey Guys,

In order for Koolreport to fit within our business logic, it currently generates and runs a report in-line by instantiating an object of type PDODatasource configured to a database connecting that may be different depending on who's logging in (so not hardcoded DB connection values).

We essentially generate the connection, render the report and then retrieve the HTML generated by the report to use - we need the assets to be read in from another public directory that lives elsewhere on our network.

I've seen the documents and can see calling function settings() is the way you recommend, but you have to extend from class \Koolreport - as our code is in-line we don't have a class that handles Koolreport settings or setup.

How would you suggest we go about defining Assets without overloading the function settings()? Or is there another way to define assets?

Thanks.

KoolReport commented on Jan 23, 2019

Hi,

A report is able to receive parameters, please refer to topics How to pass paremeters to report. You may transfer the db connection through paramters. And in the settings() function, you can get those params through $this->params in order to setup the connection.

So instead of creating PDODataSource with custom connection parameters, you pass those parameters to report on initiation.

gkurl commented on Jan 31, 2019

Hi,

Ok thanks i think we have a workaround now. Do you guys support custom hooks for rendering data that we choose to send in - from what I can tell, the render() method looks for a view.php file. Is there any way of specifying a different source of data into this function - is this something that can be done on the enterprise license?

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

None