Jump to content
Changes to the Jaspersoft community edition download ×

Making SubReports


ktrinad

Recommended Posts

By: Shashank Uchil - shashank_uchil

Making SubReports

2003-01-08 04:17

Hi,

I have a table with say a column having values

 

100,101,102,103,104,105,200,201,202,203,204.

 

I want to disply them as foll:

100

101

102

...

200

201

202

...

How do i achieve this format?

 

Thx

Shashank

 

 

 

 

By: Giulio Toffoli - gt78

RE: Making SubReports

2003-01-08 14:19

You can add a textfield with expression like...

 

$F{field}.replace(',','n');

 

In this way you can obtain a string like

100

101

102

103

104

...

If fields are more than one you can join it.

 

I hope this helps you.

 

Giulio

 

 

 

 

 

By: Shashank Uchil - shashank_uchil

RE: Making SubReports

2003-01-08 18:40

The format was lost in the post, say i have a Column in a Table with data:

 

Column1

--------------

100

101

103

104

200

201

202

203

204

 

all are from the same column, but in the report i want to group them as all data less than 199 will come under 100 and all data less than 299 will come under 200 and so on..

 

Report

--------------------------------------------------------

100

......101

......102

......103

......104

......105

 

200

......201

......202

......203

......204

......205

 

Hope the formatting is not lost this time

Thx,

Shashank

 

 

 

 

By: Giulio Toffoli - gt78

RE: Making SubReports

2003-01-09 00:54

ok.

You can solve in this way

Create 2 textfields....

 

<----- Size of the first textfield ---->

_____________________________

|_____|_______________________|

 

..........<--Size of the 2th textfield-->

 

Set fieldexpression to the same expression

like $F{column1}

Set printWhenExpression of the first field

to:

$F{column1}.intValue() %100 == 0

 

and the printWhenExpression of the second field

to $F{column1}.intValue() %100 != 0

 

(the two expressions are exclusive)

In this way you must be able to obtain something like this...

 

___________________________

|_100_______________________|

.........|_101__________________|

.........|_102__________________|

.........|_103__________________|

_____|_104__________________|

|_200_______________________|

.........|_201__________________|

.........|_202__________________|

.........|_203__________________|

.........|_204__________________|

...

 

I hope this helps you

 

Giulio

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