Please, help

0
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: :( :( :( :(
yurish's picture
38
Joined: Aug 20 2007 - 12:26am
Last seen: 13 years 2 months ago

4 Answers:

0
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><br />
Header 1 | Header 2 | Header 3 | ...<br />
</Column Header><br />
<br />
<Detail><br />
Field 1 | Field 2 | Field 3 | ...<br />
</Detail></td></tr></tbody></table><br />
<br />
Where column headers would be static text fields and the detail fields would be text fields with appropriate expressions (e.g. $F{field_1}).<br />
<br />
If you're having further issues with stretching, overflow, or data grouping, I might be able to help, but I need more information.
nickw's picture
11
Joined: Sep 4 2007 - 5:03am
Last seen: 5 years 5 months ago
0
Oh my God! It works! Thanks! BIG Thanks to you! You saved my place at my work! =]
yurish's picture
38
Joined: Aug 20 2007 - 12:26am
Last seen: 13 years 2 months ago
0
aegwyn42, i have one question.

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

Code:
ID   Name      Surname      Company<br />
1    Ralph     Schumacher    BMW<br />
2    Michael   Schumacher    Ferrari<br />
3    Kimi      Raikonnen     McLaren<br />
4    Mika      Hakkinen      Mclaren<br />
5    Rubens    Barrichelo    Ferrari</td></tr></tbody></table><br />
<br />
<br />
I want my report look like table:<br />
<br />
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>        |Name|Surname|ID|<br />
|Company|____|_______|__|<br />
</td></tr></tbody></table><br />
<br />
<br />
For example:<br />
<br />
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>Ferrari    Michael  Schumacher  2<br />
           Rubens   Barrichelo  5<br />
Mclaren    Kimi     Raikonnen   3<br />
           Mika     Hakkinen    4<br />
BMW        Ralph    Schumacher  1</td></tr></tbody></table><br />
<br />
<br />
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. <br />
<br />
I tried to create a group and reference it to company, but i get something like that:<br />
<br />
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>Ferrari    Michael  Schumacher  2<br />
Mclaren    Kimi     Raikonnen   3<br />
BMW        Ralph    Schumacher  1</td></tr></tbody></table><br />
<br />
My company field value is changing each time.<br />
<br />
<br />
Please, waiting for your help! Don't know how to thank you...<br>Post edited by: yurish, at: 2007/09/17 14:45
yurish's picture
38
Joined: Aug 20 2007 - 12:26am
Last seen: 13 years 2 months ago
0
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]
nickw's picture
11
Joined: Sep 4 2007 - 5:03am
Last seen: 5 years 5 months ago
Feedback