setPrintGridlines not working in Cells 7.0+

Hi,


I’ve just attempted to use setPrintGridlines with the latest Java Cells release but no lines are shown. This worked fine in the pre 7.n releases. Do I need to set any additional parameters to make this work or is it broken?

Regards,
Henrick Blake

Hi,


Please try the latest fix: v7.0.2.3. I have tested using the following code with a template file and it works fine regarding setPrintGridlines() method.<o:p></o:p>


Sample code:


Workbook workbook = new Workbook(“e:\test\Book1.xls”);

PageSetup pagesetup = workbook.getWorksheets().get(1).getPageSetup();

pagesetup.setPrintGridlines(true);


workbook.save(“output.xls”);



Thank you.

Hi Amjad,


Thanks for the speedy fix. It works partially - there is now a border around three sides of the print area but no gridlines between the cells. I’ve attached the output and included my code below:



wb = new Workbook(“c:\docs\sample.xlsx”);

Worksheet sheet = wb.getWorksheets().get(0);

Cells cells = sheet.getCells();


ImageOrPrintOptions options = new ImageOrPrintOptions();

options.setOnePagePerSheet(true);


PageSetup ps = sheet.getPageSetup();

ps.setPrintArea(A1:C10);

ps.setPrintGridlines(true);


SheetRender sr = new SheetRender(sheet, options);


float[] wh = sr.getPageSize(0); // in points

BufferedImage image = new BufferedImage((int) Math.ceil(wh[0] / 72f * 96f), (int) Math.ceil(wh[1] / 72f * 96f), BufferedImage.TYPE_INT_RGB);

sr.toImage(0, image.createGraphics());

ImageIO.write(image, “png”, new File(“sample.png”));


Regards,

Henrick


Hi,


Thanks for the sample code and template file.

So, you are using Sheet-to-Image feature, I can find the issue as you have mentioned by your screen shot attached. I have logged your issue with an id: CELLSJAVA-40014. We will figure it out soon.

Thank you.

Is worksheet.setGridlinesVisible the setting I should be using? It also has no effect


Regards,
Henrick

Hi,


No, this method is used to on/off the Gridlines of the worksheet only for display, it does not concern with printing or rendering. As I already logged your issue into our database. Please spare us some time, we will figure it out soon. Once we have any update, we will let you know here immediately.

Thank you.
Hi,


Please try the new fixed version: v7.0.2.4


We have fixed the issue now.


Thank you

Hi Amjad,


7.0.2.4 looks good, thanks

Regards,
Henrick

The issues you have found earlier ( filed as CELLSJAVA-xxxxx ) have been fixed in this update.

The issues you have found earlier (filed as CELLSJAVA-40014) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.