deepthirohini86 Posted November 10, 2009 Share Posted November 10, 2009 Code:Hi Friends, My query returns 1000 result at a time, how can i show all the datas in the chart in a fixed width, Kindly help me in this .... How to show all my result in the chart. Regards, Rohini A.M Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted November 10, 2009 Share Posted November 10, 2009 Not sure what you mean in terms of "a fixed width". Can you elaborate on that?Giulio Link to comment Share on other sites More sharing options...
deepthirohini86 Posted November 27, 2009 Author Share Posted November 27, 2009 Hi Sir, Say i am using one chart , i am giving the width for the chart as 1000 as width size i can display only 50 bars at a time , how can i set the width of the chart as dynamic , is there is any way , depending upon my query result i need to set the width. With Regards,Rohini A.M Link to comment Share on other sites More sharing options...
raj_mokara Posted November 30, 2009 Share Posted November 30, 2009 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now