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

nockdg

Members
  • Posts

    19
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by nockdg

  1. Hi. The printer settings have been configured correctly within the printer driver within Windows and set as the default parameters for this printer. When the JasperPrint process shows the print dialog, it is not using the previously configured settings within the driver. We are creating the report via the Java API (no jrxml file) and sending the report directly to the printer via JasperPrintManager.printReport(...).
  2. Hi, We use JasperReports for printing labels on various single label printers like Brother, Zebra. A customer has an issue where the printer settings shown do not match what is set in Windows as their default settings. This means that every time they need to print, they have to reset the various options on the printer dialog. They have tested a similar process in Microsoft Word and all the settings behave correctly. Has anyone else seen anything like this? The printer in question is a Zebra ZD421. Thanks for any help.
  3. Hi, Is there a way to automatically truncate text to fit the textfield? I have a textField that allows space for 2 lines, but if the supplied text is long enough for 3 lines then nothing is printed in the textField. I could use FontMetrics to determine how many characters would fit and then substring the data but was hoping there might be a way to do this automatically in Jasper. Thanks, Dave
  4. Hi, We are experiencing a strange problem trying to print barcodes from the Mac. Everything works fine on Windows, however, on the Mac: Preview shows barcode fineSaving PDF via jasper shows barcode fine and pdf prints correctlyPrinting report excludes barcodeSaving PDF Mac Printer dialog excludes barcodesThis report also includes a second image directly from a field, which prints fine on the Mac. The barcode is generated via zxing and written to a ByteArrayOutputStream as a png. This is added to the report as an image object. This issue has been reproduced across different printers and on the latest jasper library. There are no error message reported in he log. I've also tried generating the barcode slightly smaller than the bounding region to ensure it doesn't get clipped. My Mac is currently running 10.12.6 with java 8. Thanks, Dave Posted test case to SO: https://stackoverflow.com/questions/46677547/jasperreports-not-printing-barcodes-on-mac-os-x
  5. Hi, I have a problem with rendering some reports under 6.3.1 where the previewer gives the error 'Error displaying report page. See the console for details.'. However, there are no details on the console. I have tracked the problem to rendering of images. Previously I was using a class extending JRAbstractSvgRenderer but have changed to extending AbstractRenderToImageDataRenderer. However neither are working. I can see the constructor being called but it never enters the render method. I suspect then that the problem lies in the adding of the element to the report. Unfortunately there don't seem to be any examples of this using the API. I have seen a similar previewing error when using a JRDesignComponentElement, which was resolved by adding a call to setComponentKey(). However there is nothing similar for the design image. My basic function looks like: public static void addImageToRowDetailBand(JRDesignBand band, String aData, int offsetX, int offsetY, int width, int height) { JRDesignImage imageField = new JRDesignImage(null); imageField.setX(offsetX); imageField.setY(offsetY); imageField.setWidth(width); imageField.setHeight(height); imageField.setHorizontalAlignment(HorizontalAlignEnum.CENTER); JRDesignExpression expression = new JRDesignExpression(); String aLabelExpression = "new generateMyImage("+aData+")"; expression.setText(aLabelExpression); imageField.setExpression(expression); band.addElement(imageField);}[/code]where generateMyImage is class extending AbstractRenderToImageDataRenderer. Thanks, Dave
  6. Hi, Previously we have been rendering barcodes via an image but after upgrading Jasper to 6.3.1 (from 4.x) this has broken, so I have changed to using the barcode components. Most of this is working well except that I cannot see how to set the alignment of the barcode. I need to be able to centre a barcode with the element. We have some reports as jxrml so we are using a componentElement with c:barbecue, as per the example. For the our dynamically generated reports, we are using a JRDesignComponentElement with StandardBarbecueComponent. Thanks, Dave
  7. I've tried different fonts and sizes and haven't found a combination that works. <elementGroup> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="0" y="20" width="90" height="18" stretchType="RelativeToTallestObject"/> <textElement> <font fontName="Calibri" size="11" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Status:"]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="100" y="20" width="400" height="18" stretchType="RelativeToTallestObject"/> <textElement> <font fontName="Calibri" size="11" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["ABCDE"]]></textFieldExpression> </textField></elementGroup>[/code]The report consists of about 15 rows of data formatted as above. The problem only occurs with a couple of fields and the only difference I can see is that the data has a higher proportion of capital letters. The fields in each row are all exactly the same size. Some rows have much longer data and that all displays fine in the pdf. Thanks Dave
  8. Hi, We are experiencing a strange problem with text wrapping when saving as a PDF. The print preview is fine. e.g. ABCDE appears as ABCD E The field is large enough to hold all the required data. If I set the field to be bold or lower-case the data, it appears fine in the PDF. I've also tried setting the linebreak policy using: jp.setProperty("net.sf.jasperreports.export.pdf.force.linebreak.policy", "true");[/code]Currently using JasperReports 4.1.1 and can't update at the moment. Thanks, Dave
  9. Thanks, but isn't that what Barcode4J provides? To clarify: Currently we have a number of reports that are generated via the Java API only and the barcodes are generated by Barbeque. I want to change over to Barcode4J to use make use of some of its features. The JasperReports provided example for Barcode4J only shows how to set this directly in the XML. What I am looking for is an example of setting this via the Java API. Thanks, Dave
  10. Hi, I am looking to change our barcode generation from Barbeque to Barcode4J. Is there a java api example around anywhere for this? Currently using jasperreports 4.1.1 but can upgrade if necessary, Cheers, Dave
  11. Hi, I've just updated our JasperReports library from 2.0.4 to 4.1.1 and so far it has mostly gone ok. I now see a lot of deprecation warnings related to JRDesignExpression.setValueClass. Is this no longer necessary or is there something else that we should be calling? Thanks Dave
  12. Hi, Is it supposed to be possible to print a variable in a page header? Using the same variable in a page footer works perfectly. This report is created using the JAVA API and basically the header and footer bands are created using the same code except one calls setPageHeader and the other setPageFooter, obviously. Tested in JP 4.0.1. Thanks Dave
  13. Hi, We have a report that gets printed 4 to a page which has an included subreport. If the number of rows in the subreport exceeds the space, then it just continues printing outside the subtable bounds. Is it possible to set a max number of rows for a subtable so that it automatically starts a new row? Is this possible with the newer table component? I don't want to break to a new page, just the next row on the page and replicate the information outside the subreport. This is all in java, dynamically creating reports. Thanks.
  14. We have a set of reports that are dynamically generated in Java code and so I have a function that can save the JasperDesign to a jrxml file. Previously this was just: JasperDesign jd = ... try { String classContent = net.sf.jasperreports.engine.design.JRClassGenerator.generateClass(jd); java.io.File f = new java.io.File(aFile); java.io.FileOutputStream fos = new java.io.FileOutputStream(f); fos.write(classContent.getBytes()); fos.close(); } catch (Exception e) { e.printStackTrace(); } But now with JasperReports 3, this does not exist. The new version requires a JRSourceCompileTask which in turn requires a number of additional objects. So far I haven't found the correct incantation to get this working. Can anyone help or is there an easier way? Thanks.
  15. Yep, that works nicely. Is it then possible to detect that the user actually printed the report rather than canceling the print dialog? Thx
  16. Hi, We use the JRViewer class to display reports to users. What we need to be able to do is detect if they have clicked print from here. Is this possible? As btnPrintActionPerformed is not public we can't override it and still call the super code. Thx
  17. Is there any way to specify where to starting printing from for a repeating report? i.e. We have a report that is 3 col x 10 rows and we want to start printing from cell 5. The reports have been created in JasperAssistant so we are just loading the jrxml files. We also have a few reports that we generate completely in code and in this case I have managed to solve this by extending JRResultSetDataSource. Is there an easier way to do this other than modifying all our reports? Thanks Dave
×
×
  • Create New...