1

我有一个 Microsoft Word 插件,它使用 Excel Services REST API 来获取表格,然后将其添加到当前文档中。

AddIn 与 Sharepoint 2010 完美配合,但当更新到 Sharepoint 2013 时,AddIn 不再工作,因为 Excel Services REST API 的输出非常不同。这是一个例子:

示例表

2010

            <div style="overflow: hidden">
            <table cellpadding="0" cellspacing="0" class="ewr-sheettable" style="border-collapse: collapse; margin-left: -2px; margin-top: -2px;">
                <tr>
                    <td style="border-bottom: 1px solid transparent; width: 1px; font-size: 1px; height: 1px; line-height: 1px;">
                        <div class="clp">&nbsp;</div>
                    </td>
                    <td style="font-size: 1px; height: 1px; line-height: 1px; width: 101px;">
                        <div class="clp" style="width: 101px;">&nbsp;</div>
                    </td>
                    <td style="font-size: 1px; height: 1px; line-height: 1px; width: 96px;">
                        <div class="clp" style="width: 96px;">&nbsp;</div>
                    </td>
                    <td style="font-size: 1px; height: 1px; line-height: 1px; width: 112px;">
                        <div class="clp" style="width: 112px;">&nbsp;</div>
                    </td>
                    <td style="font-size: 1px; height: 1px; line-height: 1px; width: 76px;">
                        <div class="clp" style="width: 76px;">&nbsp;</div>
                    </td>
                    <td style="font-size: 1px; height: 1px; line-height: 1px; width: 96px;">
                        <div class="clp" style="width: 96px;">&nbsp;</div>
                    </td>
                    <td style="font-size: 1px; height: 1px; line-height: 1px; width: 76px;">
                        <div class="clp" style="width: 76px;">&nbsp;</div>
                    </td>
                    <td style="font-size: 1px; height: 1px; line-height: 1px; width: 98px;">
                        <div class="clp" style="width: 98px;">&nbsp;</div>
                    </td>
                </tr>
                <tr>
                    <td style="border-bottom: 1px solid transparent; width: 1px;">
                        <div class="clp" style="height: 19px;">&nbsp;</div>
                    </td>
                    <td data-range="A3" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-top: solid 1px #DADCDD; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 99px; max-height: 19px;">Test Column 1</div>
                    </td>
                    <td data-range="B3" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-top: solid 1px #DADCDD; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 94px; max-height: 19px;">Test Column 2</div>
                    </td>
                    <td data-range="C3" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-top: solid 1px #DADCDD; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 110px; max-height: 19px;">Test Column 3</div>
                    </td>
                    <td data-range="D3" style="font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-top: solid 1px #DADCDD; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;" />
                    <td data-range="E3" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-top: solid 1px #DADCDD; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 94px; max-height: 19px;">Test Column 4</div>
                    </td>
                    <td data-range="F3" style="font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-top: solid 1px #DADCDD; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;" />
                    <td data-range="G3" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-top: solid 1px #DADCDD; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 96px; max-height: 19px;">Test Column 5</div>
                    </td>
                </tr>
                <tr>
                    <td style="border-bottom: 1px solid transparent; width: 1px;">
                        <div class="clp" style="height: 19px;">&nbsp;</div>
                    </td>
                    <td data-range="A4" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 99px; max-height: 19px;">Value1</div>
                    </td>
                    <td data-range="B4" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 94px; max-height: 19px;">Value2</div>
                    </td>
                    <td data-range="C4" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 110px; max-height: 19px;">Value3</div>
                    </td>
                    <td data-range="D4" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 74px; max-height: 19px;">Value4</div>
                    </td>
                    <td data-range="E4" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 94px; max-height: 19px;">Value5</div>
                    </td>
                    <td data-range="F4" style="font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;" />
                    <td data-range="G4" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 96px; max-height: 19px;">Value6</div>
                    </td>
                </tr>
                <tr>
                    <td style="border-bottom: 1px solid transparent; width: 1px;">
                        <div class="clp" style="height: 19px;">&nbsp;</div>
                    </td>
                    <td data-range="A5" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 99px; max-height: 19px;">Value7</div>
                    </td>
                    <td data-range="B5" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 94px; max-height: 19px;">Value8</div>
                    </td>
                    <td data-range="C5" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 110px; max-height: 19px;">Value9</div>
                    </td>
                    <td data-range="D5" style="font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;" />
                    <td data-range="E5" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 94px; max-height: 19px;">Value10</div>
                    </td>
                    <td data-range="F5" style="font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;" />
                    <td data-range="G5" style="text-align: left; vertical-align: bottom; font: normal 11pt 'Calibri'; color: #000000; text-decoration: none; border-right: solid 1px #DADCDD; border-bottom: solid 1px #DADCDD;">
                        <div class="cv-nwl" style="width: 96px; max-height: 19px;">Value11</div>
                    </td>
                </tr>
            </table>
        </div>

