Jump to content

Overflow in Charts


deepthirohini86

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...

Hi,

Some time back, i had faced the same problem. But some how i investigated and got the expected result.

The approach is as follows:

Make the pageWidth="0" and report element width also "0". Please look into the below jrxml code.

<

jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="testChart" language="java" pageWidth="0" pageHeight="350" columnWidth="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">

<

reportElement key="graphWidthKey" x="0" y="0" width="0" height="300"/>

now write the code in java to set the width like the below way:

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());

JRElement element = jasperReport.getTitle().getElementByKey(

 

 

element.setWidth(width);

}

"graphWidthKey");if(element!=null){int width = list.size() * 60; // here list is the list of elements and 60 is the width for each element.

 

Link to comment
Share on other sites

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