andrewloable / node-jasper-server

Host Jasper Reports in NodeJS
MIT License
9 stars 6 forks source link

Is there a way to pass jrxml file path when calling the API routes? #3

Open martinmurciego opened 6 years ago

martinmurciego commented 6 years ago

There is a way to pass that setting.json as a parameter in the route or simply pass the name and path of the report file when you want to generate the output of the report by the API?

Is there a way to pass the path of the jrxml file when calling the API routes as it was said that there is a static configuration file called setting.json?

{
    "reports":{
        "test1": {
            "jrxml": "/jrxml/test.jrxml"
        },
        "test2": {
            "jrxml": "/jrxml/test2.jrxml",
            "subreports":{
                "parametername1": {
                    "jrxml": "/jrxml/test2subreport1.jrxml"
                }
            }
        }
    },
    "drivers": {
        "postgresql": {
            "path": "/libs/postgresql-42.2.1.jar",
            "class": "org.postgresql.Driver"
        }
    },
    "connections": {
        "mytestdatabase": {
            "jdbc": "jdbc:postgresql://localhost:5432/mytestdatabase",
            "user": "myusername",
            "password": "mypassword"
        }
    }
}
andrewloable commented 5 years ago

yes it can be done by modifying the index.js file and add the jrxml file and its sub reports as a parameter instead of getting it in a static configuration file.