Jump to content
We've recently updated our Privacy Statement, available here ×

How can I create a data source from PHP code?


Recommended Posts

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 (JaspersoftExceptionRESTRequestException $e) {
            echo $e->getMessage();
        }

I hope if someone can help me.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...