HTML rendering issue for a table with a hidden column

The following code applied to attached file produces an HTML file which renders incorrectly:

var workbook = new Workbook("AsposeIssues//html_hidden_column_issue.xlsx");

workbook.Worksheets["Sheet3"].IsVisible = false;

workbook.Save("AsposeIssues//html__hidden_column_issue.html", new HtmlSaveOptions { ExportHiddenWorksheet = false });

The generated HTML file has JS. When opened from a local drive IE blocks JS (asking to enable scripts), the page renders ok. But after I hit the Allow button, IE starts to execute JS and it take 10-20 secs, then the Customer column disappears (not expected behavior).

Another, broader question here. Why does Aspose uses JS in this case, if the same file is saved to HTML from Excel, the saved file doesn't have JS?

Hi,


Thanks for the template file and sample code.

I have tested your scenario/ case a bit using your template file and sample code. I think it works as MS Excel does. When I open the HTML file generated by MS Excel manually, it also prompts me the similar message in IE10. Also, I checked the source of HTML generated by Aspose.Cells APIs with the source of HTML file (saved by MS Excel manually), both are same and have similar JS code a bit to certain extent. I have attached both HTMLs for your reference.

If you still find any significant difference, kindly compare HTMLs (one with Aspose.Cells and other with MS Excel) and provide some some screen shots to highlight the differences, we will check it soon.

Note: I am using Aspose.Cells for .NET v8.3.2.2, please try it.

Thank you.

I cannot test v8.3.2.2, see below.

Could you please look closer at my sample. The generated HTML (i'm attaching the file here), contains a large block of JS that defines the ChangeColspanHiddenData function. The Excel version of saved only for one sheet doesn't contain JS at all, and even the HTML file you provided has only JS to support UI for switching between worksheets. Plus, when the JS is unblocked and runs to completion, the Customer column disappears in my HTML file.

Can you confirm that you don't observe the described behavior in v8.3.2.2?

Was the version v8.3.2.2 release, if not, when do you plan to release it? (in downloads i see only v.8.3.2.1 http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/category1084.aspx)

The Aspose.Cells nuget package v8.3.2 is broken, the .dll in net40 breaks my code, because most collections i depend on are switched to non generic verision of CollectionBase, while it should be CollectionBase (like class WorksheetCollection : CollectionBase). Please take a look ASAP.

Thanks

Hi,


Thanks for providing us sample file.

Yes, I noticed the “ ChangeColspanHiddenData” function is there only the HTML rendered by Aspose.Cells APIs, MS Excel does embed this function, we will look into it soon. But, on my IE 10, when I unblocked (using Allow blocked content… button) the contents to be displayed into IE, it does not hide the Customer column at all, see the screen shot here:
http://prntscr.com/60my3t

Well, the fix v8.3.2.2 is an intermediate fix which contains further enhancements and other fixes, you may use this fix without any issue, it contains all the functionality (full fledged) of the original version with additional fixes and out next official release v8.4.0 would include the functionality of this fix as well.

Furthermore, we noticed the issue with the uploaded version of Aspose.Cells assemblies on Nuget repository (The assemblies are not generic CollectionBase oriented), we will update/ replace Aspose.Cells assemblies accordingly (in accordance with the latest Aspose.Cells for .NET v8.3.2.1 in the Downloads section) @ Nuget repository soon.

In the mean time, we recommend you to kindly download and try our latest Aspose.Cells version v8.3.2.1 (MSI and Dlls versions) from Downloads module here, these are fine tuned:


Thank you.

I see it works in you IE10, and it works in my FireFox as well. So the issue seems to occur in IE9.

Anyway I think it's important to have implementation that doesn't depend on JS in the case of one worksheet. So we can generate HTML to embed in email.

Thanks

Hi,


As I observed the issue, using your sample code with your template file, I found the generated HTML contains blocks of JS that defines the ChangeColspanHiddenData function where as MS Excel does not contain such block of JS. We need to sort it out. Furthermore, I am using IE 10, when I unblocked (using Allow blocked
content… button) the contents are displayed into IE fine, it does not
hide the Customer column as per my screen shot in previous post. But you are getting this issue in IE9, so we have to investigate your issue in details.

I have logged a ticket with an id “CELLSNET-43391” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.6.1.2 and let us know your feedback.

About CELLSNET-43391, there are some tips for the you:

1.We use java script to keep the output html file compatible in various browsers.

2.In the “html_hidden_column_issue.xlsx” file, if you don’t need to import the output html file to MS-Excel,

you can use the following codes to delete hidden columns, you will discover that java script will disappear.

Workbook workbook = new Workbook("html_hidden_column_issue.xlsx");

workbook.Worksheets["Sheet3"].IsVisible = false;

HtmlSaveOptions options = new HtmlSaveOptions();

options.ExportHiddenWorksheet = false;

options.HiddenColDisplayType = HtmlHiddenColDisplayType.Remove;

orkbook.Save("out.html", options);

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
I'm using the latest Aspose.Cells and use

var htmlSaveOptions = new HtmlSaveOptions
                {
                    HiddenColDisplayType = HtmlHiddenColDisplayType.Remove                   , // See https://forum.aspose.com/t/44937
                };


But I still get the JavaScript in the HTML output from Aspose.Cells






Is this to be expected, I would expect Remove to remove it?

If I change to HtmlHiddenColDisplayType.Hidden I get:


Hi Darren,


Thanks for providing us some details.

Could you provide us your template file(s) and paste your sample code (runnable) here, so we could evaluate your issue soon. Also provide us some screenshots highlighting the issue and your expected file that you may create manually by editing the output file, all this will help us to understand you completely and we may evaluate your issue properly.

Thank you.