2013

            <div style="overflow: hidden">
            <div class="ewr-sheettable" style="position: relative; width: 662px; height: 60px; font: normal 11pt Calibri,'Segoe UI',Arial,Verdana,Sans-Serif; color: #000000; text-decoration: none;">
                <div id="grvl" style="position: absolute; height: 60px; width: 662px; top: 0; left: 0;">
                    <div style="position: absolute; height: 60px; border-right: 1px solid #dadcdd; width: 101px; left: 0px;"></div>
                    <div style="position: absolute; height: 60px; border-right: 1px solid #dadcdd; width: 96px; left: 102px;"></div>
                    <div style="position: absolute; height: 60px; border-right: 1px solid #dadcdd; width: 112px; left: 199px;"></div>
                    <div style="position: absolute; height: 60px; border-right: 1px solid #dadcdd; width: 76px; left: 312px;"></div>
                    <div style="position: absolute; height: 60px; border-right: 1px solid #dadcdd; width: 96px; left: 389px;"></div>
                    <div style="position: absolute; height: 60px; border-right: 1px solid #dadcdd; width: 76px; left: 486px;"></div>
                    <div style="position: absolute; height: 60px; border-right: 1px solid #dadcdd; width: 98px; left: 563px;"></div>
                </div>
                <div id="grhl" style="position: absolute; height: 60px; width: 662px; top: 0; left: 0;">
                    <div style="position: absolute; width: 662px; border-bottom: 1px solid #dadcdd; top: 0px; height: 19px;"></div>
                    <div style="position: absolute; width: 662px; border-bottom: 1px solid #dadcdd; top: 20px; height: 19px;"></div>
                    <div style="position: absolute; width: 662px; border-bottom: 1px solid #dadcdd; top: 40px; height: 19px;"></div>
                </div>
                <div id="Div1" style="position: absolute; height: 60px; width: 662px; top: 0; left: 0;">
                    <div class="ewr-nglr" style="position: absolute; width: 662px; top: 0px; height: 19px;">
                        <div style="left: 0px; width: 101px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 99px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Test Column 1</div>
                        </div>
                        <div style="left: 102px; width: 96px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 94px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Test Column 2</div>
                        </div>
                        <div style="left: 199px; width: 112px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 110px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Test Column 3</div>
                        </div>
                        <div style="left: 389px; width: 96px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 94px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Test Column 4</div>
                        </div>
                        <div style="left: 563px; width: 98px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 96px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Test Column 5</div>
                        </div>
                    </div>
                    <div class="ewr-nglr" style="position: absolute; width: 662px; top: 20px; height: 19px;">
                        <div style="left: 0px; width: 101px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 99px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value1</div>
                        </div>
                        <div style="left: 102px; width: 96px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 94px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value2</div>
                        </div>
                        <div style="left: 199px; width: 112px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 110px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value3</div>
                        </div>
                        <div style="left: 312px; width: 76px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 74px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value4</div>
                        </div>
                        <div style="left: 389px; width: 96px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 94px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value5</div>
                        </div>
                        <div style="left: 563px; width: 98px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 96px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value6</div>
                        </div>
                    </div>
                    <div class="ewr-nglr" style="position: absolute; width: 662px; top: 40px; height: 19px;">
                        <div style="left: 0px; width: 101px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 99px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value7</div>
                        </div>
                        <div style="left: 102px; width: 96px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 94px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value8</div>
                        </div>
                        <div style="left: 199px; width: 112px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 110px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value9</div>
                        </div>
                        <div style="left: 389px; width: 96px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 94px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value10</div>
                        </div>
                        <div style="left: 563px; width: 98px; position: absolute; height: 19px;">
                            <div class="cv-nwl" style="width: 96px; max-height: 19px; position: absolute; bottom: 0px; text-align: left;">Value11</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

最糟糕的是表格的结构在 2013 的输出中丢失了,并且很难重建它,即使是 Word 2013。这是粘贴在 Word 2013 中的表格的屏幕截图: Word 2013 中的结果

无论如何,Sharepoint 2013 中的某些模块是否通过代码配置或覆盖以获得与 2010 年相同的输出?

提前致谢!

4

0 回答 0