Skip to content

additional config required in order to use the grails datasource in reports #4

@jackradiance

Description

@jackradiance

After setting useGrailsDatasource to true in the application.groovy birt configuration, I got an error saying that the dataSource was null. I was able to fix this by adding a line to the bean definition in resources.groovy (step 2 of the readme setup instructions)

birtReportService(BirtReportService, grailsApplication) {
    dataSource = ref('dataSource')
}

I figured this out by reading this stackoverflow answer:

https://stackoverflow.com/questions/21491074/grails-getting-the-data-source-in-a-normal-groovy-class

The author of the stackoverflow answer mentions that there are a couple of other alternative solutions that I believe could be implemented using either applicationContext or grailsApplication in BirtReportService.groovy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions