Customizing Detail field for every data entry

Hello. I'm trying to make static method on Java, that will make a paper copy of JTable using JasperReports. Until we talking just about table data - everything is fine, I'm generating design with something kind of

Code:
for( int i = 0; i < model.getColumnCount(); i++ ) {<br />
      textField = new JRDesignTextField();<br />
      expression = new JRDesignExpression();<br />
      expression.setText( "$F{COLUMN_" + i + "}" );<br />
      textField.setExpression( expression );<br />
      band.addElement( textField );<br />
}</td></tr></tbody></table><br />
and so on, and then fill it with a bit modified JRTableModelDataSource<br />
<br />
<br />
Things get complicated for me when I've got to copy style of every cell of a table - that mean for every cell I have to fetch it's CellRenderer and replicate it's font style, background and so on. It's have to be executed in fill-time, but style of Detail field is already defined in design-time, similar for every row...<br />
<br />
Is there any real solutions? Thanks.
TSft's picture
1
Joined: Oct 25 2006 - 6:26pm
Last seen: 16 years 11 months ago

1 Answer:

Hi,

Why don't you just print the Swing table using its print(Graphics g) method that all components have.

I hope this helps.
Teodor
teodord's picture
53592
Joined: Jun 30 2006 - 9:00am
Last seen: 17 hours 5 min ago
Feedback
randomness