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

noxmldesign - html not displaying properly


Recommended Posts

By: Enrico Goosen - enricogoosen

noxmldesign - html not displaying properly

2003-05-09 08:09

Hi,

 

I created a jasper report using the noxmldesign app as an example.

Problem:

The rectangle elements are not displaying in HTML. Here's my code:

JRDesignRectangle rectangle = new JRDesignRectangle();

rectangle.setX(x);

rectangle.setY(y);

rectangle.setWidth(pageWidth);

rectangle.setHeight(columnHeight);

rectangle.setForecolor(new Color(0xC0, 0xC0, 0xC0));

rectangle.setBackcolor(new Color(0xC0, 0xC0, 0xC0)); rectangle.setStretchType(JRDesignRectangle.STRETCH_TYPE_NO_STRETCH);

band.addElement(rectangle);

 

Also...my fonts are not working:

Here's some code:

JRDesignReportFont normalFont = new JRDesignReportFont();

normalFont.setName("Arial_Normal");

normalFont.setDefault(true);

normalFont.setFontName("Arial");

normalFont.setSize(12);

normalFont.setPdfFontName("Helvetica");

normalFont.setPdfEncoding("Cp1252");

normalFont.setPdfEmbedded(false);

jasperDesign.addFont(normalFont);

JRDesignStaticText staticText = new JRDesignStaticText();staticText.setX(0);

staticText.setY(5);

staticText.setWidth(375);

staticText.setHeight(35);

staticText.setTextAlignment(JRTextElement.TEXT_ALIGN_LEFT);

normalFont.setSize(22);

staticText.setFont(normalFont);

String title = (String)parameters.get(EvaluationReportRenderer.REPORT_MAIN_TITLE);

staticText.setText(title);

band.addElement(staticText);

 

Any help would be greatly appreciated!

 

thanks,

Enrico

 

 

 

 

By: Teodor Danciu - teodord

RE: noxmldesign - html not displaying properly

2003-05-10 12:45

 

Hi,

 

Before the 0.4.6 version, lines and rectangles were

simply ignored by the HTML exporter.

Now they should appear also in HTML and XLS

format, but only if they do not overlap with other

elements on the page.

 

The built-in "grid" exporters like the HTML and the

XLS exporters do not know how to treat overlapping

elements.

So if you have some background rectangles placed

behind other text elements, they will not appear in HTML.

 

What is the problem with the fonts?

The supplied "noxmldesign" seems to work on your

platform, doesn't it?

 

Thank you,

Teodor

 

 

 

 

 

By: Enrico Goosen - enricogoosen

RE: noxmldesign - html not displaying properl

2003-05-12 00:32

Your example seems to work fine even though the text is overlapping the rectangle? Here's your code:

JRDesignBand band = new JRDesignBand();

band.setHeight(20);

JRDesignRectangle rectangle = new JRDesignRectangle();

rectangle.setX(0);

rectangle.setY(4);

rectangle.setWidth(515);

rectangle.setHeight(15);

rectangle.setForecolor(new Color(0xC0, 0xC0, 0xC0));

rectangle.setBackcolor(new Color(0xC0, 0xC0, 0xC0));

rectangle.setStretchType(JRGraphicElement.STRETCH_TYPE_NO_STRETCH);

band.addElement(rectangle);

JRDesignTextField textField = new JRDesignTextField();

textField.setX(0);

textField.setY(4);

textField.setWidth(515);

textField.setHeight(15);

textField.setBackcolor(new Color(0xC0, 0xC0, 0xC0));

textField.setMode(JRElement.MODE_OPAQUE);

textField.setTextAlignment(JRTextElement.TEXT_ALIGN_LEFT);

textField.setFont(boldFont);

expression = new JRDesignExpression();

expression.setValueClass(java.lang.String.class);

expression.setText("" " + String.valueOf($V{CityNumber}) + ". " + String.valueOf($F{City})");

textField.setExpression(expression);

band.addElement(textField);

 

With regard to the fonts, I'm define the font on the top of the report, then I change the size for different parts of the report by calling :

normalFont.setSize(22); //for the Report Title

Is this wrong?

 

Regards,

Enrico

 

 

 

 

By: Enrico Goosen - enricogoosen

RE: noxmldesign - html not displaying properl

2003-05-13 04:24

Hi Teodor,

 

I fixed the problem with the rectangle not displaying, by setting a foreColor and backColor to the staticText.

With regards to fonts, it seems that you can't call setSize more than once on a font.

 

Enrico

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...