Jump to content

Please, help


yurish

Recommended Posts

I'm trying to make a report with a table, but i have no idea, how to make it!

 

I tried to do it with crosstab, but there are several problems, which i can't solve. I need as measures 3 variables, which are string variables, and 3 static text headlines. When i'm trying to make it, each row starts with a headlines, which are not needed. I want to write headlines only once in a top of a table.

 

I tried just to place this 3 fields with borders, but i can't make all row automatically resized, everything i gain is every cell resized depending on it's size. If you can tell me, how to, somehow, group them to one group and make so, that each row is resized, depending on the heighest cell.

 

Please, help me with some ideas, how to make it. I'm trying since last week to make it. :unsure: :unsure: :unsure: :( :( :( :(

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If this table is main content of the report, you could just use the report's sections to construct your table layout (psuedo-code follows):

 

Code:
<Column Header>
Header 1 | Header 2 | Header 3 | ...
</Column Header>

<Detail>
Field 1 | Field 2 | Field 3 | ...
</Detail>

 

Where column headers would be static text fields and the detail fields would be text fields with appropriate expressions (e.g. $F{field_1}).

 

If you're having further issues with stretching, overflow, or data grouping, I might be able to help, but I need more information.

Link to comment
Share on other sites

aegwyn42, i have one question.

 

My report is taking data from database. Data is like:

 

Code:
ID   Name      Surname      Company
1 Ralph Schumacher BMW
2 Michael Schumacher Ferrari
3 Kimi Raikonnen McLaren
4 Mika Hakkinen Mclaren
5 Rubens Barrichelo Ferrari

 

 

I want my report look like table:

 

Code:
[code] |Name|Surname|ID|
|Company|____|_______|__|

 

 

For example:

 

Code:
[code]Ferrari Michael Schumacher 2
Rubens Barrichelo 5
Mclaren Kimi Raikonnen 3
Mika Hakkinen 4
BMW Ralph Schumacher 1

 

 

In my previous reports i uzsed crosstab, but i hadn't data from database in cells, i had count variables, where data was generated by report itself. I tried to use crosstab in this report, but i can't place 3 and more columns in my crosstab(don't know why, i'm using 1.2.8 iReport with JasperReports 1.2.8.). I'm searching for another solution to my problem.

 

I tried to create a group and reference it to company, but i get something like that:

 

Code:
[code]Ferrari Michael Schumacher 2
Mclaren Kimi Raikonnen 3
BMW Ralph Schumacher 1

 

My company field value is changing each time.

 

 

Please, waiting for your help! Don't know how to thank you...

Post edited by: yurish, at: 2007/09/17 14:45

Link to comment
Share on other sites

I think you're on the right track. Here are two things I can think to check:

  • 1) You're report data should be ordered the same way you want it to be grouped (i.e. ORDER BY Company, Name, Surname). This might explain why your resulting report omitted some records

2) Repeated values (like Company) can be omitted (like in your example) by calling setPrintRepeatedValues(true) on the field holding the Company values[/ul]
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...