How can I create a data source from PHP code?

0

I want to create a data source from my PHP code, because I want to create dynamics connections.

The parameters that I think that I need are: HOST, Driver, password, user, instancie.

So, I don't know if it can be possible, right now ,I know how I can create a report with the jrxml and datasource (but in this case the DataSource already exists)

try {
            $report = new ReportUnit;
            $report->label = "file5Report";
            $report->description = "file5Report";
            $report->jrxml = "/reports/Tests/report.jrxml";
            $report->dataSource = "/datasources/myConnection/Conex";
            $c->repositoryService()->createResource($report, "/Folder", true);
        } catch (\Jaspersoft\Exception\RESTRequestException $e) {
            echo $e->getMessage();
        }

I hope if someone can help me.

isai.maldonado.reyes's picture
Joined: Nov 13 2019 - 8:31am
Last seen: 3 weeks 1 day ago

0 Answers:

No answers yet
Feedback
randomness