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

Style Library problem


tgutgu

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 months later...

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.

Link to comment
Share on other sites

  • 3 months later...

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

Code:
[code]

you use now sth. like this:

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"
[<!ENTITY reportStyles SYSTEM './ReportStyles.ent'>]>

 

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:

Code:
[code]
<style fontName="Tahoma" fontSize="10" isDefault="false"
isStyledText="true" name="abase"/>


<style backcolor="#FFFFFF" fontSize="8" forecolor="#000000"
isDefault="false" name="address" style="abase"/>

 

and so on...;)

Link to comment
Share on other sites

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