Style Library problem

Hi,

I have defined some styles in the style library of iReport 1.2.5.

When I drag a style of the style library onto a static textfield or a textfield not all style attributes of the style are applied. Not applied for example are font size and font type. Only font styles (bold, italic etc.) are correctly transferred to the element. The same problem exists when I set the style with th combobox of in the element's property dialog.

Is this a bug or do I miss something?

Kind regards

Thomas Gülden
Munich, Germany
tgutgu's picture
96
Joined: Aug 1 2006 - 11:04pm
Last seen: 16 years 4 months ago

3 Answers:

I'll take a look at it.

Thanks

Giulio
giulio's picture
67626
Joined: Jan 2 2007 - 4:15pm
Last seen: 2 years 9 months ago
Hi,

Almost the same happens to me. I'm using style library of iReport 1.2.7.

When i drag'n'drop style from library onto textfield, save and look into jrxml code, then all is as it should be, but then when i change the same style in library and drag'n'drop it onto the same textfield, my change doesn't apply.

Example: style:
<style
name="mainTitle"
isDefault="false"
fontName="Serif"
fontSize="14"
isBold="true"
pdfFontName="Times-Bold"
pdfEncoding="Cp1250"
isBlankWhenNull="true"
/>
and then i change horizontal align, drag'n'drop and the style is the same as above, i don't see 'hAlign="Center"' there.

Little workaround is to delete this style definition in jrxml code, save, reload in iReport and drag'n'drop again, and it's as it should be:
<style
name="mainTitle"
isDefault="false"
hAlign="Center"
fontName="Serif"
fontSize="14"
isBold="true"
pdfFontName="Times-Bold"
pdfEncoding="Cp1250"
isBlankWhenNull="true"
/>

But it isn't pleasant and fast to do this with 40 reports.
Please help.
Nico's picture
26
Joined: Nov 13 2006 - 10:22pm
Last seen: 16 years 3 weeks ago
Nico wrote:
But it isn't pleasant and fast to do this with 40 reports.


Why don't you externalize the style definitions out of the jrxml file into a separated file referenced in the origin jrxml file? :whistle:

Example:

Instead of this:

Code:
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"></td></tr></tbody></table><br />
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre><br />
<br />
you use now sth. like this:<br />
<br />
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd" <br />
	[<!ENTITY reportStyles SYSTEM './ReportStyles.ent'>]></td></tr></tbody></table><br />
<br />
to reference the ReportStyles.ent externally. This file have to exist in the same dir as the jrxml and contains the style informations like these:<br />
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre><br />
<style fontName="Tahoma" fontSize="10" isDefault="false"<br />
    isStyledText="true" name="abase"/><br />
<br />
<br />
<style backcolor="#FFFFFF" fontSize="8" forecolor="#000000"<br />
    isDefault="false" name="address" style="abase"/><br />
<br />
</td></tr></tbody></table><br />
<br />
and so on...;)
tschuler's picture
Joined: Jul 17 2006 - 9:32pm
Last seen: 16 years 4 months ago
Feedback