Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jackradiance opened this issue Aug 5, 2022 · 1 comment

Comments

@jackradiance
Copy link

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

@paulwellnerbou
Copy link
Owner

Thank you, @jackradiance, for the suggestion.

I remember having tested this and it worked -- at least when I released this version first. But of course, this depends on the way you use Autoconfiguration and so on.

I am quite sure, there are better ways to do this plugin. I just created it because I needed to migrate an old application which was still using BIRT. Fortunately we got rid of BIRT now, so this is for me a legacy project without maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants