ASP.Net Syncfusion电子表格中的交叉引用

时间:2016-04-12 07:57:05

标签: asp.net asp.net-mvc syncfusion

第三方工具syncfusion中的ASP.NET MVC Spreadsheet控件是否支持跨工作表引用?我一直试图查看是否支持交叉工作表参考,但找不到任何参考。

1 个答案:

答案 0 :(得分:1)

是。 Syncfusion为ASP.NET MVC Spreadsheet中的交叉表引用提供了支持。请参阅以下电子表格示例以演示公式中的交叉工作表参考。

JS Playground

代码段:

<div id="Spreadsheet"></div>                

<script type="text/javascript">
    var productData = [
            { Product: "Product1", Quantity: 10, Price: 10 },
            { Product: "Product2", Quantity: 12, Price: 20 }];

    $(function () {
        $("#Spreadsheet").ejSpreadsheet({
            //...
            sheetCount: 2,
            sheets: [
                { rangeSettings: [{ dataSource: productData, startCell: "A1", showHeader: true }] },
            ],
            loadComplete: "loadComplete"
        });
    });

    function loadComplete(args) {
        if(!this.isImport){

            this.gotoPage(2, false); //Make Sheet2 as active sheet.

            this.XLEdit.updateValue("A1", "=Sheet1!A1"); // Here "=Sheet1!A1" is Sheet1=>"A1" cell value reference and the value of A1 cell in Sheet1 is updated in Sheet2 "A1" cell.

            //...

            this.XLEdit.updateValue("B2", "=PRODUCT(Sheet1!B2,Sheet1!C2)");      

            //...
        }
    }

</script>

另外,请参阅在线MVC Spreadsheet hyperlink Sample。在那里,我们使用交叉表参考来放置在StockDetail列下的超链接。