| | | | Browse by category |
When I make printouts of grids, the background colors that I have set do not appear.
Cause
The colors are being stripped off, since color backgrounds on a black and white printout might not be very attractive.
Action
To change this behavior, you can make the following patch to your source code.
At line 150 of com.roguewave.grid.awt.v2_0.GXLabel.java, change this line in the drawBackground() method:
if (bColor&&!bPrinting) To: if (bColor || !bPrinting)The entire function should look like: protected void drawBackground(Graphics g, int x, int y, int width, int height, GXStyle gxStyle, boolean bErase) { boolean bColor = !grid().getParam().getProperties().getBlackWhite(); Color background = Color.white;
// adjust size. if (!(grid().getDrawVLine())) width++; if (!(grid().getDrawHLine())) height++;
// check if background needs to be drawn if (bErase || !grid().getParam().isTransparentBackground() ) { boolean bPrinting = (g instanceof PrintGraphics); if (bColor || !bPrinting) { if (gxStyle.getIncludeBackground()) background = gxStyle.getBackground(); else background = grid().getBackground(); } else background = Color.white; g.setColor(background); g.fillRect(x, y, width, height); } } < /P >
Rebuild the file.