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

how to create uncertain rows table?


Recommended Posts

By: acajax - liufenghuixue

how to create uncertain rows table?

2003-06-21 00:36

I want to create a table with uncertain rows:

the tabel maybe five rows,maybe 20 rows too.

How can I do to create it?

 

 

 

 

By: Albert L. - looks

RE: how to create uncertain rows table?

2003-06-21 01:27

I use rectangle to 'boxed' each detail field.

 

You just need to make sure the rectangle height and width is set correctly so the side joins properly with the next rectangle.

 

A bit tedious.. but it creates the table effect. Is there any other way ? :)

 

 

 

 

 

By: acajax - liufenghuixue

RE: how to create uncertain rows table?

2003-06-21 01:43

to looks:

It's no use of it .I want to get datasource from

xml document.The datasource is the fields of table.

Because of this, the rows is unknown.If I use adequate rectangles,there are many empty rectangles,are there?This is not I want to see.Any other suggestions?

 

 

 

 

By: Albert L. - looks

RE: how to create uncertain rows table?

2003-06-21 02:20

If your field is at detail band, then you only need to design a single row of retangles.

 

Assuming (..) is a rectangle, and field1-3 is each columns in a row, if you have 2 rows, it would be :

 

row 1 : (field1) (field2) (field3)

row 2 : (field1) (field2) (field3)

 

And if you have 5 rows, the output woudl be :

 

row 1 : (field1) (field2) (field3)

row 2 : (field1) (field2) (field3)

row 3 : (field1) (field2) (field3)

row 4 : (field1) (field2) (field3)

row 5 : (field1) (field2) (field3)

 

Is the the table effect you meant ?

 

 

 

 

 

By: acajax - liufenghuixue

RE: how to create uncertain rows table?

2003-06-21 04:41

to looks

Yes,I just mean this.but ,how to design a single row of retangles?Please help me .

 

 

 

 

By: Albert L. - looks

RE: how to create uncertain rows table?

2003-06-21 05:49

Errm.. the process may be a bit manual (I'm not using iReport yet) :

 

1) The detail band's height must match the ectangle's height. This is to ensure each row's rectangle may be joined. For example, if you define the band's height as 30, the rectangle's height must also be 30.

 

2) You need to create a rectangle before each textField :

 

<rectangle>

...

</rectangle>

<textField ...>

...

</textField>

 

3) The width and height of the rectangle must be larger than the textField :

 

<rectangle>

<reportElement ... width="110" height="30" ... />

</rectangle>

 

<textField ...>

<reportElement ... width="100" height="16" ... />

...

</textField>

 

4) Each rectangle 'x' value must be computed in a way that it joins to the next x value.

 

x---x----x---

0 110 220

 

So, the first rectangle x value would be x="0" the second x value would be x="110" and the third x value would be x="220"

 

Note : I increase by 110, yours may be different (each field may be difference, depending on the content).

 

5) Each rectangle 'y' value is always "0" (as not to have any gap between rows).

 

6) Each textField 'x' and 'y' value is always slightly larger than it's rectangle 'x' and 'y' value. Example :

 

1st rectangle x=0 y=0, textField x=5 y=5

2nd rectangle x=110,y=0, textField x=115,5

3rd rectangle x=220,y=0, textField x=225,5

 

7) You may use the included rectangle 'sample' to cut n paste and just change it's height/width/x/y before each textField :)

 

<rectangle>

<reportElement positionType="FixRelativeToTop" isPrintRepeatedValues="true" mode="Transparent" x="0" y="0" width="110" height="30" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" forecolor="#000000" backcolor="#cccccc" />

<graphicElement pen="Thin" />

</rectangle>

 

Albert

 

 

 

 

By: acajax - liufenghuixue

RE: how to create uncertain rows table?

2003-06-22 02:59

Hi looks:

1) The detail band's height must match the ectangle's height.

But the detail content has many other statictext

fields,line etc.So...

 

Another question:The one to seven what you say is easy to understand,but, i can not know how to write the codes which increase rows automaticly.

 

 

 

 

By: Albert L. - looks

RE: how to create uncertain rows table?

2003-06-22 03:19

Hi,

 

> Another question:The one to seven what you say is easy to understand,but, i can not know how to write the codes which increase rows automaticly.

 

I think this is the central issue that you might have misunderstood.

 

In JasperReports (or any other reporting engine), when you supply textFields output in a detail band, you are supplying format information for a single row. The reporting engine will _repeat_ this formatting for each row automatically.

 

You do not have to build a loop inside the report to repeat each row - that is handled by the engine. You only need to supply a sample of each row's format - which is what we define inside a detail band in JasperReports.

 

Albert

 

 

 

 

 

 

By: Albert L. - looks

RE: how to create uncertain rows table?

2003-06-22 03:27

(correction)

 

...

You only need to supply a sample row's format - which is what we define inside a detail band in JasperReports.

 

Albert

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