HTML version of workbook displays without borders in Google Chrome

Hi,


When we export workbooks to html and view them in Google Chrome, no borders appear. Is this something you can fix in the generated style sheets?

Thanks and Best Regards,
Ulf

Hi Ulf,

Thanks for your post.

Could you please provide a sample Excel Workbook demonstrating the issue? Such sample file would really be helpful in order to reproduce and further investigate the issue on our side.

Kind Regards

Hi,


Please see the attached screenshot and the file used to build that html page.

Best Regards,
Ulf Ekström

Hi Ulf,

Thanks for providing the sample file.

Based on this sample file, we were able to reproduce the issue. We have logged this issue in our Issue Tracking System as 19805. We will update you about the further proceedings regarding this issue as this thread has been linked with the said issue.

Kind Regards

Hi,

Please try the new fix V2.4.0.3 (attached), we have fixed the issue of
border.
<o:p></o:p>


Thank you.


Hi,


Thanks for the fix. However, the fix shows the same problem. Attached are two files generated with version 2.4.0.3. There are still no borders when I view the html file in Chrome.

Thanks for checking this again.

Best regards,
Ulf Ekström

Hi,

After further investigation, I am afraid it is a bug of the Google Chrome. Even opening the generated html file by MS Excel itself, the borders are invisible in Google Chrome, you may confirm it.

Thank you

Hi,


Thanks for your help on this problem. I looks like we will be able to workaround the problem by increasing the border widths.

When we changed the borders from .5pt to 1pt in the output HTML file they look the same in both Chrome and IE. I guess that means that we can increase the borders in the Excel file before saving as HTML.

What is the relation between Excel border and the style sheet border (in pt) that you output? I know W3C does not recommend pt for viewing HTML online. It is supposed to be used for printing purposes. http://www.w3.org/Style/Examples/007/units

Maybe this is why Chrome displays the borders differently?

Best regards,
Ulf

Hi again,


Just tried the following code:

if (browser.isBrowser(TEBrowserIdentity.BROWSER.CHROME)) {
Iterator cells = iSheets.getSheet(0).getCells().getCellIterator();
while (cells.hasNext()) {
Cell cell = cells.next();
Style style = cell.getStyle();
style.setBorderLine(BorderType.TOP, BorderLineType.MEDIUM);
style.setBorderLine(BorderType.BOTTOM, BorderLineType.MEDIUM);
style.setBorderLine(BorderType.LEFT, BorderLineType.MEDIUM);
style.setBorderLine(BorderType.RIGHT, BorderLineType.MEDIUM);


cell.setStyle(style);
}
}

and the borders are showing nicely in Chrome.

However, there is one problem. Executing the code above turns all borders black, even the previously white borders in the example file attached to this thread. Am I doing something wrong or is it a bug?

Thanks for looking into this.

Best regards,
Ulf

Hi,


Well, if the thicker borders give the result you required, we think you can set the border line type as MEDIUM, THICK or DOUBLE.

Thank you.




Hi,


Well, it is sure that the borders will be set for all cells by your code. To change the border type of the existing borders, your code should be changed a bit like the following:

...

if(style.getBorderLine(BorderType.TOP) != BorderLineType.NONE)

{

style.setBorderLine(BorderType.TOP, BorderLineType.MEDIUM);

}

...

Hi,


Yes, of course the borders are set for all cells with my code. But all our cells have borders. They all have THIN borders and some are white and some are black. Why does setBorderLine change the color of the border?

Best regards,
Ulf

Hi Ulf,

We are looking into your issue regarding border’s color. We will update you once we figure out your issue.

Thank you.

Hi,


After checking the borders in your template file, we found that those cells that have white borders only have TOP and LEFT borders. But your code will add RIGHT and BOTTOM borders for them and because there is no custom colors for the newly added RIGHT and BOTTOM borders, so they will use the default color, that is black. And being different from IE, it seems that google chrome will use the RIGHT and BOTTOM borders of one cell to overlap the TOP and LEFT borders of the prior cell. So in google chrome, the borders will be shown as black. If you change your code as what we suggested in the previous reply, the generated html file will be ok in google chrome.


Thank you.

Thank you so much!


Regards,
Ulf

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.