Jump to content
JasperReports Library 7.0 is now available ×

printing problem


Recommended Posts

By: Stefan Peeters - spetters

printing problem

2002-11-22 01:37

Hi,

 

In the following piece of code I am trying to display a text with a black background.

 

JasperPrint jasperPrint = new JasperPrint();

jasperPrint.setName("ProsperPrint");

JRPrintPage page = new JRBasePrintPage();

 

// create the text element

JRPrintText headerText3 = new JRBasePrintText();

headerText3.setX(200);

headerText3.setY(95);

headerText3.setWidth(120);

headerText3.setHeight(20);

headerText3.setTextAlignment(JRTextElement.TEXT_ALIGN_LEFT);

headerText3.setAbsoluteLineSpacing(18f);

 

// We set the background color to black

headerText3.setBackcolor(new Color(0x00, 0x00, 0x00));

 

headerText3.setFont(normalFont);

headerText3.setForecolor(Color.white);

headerText3.setText("Street");

page.addElement(headerText3);

jasperPrint.addPage(page);

 

This works fine when exported to an excell sheet, but when I try to send it to a printer it doesn't show the black background!!!

When changing the foreground color of the text element to black, it gives me a black rectangle in Excell, which is correct. But when send to the printer, it shows the black text with a white? background!

 

I this a bug? Or am I doing something wrong?

All ideas are welcome...

 

Ciao,

 

Stefan Peeters.

 

 

 

 

By: Teodor Danciu - teodord

RE: printing problem

2002-11-22 08:14

 

Hi,

 

headerText3.setMode(JRElement.MODE_OPAQUE);

 

I hope this helps.

Teodor

 

 

 

By: Stefan Peeters - spetters

RE: printing problem

2002-11-26 06:59

Thanks it does!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...