Jump to content
We've recently updated our Privacy Statement, available here ×

grafro

Members
  • Posts

    26
  • Joined

  • Last visited

grafro's Achievements

  1. i solved my roblem by editing the tab stop width. i did not know that property. thanks a lot
  2. hello peter.w, thanks for your input! i want to render a printed report, pdf. the text values of VAR_% must not be line breaked. in the future, the number of so called columns could grow to 4 or 5, but for now 3 is enough. columns are not possible in my case. the text field is an element in the title band of the report and has a width of 3/5 of the total page width. I would love to use a table element with an add row function, based on fields without subdatasets... subreports are no option for me, i thought about a list element but the creation of a proper subdataset out of VAR_1 ... VAR_X is not so easy... I could use a rowbean with a string array as variable to represent the columns and build dynamically a list of those beans and use it as beandatasource for a list element, but thats also not very handy....
  3. i would use beans as data source and with the image as inputstream as variable. public class ImageBean { private InputStream image; public InputStream getImage() { return image; } public void setImage(InputStream image) { this.image = image; } public ImageBean(InputStream image) { this.image = image; }}[/code]Fill a list of ImageBeans to use it as data source and fill the report. ArrayList<ImageBean> beanList = new ArrayList<>();beanList.add(new ImageBean(InputStream image1));beanList.add(new ImageBean(InputStream image2));.......... jasperPrint jrPrint = JasperFillManager.fillReport( yourCompiledReport, yourParams, new JRBeanCollectionDataSource(beanList);......[/code]In the report template: Fill a field with the Inputstream and put a Image element in the detail section, filled with the image field. ....<field name="image" class="java.io.InputStream"/>.........<deail> . .. ... <image hAlign="Left"> <reportElement x="0" y="0" width="180" height="69" uuid="589367e3-c769-4d18-b053-0911a3d8f1e8"> <property name="local_mesure_unitheight" value="pixel"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <imageExpression><![CDATA[$F{image}]]></imageExpression> </image> ... .. .</detail>......[/code]theoreticaly, for every image in the BeanList, a detail band with the contained image should be printed. the code has to be seen as psoudo code, i didnt test it.
  4. Hello community I have the following problem.... I am filling a text field with a undefined number of lines because of null able variables. In the report template i solved this with a text field with the height of one line and enabled the attribute "Stretch With Overflow". If at runtime of the report two lines have to be rendered, the text field is stretched to two lines :) The text field is filled like that: ($F{VAR_1} != null ? ("Any text 1:t" + $F{VAR_1} + "tDate: " + $F{DATE_1} + "n") : "")+ ($F{VAR_2} != null ? ("Any text 2:t" + $F{VAR_2} + "tDate: " + $F{DATE_2} + "n") : "")+ ($F{VAR_3} != null ? ("Any text 3:t" + $F{VAR_3} + "tDate: " + $F{DATE_3} + "n") : "")+ ($F{VAR_4} != null ? ("Any text 4:t" + $F{VAR_4} + "tDate: " + $F{DATE_4} + "n") : "")[/code]so far, so good, the number of rows is totally fine. My problem is the formatting i the lines. I try to format the text with tabs, that is working good when all variables have the nearly same length (@picture: what i have: line 1&2). When the variable length is to small or to long i have formatting issues (@picture: what i have: line 3&4). I would need to figure out, how many tabs i need, to format the text properly (@picture: what i want) or it would be very nice to adopt the tab length. I tried to solve the problem with a htmlelement with a contained <table>, but that does not work so good... My only idea left is to make two text fields next to each other with the same printing conditions: Field 1: ($F{VAR_1} != null ? ("Any text 1:t" + $F{VAR_1} + "n") : "")+ ($F{VAR_2} != null ? ("Any text 2:t" + $F{VAR_2} + "n") : "")+ ($F{VAR_3} != null ? ("Any text 3:t" + $F{VAR_3} + "n") : "")+ ($F{VAR_4} != null ? ("Any text 4:t" + $F{VAR_4} + "n") : "") Field 2: ($F{VAR_1} != null ? ("Date: " + $F{DATE_1} + "n") : "")+ ($F{VAR_2} != null ? ("Date: " + $F{DATE_2} + "n") : "")+ ($F{VAR_3} != null ? ("Date: " + $F{DATE_3} + "n") : "")+ ($F{VAR_4} != null ? ("Date: " + $F{DATE_4} + "n") : "") [/code] I think this solution is very ugly... Any ideas how to solve the issue?
  5. there is a new project veraPDF http://verapdf.org/home/ it could be a very good project!
  6. Take a look at: http://community.jaspersoft.com/jasperreports-library/issues/5061
  7. could you please post your whole report (jrxml)? (inside a code block :) )
  8. if your report uses xml as data source, you should use the parameter ... byte[] xmlByteArr;org.w3c.dom.Document xmlDocument = JRXmlUtils.parse(new ByteArrayInputStream(xmlByteArr):parameters.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, xmlDocument);[/code]... to give the data source for the report. you can add the second xml as parameter to the report. byte[] secondXmlByteArr;org.w3c.dom.Document secondXmlDocument = JRXmlUtils.parse(new ByteArrayInputStream(secondXmlByteArr):parameters.put("p_second_xml", secondXmlDocument );[/code]be sure, thet the parameter p_second_xml ist defined as org.w3c.dom.Document[/code]in the report! (you can define that in the parameter properties in the field class) if you call now the subreport (be sure that the subreports query language is set to xpath, otherwise the parameters will not appear), you have to link the parameter p_second_xml to the parameter XML_DATA_DOCUMENT of your subreport. Subreportelement -> properties -> advanced -> parameters -> add -> Parametername: XML_DATA_DOCUMENT, expression: p_second_xml[/code]now, the datasource of the subreport should be the second xml
  9. You should define your field as Integer or Double and not as String, if it is a number! after that, its easy define a new variable with calculation operation sum, increment type none and reset type report. i think the expression should be your field ( $F{XYZ} ), the initial value expression should be 0 value class name should be java.lang.Float or java.lang.Integer, depends on your data if your field will stay a String try the expression $F{XYZ}.replace(".", "")
  10. have yout tried to set parameters like: parameters.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, "yyyyMMdd");parameters.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, "#,###,##0.##");parameters.put(JRXPathQueryExecuterFactory.XML_LOCALE, Locale.ENGLISH);[/code]I had the same problem, i wanted to render a german report based on an english xml! (thats the point!) My REPORT_LOCALE was GERMAN. parameters.put(JRParameter.REPORT_LOCALE, Locale.GERMAN);[/code]
  11. Hey hozawa, thanks for your reply! yes i did: ......configuration.setTagged(true);configuration.setPdfaConformance(PdfaConformanceEnum.PDFA_1A);...... [/code] greeting paul
  12. Hey guys, is there any PDF/A-3A validator for Java? I would like to validate them in unit tests... Thanks for reply
  13. There is an option of defining 'Return Values' take a look here: http://community.jaspersoft.com/questions/534659/how-return-value-subreport
  14. Hey, long ago but unanswered ICC Profiles are color profiles (*.icc), i always user a profile from this site: http://www.color.org/srgbprofiles.xalter (sRGB v2) The font problem is a different one: see here http://community.jaspersoft.com/questions/863786/no-can-generate-pdfa-jasperreports-61-java-app-how-i-can
×
×
  • Create New...