Hello,
I have been trying
to create the illusion of a border around a table, where each row is a shaded
color with values. A kind of spreadsheet effect. Anyway, I got the shading of
the rows to work by coloring the cells the color, and skipping every other row
with the color.
Problem from
yesterday, still the same. I need to somehow show a border, or something around
the table, so it looks like it belongs on the page.
So after
experimenting for hours and hours, I came to the conclusion of
failure.
But upon further
thought, I figure if I could create a table. lets say 200, 200, set the
background to gray. Then use my cell trick from above to use white cells for the
rows to get my effect this would work.
But I cannot seem to
get the background to show.
I am setting the
color properly, but it just shows white?
Can anyone help me
out here.
PS, I am need RTF so
I am using the RtfWriter2.
Thanks,
Scott
Here is my idea for
the report (kind of, pictrure the gray lines another color with cols in them
also).
############################################################
# col1
col2
col3
col4
col8
#
############################################################
# col1
col2
col3
col4
col8
#
############################################################
# col1
col2
col3
col4
col8
#
############################################################
# col1
col2
col3
col4
col8
#
############################################################
# col1
col2
col3
col4
col8
#
############################################################
Table tbl = new Table(3);
int[] widths = { 20, 40, 40 };
tbl.setWidths(widths);
tbl.setOffset(20);
tble.setBackgroundColor(Color.yellow);
Cell cell;
cell = new Cell("cell: 1, 1");
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell = new Cell("cell: 1,
2");
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell = new Cell("cell: 1,
3");
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell = new Cell("cell: 2,
1");
cell.setBackgroundColor(Color.green);
cell.setBorderColor(Color.green);
tbl.addCell(cell);
cell.setBackgroundColor(Color.green);
cell.setBorderColor(Color.green);
tbl.addCell(cell);
cell = new Cell("cell: 2,
2");
cell.setBackgroundColor(Color.green);
cell.setBorderColor(Color.green);
tbl.addCell(cell);
cell.setBackgroundColor(Color.green);
cell.setBorderColor(Color.green);
tbl.addCell(cell);
cell = new Cell("cell: 2,
3");
cell.setBackgroundColor(Color.green);
cell.setBorderColor(Color.green);
tbl.addCell(cell);
cell.setBackgroundColor(Color.green);
cell.setBorderColor(Color.green);
tbl.addCell(cell);
cell = new Cell("cell: 3, 1");
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell = new Cell("cell: 3,
2");
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell = new Cell("cell: 3,
3");
cell.setBorderColor(Color.white);
tbl.addCell(cell);
cell.setBorderColor(Color.white);
tbl.addCell(cell);
document.add(tbl);
Scott K Purcell | Developer | VERTIS |
555
Washington Ave. 4th Floor | St. Louis, MO 63101 |
314.588.0720 Ext:1320 |
[EMAIL PROTECTED] | http://www.vertisinc.com
Vertis is the premier provider of targeted
advertising, media, and
marketing services that drive consumers to marketers
more effectively.