JTable in jasperfillmanager

By: ervin chua joy - notinthisworld
JTable in jasperfillmanager
2003-01-14 02:41
how can i use the Jtable in the jasperfillmanager(new JRTableModelDataSource()));

do i really need to use datamodel for my table? can't i use ordinary jtable

pls help..




By: Teodor Danciu - teodord
RE: JTable in jasperfillmanager
2003-01-14 03:41

Hi,

Check the "datasource" sample for details about
how to use this type of data source.

The reporting engine is only interested in "pure data"
and this is why it only needs a TableModel,
not the entire JTable.
However, JTable has a getModel() method that
you could use.

I hope this helps.
Teodor





By: ervin chua joy - notinthisworld
RE: JTable in jasperfillmanager
2003-01-14 04:09
should i use jtable.getModel()??
i tried that and it didn't work




By: Teodor Danciu - teodord
RE: JTable in jasperfillmanager
2003-01-14 05:04

Hi,

If you want to use the JRTableModelDataSource
to wrap a TableModel object, you have to make
sure you have declared a report field for each
column in the TableModel, having the same name.

If not, you could still access the colmun values by
index, if you declare report fields like:
COLUMN_1, COLUMN_5 or COLUMN_100

I hope this helps.
Teodor





By: ervin chua joy - notinthisworld
RE: JTable in jasperfillmanager
2003-01-14 05:54
what does classCastException error means?????




By: Teodor Danciu - teodord
RE: JTable in jasperfillmanager
2003-01-14 06:04

Hi,

It means (in your case) that even if you declared
corresponding report fields for each table column,
their type does not seem to correspond.
It's like a type mismatch between the TableModel
columns and the report fields.

I hope this helps.
Teodor





By: ervin chua joy - notinthisworld
RE: JTable in jasperfillmanager
2003-01-14 14:23
what should i do then?? tnx




By: ervin chua joy - notinthisworld
RE: JTable in jasperfillmanager
2003-01-14 06:16
what should i do then?? tnx




By: Teodor Danciu - teodord
RE: JTable in jasperfillmanager
2003-01-14 23:22

Hi,

If this is the exact case, then you should
pay attention to the "class" attribute that you
choose for each report field you declare in the
report.
It has to correspond exactly to the type of the
values found in the corresponding TableModel
column.

I hope this helps.
Teodor
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet
Feedback
randomness