Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6690505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:38:42+00:00 2026-05-26T05:38:42+00:00

I am using groovy-grails with jasper reports to develop an app. I need to

  • 0

I am using groovy-grails with jasper reports to develop an app. I need to lookup ‘report bean’ based on its parameter (like reportname /id retrived from database, which I will get from customer click) – which will be stored as a property of report bean from resources.xml into either the reportcontroller or reportservice. Also I have to ‘get’ the jrxml template related to this id and the parameter Map, both defined as properties in the bean. I need to know like how can we achieve this and do we need to define any ‘managing beans’ in the xml which manage these report beans.
So for example the report bean will look like as follows:

     <bean id="DeptReport" class="com.myapp.reporting.domain.Report">    
        <property name="reportName" value="Dept Report"/>
        <property name="reportFiles">
          <map>
            <entry key="JasperPrint" value="DeptRoles.jrxml"/>
          </map>
        </property>
        <property name="promptforparameter" value="true"/>
        <property name="parameter" value="department_id"/>
        <property name="displayName" value="report.deptReport.name"/>
     </bean>

There will be many beans like this.

Also the .jrxml file for all reports are stored in a directory and I want to wire that location into the reporting context so that whenever a report is clicked on the front end I want to look up these values from the context into the report service/controller to generate the report. I know we have to do like a ctx.getbean(reportId) somewhere but I also want to know how to setup a manager bean with some other properties like template location, datasource, parameter map, reportid and a jasperreportrenderrer object. So this ReportManager bean is loaded reused every time there is a call for another report and persisted across a user session ideally.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:38:42+00:00Added an answer on May 26, 2026 at 5:38 am

    You should be able to do something like this:

    import org.springframework.context.*
    
    class MyService implements ApplicationContextAware {
      ApplicationContext applicationContext
    
      def getBeanByName( String name ) {
        applicationContext.getBean( name )
      }
    }
    

    That’s in a grails Service class, but the same should hold true for a controller

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jasper reports and groovy/grails and i want to export report in
I'm using Groovy 1.8.3 (in Grails 2.0). I need to declare some float arrays,
I'm using the Grails Jasper report plugin in my application. Im trying to bind
We are using grails-groovy with Hibernate, I have a SQL query like this in
From the book Groovy and Grails recipes I'm using the following code snippet: String
I am working on a project using Groovy, and I would like to take
I've developed a simple webflow in Grails (mostly to experiment with using webflows- its
I am using groovy/grails, and I have a ResultList in my service which I
I have been using Grails for the past few months and I really like
I am using the current version of SpringSource Tool Suite with the Groovy/Grails plugin

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.