1. 程式人生 > >spreadJS註釋功能碼

spreadJS註釋功能碼

 //初始化spread
    function initSpread(spread)
    {
        var sheet = spread.getActiveSheet();
        sheet.setColumnCount(4);
        sheet.setRowCount(6);
        //sheet.Range(0,0,6,6).HAlignment = 2;      
        //合併區域
        sheet.addSpan(0, 0, 1, 4);
        sheet.addSpan(3, 0, 1, 4);
        
        
        //設定特定區域背景色
        sheet.getRange(0, )
        sheet.getRange(0, 0, 1, 1).backColor("#D9D9FF");
        sheet.getRange(0, 0, 6, 3).hAlign(GC.Spread.Sheets.HorizontalAlign.center);//設定區域對齊方式
        sheet.getRange(3, 0, 1, 1).backColor("#D9D9FF");


        //設定列寬
        sheet.setColumnWidth(1, 120);
        sheet.setColumnWidth(2, 120);
        sheet.setColumnWidth(3, 120);
        sheet.setColumnWidth(0, 120);

        //設定特定單元格值
        sheet.setValue(0, 0, "粒度分佈");
        sheet.setValue(3, 0, "粒度分佈(高速剪下)");
        sheet.setValue(1, 0, "d10");
        sheet.setValue(1, 1, "d50");
        sheet.setValue(1, 2, "d90");
        sheet.setValue(1, 3, "d99");
        sheet.setValue(4, 0, "d10");
        sheet.setValue(4, 1, "d50");
        sheet.setValue(4, 2, "d90");
        sheet.setValue(4, 3, "d99");



        
        //設定spread的邊框為實體線
        var spreadNS = GC.Spread.Sheets;
        sheet.getRange(0, 0, 6, 4).setBorder(new spreadNS.LineBorder("Black", spreadNS.LineStyle.thin), { all: true });
        //sheet.options.gridline = {   //設定整體的線的樣式
  

    }