Jump to content

Jasper Reports 3.1.7 to 4.50 , changes with JasperDesign.getDetail


sangeethakrishna

Recommended Posts

Hi ,

We are upgrading jasper reports 3.1.7 to 4.5.0. 

JasperDesign.getDetail

Code with Previous version: 

private JRDesignBand findBandForSubReport(JasperDesignBuilder jasperDesignBuilder, SubReport subReport) throws Exception
    {
                          return (JRDesignBand) jasperDesign.getDetail();
     }

Change i have done with 4.5.0:

 private JRDesignBand findBandForSubReport(JasperDesignBuilder jasperDesignBuilder, SubReport subReport) throws Exception
    {
            JRDesignSection jrDesignSection = (JRDesignSection)jasperDesign.getDetailSection();
            for(JRBand jrBand : jrDesignSection.getBands())
             {
                 if(jrBand instanceof JRDesignBand)
                 {
                     return (JRDesignBand)jrBand;
                 }
             }
     }

We are using same code for getHeaderSection, getFooterSection also.

Please let me clarify the how to get JRDesignBand  from JRDesignSection

Please check the code above, let me know is that the correct way of getting JRDesignBand  from JRDesignSection.

 

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...