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

andre2k2

Members
  • Posts

    17
  • Joined

  • Last visited

andre2k2's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Now i'am using this renderer: Code: public class BarbecueRenderer extends JRAbstractSvgRenderer { /** * */ private Barcode barcode = null; private static final int DEFAULT_BAR_WIDTH = 1; private static final int DEFAULT_BAR_HEIGHT = 37; public BarbecueRenderer(Barcode barcode) { this.barcode = barcode; this.barcode.setBarWidth(DEFAULT_BAR_WIDTH); this.barcode.setBarHeight(DEFAULT_BAR_HEIGHT); this.barcode.setDrawingText(false); } public void render(Graphics2D g2d, Rectangle2D rect2d) throws JRException { if (barcode == null) { return; } double scaleX; double scaleY; Rectangle r = this.barcode.getBounds(); scaleX = rect2d.getWidth() / r.getWidth(); scaleY = rect2d.getHeight() / r.getHeight(); try { AffineTransform oldTF = g2d.getTransform(); AffineTransform scaler = AffineTransform.getScaleInstance(scaleX, scaleY); g2d.transform(scaler); this.barcode.draw(g2d, (int) (rect2d.getX() / scaleX), (int) (rect2d.getY() / scaleY)); g2d.setTransform(oldTF); } catch(OutputException e) { throw new JRException(e); } } public Dimension2D getDimension() { return this.barcode.getBounds().getSize(); } } Into my xml I this is the code: Code:[code] <image hAlign="Center" scaleImage="RetainShape"> <reportElement height="36" positionType="Float" width="291" x="31" y="101"/> <graphicElement/> <imageExpression class="net.sf.jasperreports.engine.JRRenderable"> <![CDATA[new br.com.datamanager.geradorrelatorio.renderers.BarbecueRenderer( net.sourceforge.barbecue.BarcodeFactory.createInt2of5($P{CODIGO_BARRAS}) )]]> </imageExpression> </image> Well... now when the application call JasperViewer first time barcode is rigth, but if i resize the window then barcode resizes.. and reduce, reduce... then it disappear... :blink: Someone can help me? What is happen? Post edited by: andre2k2, at: 2007/08/10 17:31
  2. hello... I am using barbecue library to generate barcodes into my reports... I set bar width to minimum size (1 pixel)... but the result is to large yet... how can i resize and reduce more?
  3. There is any way to do jasper do not write "null" when the query field is null?
  4. I have an application that needs to especify what printer the reports will be print... But JasperReports just print showing the PrintDialog, or printing with default printer... There are any way to print with a printer that application chooses?
  5. The problem happens when call compileReportToFile()
  6. Im with problems passing an image (java.awt.Image) in my JRXML the code is: Code: <image hAlign="Center" scaleImage="RetainShape" vAlign="Middle"> <reportElement height="80" width="149" x="10" y="0"/> <graphicElement stretchType="RelativeToTallestObject"/> <imageExpression class="java.awt.Image"><![CDATA[$P{Logomarca}]]></imageExpression> </image> then in java i do: Code:[code] Map<String, Object> parametros = new HashMap<String, Object>(); parametros.put("Logomarca", logomarca); but this error message is show: Report design not valid : 1. Parameter not found : Logomarca ???????????????
  7. Im with problems passing an image (java.awt.Image) in my JRXML the code is: Code: <image hAlign="Center" scaleImage="RetainShape" vAlign="Middle"> <reportElement height="80" width="149" x="10" y="0"/> <graphicElement stretchType="RelativeToTallestObject"/> <imageExpression class="java.awt.Image"><![CDATA[$P{Logomarca}]]></imageExpression> </image> then in java i do: Code:[code] Map<String, Object> parametros = new HashMap<String, Object>(); parametros.put("Logomarca", logomarca); but this error message is show: Report design not valid : 1. Parameter not found : Logomarca ??????????????? Post edited by: andre2k2, at: 2007/06/28 13:45
  8. Im using Barbecue to create barcodes... i saw in the sample this code: Code:<imageExpression class="net.sf.jasperreports.engine.JRRenderable"> new net.sf.jasperreports.renderers.BarbecueRenderer(BarcodeFactory.createCode128B("1234567890"«»)) </imageExpression> But when i try to find the class "BarbecueRenderer" it not exists :blink: I downloaded the barbecue .jar and included in my classpath... Then where is BarbecueRenderer??? Post edited by: andre2k2, at: 2007/06/27 14:18
  9. Nobody knows? Did you understand my question?
  10. i solved the problem... the printOrder attribute was wrong... then i changed to vertical and works fine!!! Thank you all, guys!!
  11. I'd like to know if jasper print manager offers any support to print reports with matrix printers... i know it prints, i did some testes, but the printer prints as an image... its to slow... there is a way to send those hard codes to printers to print as text?
  12. Nick wrote: Try setting a query in your master report. Then the subreport will be generated the same number of rows in the query result set. Also, try changing the some settings in the tutorial subreport sample. Hope this helps. I did it... but nothing happens :( The problem persists!!!
  13. I saw the subreport sample (http://www.jasperforge.org/images/documentation/jasperreports/samples/MasterReport.pdf) of the tutorial is exactly what i want to do... but i do not undertand how is the diference... why example code works... and why my code do not???
  14. arunvishvin wrote: Is the second part of the report the subreport or the whole code is the second report. The second part is the report... and the first is the subreport...
×
×
  • Create New...