ml.francis Posted July 26, 2020 Share Posted July 26, 2020 Hi, I want to create a text field where multiple lines can be possible depending on the text passed to it from the database, sometimes the text can be long so more than 1 line is required. I did some digging in google and it seems that I should check some property called "stretch with overlow" in the field properties, but I clicked my field and checked properties and that "stretch with overflow" property/checkbox is nowhere to be found in Jasper Studio. All I can find is Detail Overflows, Stretch Type, and Text Adjust. None of those solved my problem. I tried using Text Adjust and selected the Stretch Height property, it seemed to be the closest to what I want but an error comes up when I generate my report in my Java app:Parse Error at line 233 column 42: cvc-complex-type.3.2.2: Attribute 'textAdjust' is not allowed to appear in element 'textField'.am I doing something wrong? I need a dynamic text field to display my data and adjust it's height depending on the length of the text passed to it. How can I do this in Jasper Studio? Thanks. Link to comment Share on other sites More sharing options...
luked Posted July 26, 2020 Share Posted July 26, 2020 I am interested in what your error means too. I recently upgraded to 6.13.0 from 6.6.0 and all reports I had made in 6.6.0 that are imported to 6.13.0 now have the same error message you are getting -"Parse Error at line 233 column 42: cvc-complex-type.3.2.2: Attribute 'textAdjust' is not allowed to appear in element 'textField'."I have to change the line in the source to read </textField> for my report to run now. Link to comment Share on other sites More sharing options...
ml.francis Posted July 27, 2020 Author Share Posted July 27, 2020 I solved it by getting the new Jasper Report .jar file and the latest version of commons collections .jar file. I get to run the report in intelliJ but when I run it from the executable .jar file the whole JPanel doesn't load at all. I tried to narrow down the problem it seems that if I compile a jasper report the jpanel in my java app just won't load. I still don't know what's wrong, I'm guessing it's another compatibility issues with the .jar libraries but I updated all the commons .jar and no luck, the jpanel still doesn't load in the executable .jar file. but if I comment out the compile line in my code the jpanel loads. Strange.. I wonder if anyone knows the answer to this..this is my code:JRDataSource jrDatasource = new JRBeanCollectionDataSource(dataSource);JasperReport report = null;try { //InputStream url1 = getClass().getResourceAsStream("./giovanni_requisitionslip.jrxml"); //JasperDesign dis = JRXmlLoader.load(url1); report = JasperCompileManager.compileReport(getClass().getResourceAsStream("giovanni_requisitionslip.jrxml")); //report = JasperCompileManager.compileReport(dis); JasperPrint filledReport = JasperFillManager.fillReport(report, parameters, jrDatasource); pnl_center.add(new JRViewer(filledReport), BorderLayout.CENTER); pnl_center.repaint(); pnl_center.revalidate();} catch (JRException jrException) { jrException.printStackTrace();} 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