Jump to content
Changes to the Jaspersoft community edition download ×

x, y coordinates, how about constants?


Recommended Posts

By: Andrew Arrow - andrewarrow

x, y coordinates, how about constants?

2002-06-21 08:02

Is there a way to define some constants such as X_OFFSET=20 and Y_OFFSET=20 and use them throughout all your report elements? That way if you ever want to move everything down 50 pixels, you could change 1 constant vs. having to add 50 to all your elements?

 

 

 

 

By: Teodor Danciu - teodord

RE: x, y coordinates, how about constants?

2002-06-21 08:31

 

Hi,

 

Try this:

 

 

<?xml version="1.0"?>

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"

[

<!ENTITY X_OFFSET "10">

<!ENTITY Y_OFFSET "20">

]>

 

<jasperReport name="FontsReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30">

<title>

<band height="782">

<staticText>

<reportElement x="&X_OFFSET;" y="&Y_OFFSET;" width="200" height="40"/>

<text>The quick brown fox jumps over the lazy dog.</text>

</staticText>

</band>

</title>

<pageHeader>

<band height="0"/>

</pageHeader>

<columnHeader>

<band height="0"/>

</columnHeader>

<detail>

<band height="0"/>

</detail>

<columnFooter>

<band height="0"/>

</columnFooter>

<pageFooter>

<band height="0"/>

</pageFooter>

<summary>

<band height="0"/>

</summary>

</jasperReport>

 

 

Good luck!

Teodor

 

 

 

By: John Pollard - johnnypoll

RE: x, y coordinates, how about constants?

2002-06-25 04:05

Great tip, this worked for me.

Some time ago I asked if anybody had managed to use ENTITY to include standard sections of reports from other xml files so as to share common sections between reports. Nobody responded. After this success with ENTITY I tried again using:

 

<!ENTITY STANDARD_BIT_OF_XML SYSTEM "full path to my other file.xml">

 

but I get an XML parser error (XMLParser.java 965) NullPointerException without a useful error message.

 

Any ideas anyone?

 

Thanks

John

 

 

By: Teodor Danciu - teodord

RE: x, y coordinates, how about constants?

2002-06-25 05:08

 

Hi,

 

Here's a patch for what you need:

 

http://sourceforge.net/tracker/index.php?func=detail&aid=570849&group_id=36382&atid=416705

 

Good luck!

Teodor

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