Open hnyrxs2 opened 1 month ago
hi @hnyrxs2 this is a different issue with case #4463. If you add a sentence htmlTable.select() before htmlTable.set(defaultStyle); you will notice that there is a separate empty paragraph before the table. So apply "TableGrid" style to such as range is not correct, since this style can only apply to a whole table. As why there is an empty paragraph before the table, this is a behavior defined by Word itself which you can try by adding an empty content control and insert a table into it from UI.
In order to work around this, I think you can try to get the table inside the content control by ccContainer.tables.getFirst().set(defaultStyle);
Hello @jipyua thanks for the input. your workaround works for the gist i provided but we shall investigate further to the actual implementation on our add-in. But our implementation before works perfectly, is there any changes in the word behavior that caused this?
Hello again @jipyua your work around works but it compromises the performance of the add in as well as the whole MS word itself. It its taking minutes if i were to insert the table that would be 2 more pages, then the word crashes.
hi @hnyrxs2, thanks for trying the solution. From the above root cause analysis of your original issue, I don't think we have made changes of the behavior. Is it that you are trying to apply other non-table style to the range in the past? That way it will be always working.
About the new crash issue you mentioned, would you please share more information, such as your table code so that I can try to repro at my side and investigate what's happening?
Hello @jipyua, there was definitely behavior change. Before - like 3-4 months ago - our solution worked just fine, then we noticed that there was exactly same error as here in #4463 and that's why @hnyrxs2 raised it there and because there was not answer this thread was created.
Thanks a lot for your help!
You can test it yourself I guess with some old build, let' say half year ago or so. Edit: let us find time when it was working fine... Edit2: It was workin fine (based on our test cases) in May
hi @4tti @hnyrxs2, thanks for providing further information, I tried the above code on a older build 16.0.17328.20514, but I still hit the same error. Could you please also have a try and explain more what's the behavior change you saw? Thanks.
hello @jipyua the only behavioral change we saw was the GeneralException thrown when updating html table style. Our original implementation of this was almost 2 years ago, and just recently around May when we are doing regression testing we noticed the failing functions with html table implementations without any changes made from these past months / year.
hi @hnyrxs2 , we will open an internal item to investigate this and see what's happening. At the same time, I suggest you use the work around to unblock you. Since there is only 1 table in the content contorl, the perf should be ok, if you see other unexpected cases, please let us know.
@jipyua The performance is not ok. The performance went significantly down:
but it compromises the performance of the add in as well as the whole MS word itself. It its taking minutes if i were to insert the table that would be 2 more pages, then the word crashes.
Any update please? @jipyua Do you need something from us?
hi @4tti we have created an internal item to track this issue and if we have some investigation findings, we will share to you. thanks.
Thanks a lot @jipyua , once you have any update please let us know.
@jipyua any update please?
related to issue https://github.com/OfficeDev/office-js/issues/4463 just want to verify if the upcoming fixes this august would include the fixes for the html tables where style is being set. below is the gist used
Your Environment
Expected behavior
Upon rendering the HTML table, table style should be applied.
Current behavior
Plain HTML style is applied, no table style is visible. General Exception is logged on the console
Steps to reproduce
Context
This code gist is used to an add-in that enable users to create large tables of reports and should be customizable to their preferences.
Useful logs
console error on the scriptlab