ナビゲーション リンクのスキップ
 新機能 の展開 新機能
 InputMan連携 の展開 InputMan連携
 マルチタッチ機能 の展開 マルチタッチ機能
 セル、行、列、ヘッダ の展開 セル、行、列、ヘッダ
 シート の展開 シート
 スタイル の展開 スタイル
 選択 の展開 選択
 セル型 の展開 セル型
 編集 の展開 編集
 ソート の展開 ソート
 フィルタリング の展開 フィルタリング
 グループ化 の展開 グループ化
 ページング の展開 ページング
 スクロール の展開 スクロール
 データ連結 の縮小 データ連結
 階層表示 の展開 階層表示
 コマンドバー の展開 コマンドバー
 チャート の展開 チャート
 数式 の展開 数式
 インポート/エクスポート の展開 インポート/エクスポート
 クライアント側スクリプト の展開 クライアント側スクリプト

アンバウンドデータ

コントロールをデータセットに連結しなくても、行・列を追加したり、値をセルに設定することができます。

このサンプルではセルのValueに値を直接設定し、データを表示しています。
 ID氏名カナ生年月日性別血液型部署入社日メールアドレス
11001亀甲 滋万キコウ シゲマ1950/02/04A人事部1972/04/01sigema_kikou@abc.co.jp
21002寒田 希世カンダ キヨ1959/06/28B人事部1981/04/01kiyo_kanda@bbb.or.jp
31003小和瀬 澄オワセ キヨ1969/03/06A人事部1991/04/01kiyo_owase@aaa.co.jp
41004宇夫 早余子ウブ サヨコ1976/07/28O人事部1998/04/01sayoko_ubu@bbb.or.jp
51005宇田津 聖智ウダツ キヨトモ1965/09/04A営業部1987/04/01kiyotomo_udatu@abc.co.jp
61006茨城 昭児イバラギ ショウジ1963/04/28O営業部1985/04/01shouzi_ibaragi@xyz.ne.jp
71007石ヶ休 椎茄イシガキュウ シイナ1953/02/21O営業部1975/04/01siina_isigagyuu@abc.co.jp
81008赤司 恵治郎アカツカサ ケイジロウ1968/08/02O経理部1990/04/01keizirou_akatukasa@abc.co.jp
91009小橋 仰一オハシ ギョウイチ1972/03/02B経理部1994/04/01gyouiti_ohasi@abc.co.jp
101010一重 公大イチジュウ コウダイ1964/04/19B経理部1986/04/01koudai_itizyuu@xyz.ne.jp
111011稲並 勝五郎イナミ ショウゴロウ1962/02/18A営業部1984/04/01shougorou_inami@bbb.or.jp
121012穎原 紀代一エイハラ キヨカズ1965/02/13O営業部1987/04/01kiyokazu_eihara@bbb.or.jp

ソースコード

別ウィンドウで表示
using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;

public partial class dataunbinding : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack) return;

        // データ設定
        setdata(FpSpread1.Sheets[0]);

        // SPREAD初期化
        InitSpread(FpSpread1.Sheets[0]);
    }
    
    private void InitSpread(FarPoint.Web.Spread.SheetView sheet)
    {
        // SPREAD設定
        sheet.FpSpread.CommandBar.Visible = false;
        sheet.FpSpread.CssClass = "spreadStyle";
        sheet.FpSpread.UseClipboard = false;

        // フォントサイズの設定
        sheet.DefaultStyle.Font.Size = FontUnit.Parse("80%");
        sheet.ColumnHeader.DefaultStyle.Font.Size = FontUnit.Parse("80%");
        sheet.RowHeader.DefaultStyle.Font.Size = FontUnit.Parse("80%");
        sheet.SheetCorner.DefaultStyle.Font.Size = FontUnit.Parse("80%");

        // シート設定
        sheet.PageSize = sheet.RowCount;

        // 列幅の設定
        sheet.Columns[0].Width = 36;
        sheet.Columns[1].Width = 88;
        sheet.Columns[2].Width = 91;
        sheet.Columns[3].Width = 80;
        sheet.Columns[4].Width = 36;
        sheet.Columns[5].Width = 46;
        sheet.Columns[6].Width = 49;
        sheet.Columns[7].Width = 80;
        sheet.Columns[8].Width = 181;

        // 縦方向の揃え位置を中央に設定
        sheet.DefaultStyle.VerticalAlign = VerticalAlign.Middle;
    }

    private void setdata(FarPoint.Web.Spread.SheetView sheet)
    {
        sheet.RowCount = 12;
        sheet.ColumnCount = 9;

        sheet.ColumnHeader.Cells[0, 0].Text = "ID";
        sheet.ColumnHeader.Cells[0, 1].Text = "氏名";
        sheet.ColumnHeader.Cells[0, 2].Text = "カナ";
        sheet.ColumnHeader.Cells[0, 3].Text = "生年月日";
        sheet.ColumnHeader.Cells[0, 4].Text = "性別";
        sheet.ColumnHeader.Cells[0, 5].Text = "血液型";
        sheet.ColumnHeader.Cells[0, 6].Text = "部署";
        sheet.ColumnHeader.Cells[0, 7].Text = "入社日";
        sheet.ColumnHeader.Cells[0, 8].Text = "メールアドレス";


        sheet.Cells[0, 0].Value = "1001";
        sheet.Cells[1, 0].Value = "1002";
        sheet.Cells[2, 0].Value = "1003";
        sheet.Cells[3, 0].Value = "1004";
        sheet.Cells[4, 0].Value = "1005";
        sheet.Cells[5, 0].Value = "1006";
        sheet.Cells[6, 0].Value = "1007";
        sheet.Cells[7, 0].Value = "1008";
        sheet.Cells[8, 0].Value = "1009";
        sheet.Cells[9, 0].Value = "1010";
        sheet.Cells[10, 0].Value = "1011";
        sheet.Cells[11, 0].Value = "1012";

        sheet.Cells[0, 1].Value = "亀甲 滋万";
        sheet.Cells[1, 1].Value = "寒田 希世";
        sheet.Cells[2, 1].Value = "小和瀬 澄";
        sheet.Cells[3, 1].Value = "宇夫 早余子";
        sheet.Cells[4, 1].Value = "宇田津 聖智";
        sheet.Cells[5, 1].Value = "茨城 昭児";
        sheet.Cells[6, 1].Value = "石ヶ休 椎茄";
        sheet.Cells[7, 1].Value = "赤司 恵治郎";
        sheet.Cells[8, 1].Value = "小橋 仰一";
        sheet.Cells[9, 1].Value = "一重 公大";
        sheet.Cells[10, 1].Value = "稲並 勝五郎";
        sheet.Cells[11, 1].Value = "穎原 紀代一";

        sheet.Cells[0, 2].Value = "キコウ シゲマ";
        sheet.Cells[1, 2].Value = "カンダ キヨ";
        sheet.Cells[2, 2].Value = "オワセ キヨ";
        sheet.Cells[3, 2].Value = "ウブ サヨコ";
        sheet.Cells[4, 2].Value = "ウダツ キヨトモ";
        sheet.Cells[5, 2].Value = "イバラギ ショウジ";
        sheet.Cells[6, 2].Value = "イシガキュウ シイナ";
        sheet.Cells[7, 2].Value = "アカツカサ ケイジロウ";
        sheet.Cells[8, 2].Value = "オハシ ギョウイチ";
        sheet.Cells[9, 2].Value = "イチジュウ コウダイ";
        sheet.Cells[10, 2].Value = "イナミ ショウゴロウ";
        sheet.Cells[11, 2].Value = "エイハラ キヨカズ";

        sheet.Cells[0, 3].Value = "1950/02/04";
        sheet.Cells[1, 3].Value = "1959/06/28";
        sheet.Cells[2, 3].Value = "1969/03/06";
        sheet.Cells[3, 3].Value = "1976/07/28";
        sheet.Cells[4, 3].Value = "1965/09/04";
        sheet.Cells[5, 3].Value = "1963/04/28";
        sheet.Cells[6, 3].Value = "1953/02/21";
        sheet.Cells[7, 3].Value = "1968/08/02";
        sheet.Cells[8, 3].Value = "1972/03/02";
        sheet.Cells[9, 3].Value = "1964/04/19";
        sheet.Cells[10, 3].Value = "1962/02/18";
        sheet.Cells[11, 3].Value = "1965/02/13";

        sheet.Cells[0, 4].Value = "";
        sheet.Cells[1, 4].Value = "";
        sheet.Cells[2, 4].Value = "";
        sheet.Cells[3, 4].Value = "";
        sheet.Cells[4, 4].Value = "";
        sheet.Cells[5, 4].Value = "";
        sheet.Cells[6, 4].Value = "";
        sheet.Cells[7, 4].Value = "";
        sheet.Cells[8, 4].Value = "";
        sheet.Cells[9, 4].Value = "";
        sheet.Cells[10, 4].Value = "";
        sheet.Cells[11, 4].Value = "";

        sheet.Cells[0, 5].Value = "A";
        sheet.Cells[1, 5].Value = "B";
        sheet.Cells[2, 5].Value = "A";
        sheet.Cells[3, 5].Value = "O";
        sheet.Cells[4, 5].Value = "A";
        sheet.Cells[5, 5].Value = "O";
        sheet.Cells[6, 5].Value = "O";
        sheet.Cells[7, 5].Value = "O";
        sheet.Cells[8, 5].Value = "B";
        sheet.Cells[9, 5].Value = "B";
        sheet.Cells[10, 5].Value = "A";
        sheet.Cells[11, 5].Value = "O";

        sheet.Cells[0, 6].Value = "人事部";
        sheet.Cells[1, 6].Value = "人事部";
        sheet.Cells[2, 6].Value = "人事部";
        sheet.Cells[3, 6].Value = "人事部";
        sheet.Cells[4, 6].Value = "営業部";
        sheet.Cells[5, 6].Value = "営業部";
        sheet.Cells[6, 6].Value = "営業部";
        sheet.Cells[7, 6].Value = "経理部";
        sheet.Cells[8, 6].Value = "経理部";
        sheet.Cells[9, 6].Value = "経理部";
        sheet.Cells[10, 6].Value = "営業部";
        sheet.Cells[11, 6].Value = "営業部";

        sheet.Cells[0, 7].Value = "1972/04/01";
        sheet.Cells[1, 7].Value = "1981/04/01";
        sheet.Cells[2, 7].Value = "1991/04/01";
        sheet.Cells[3, 7].Value = "1998/04/01";
        sheet.Cells[4, 7].Value = "1987/04/01";
        sheet.Cells[5, 7].Value = "1985/04/01";
        sheet.Cells[6, 7].Value = "1975/04/01";
        sheet.Cells[7, 7].Value = "1990/04/01";
        sheet.Cells[8, 7].Value = "1994/04/01";
        sheet.Cells[9, 7].Value = "1986/04/01";
        sheet.Cells[10, 7].Value = "1984/04/01";
        sheet.Cells[11, 7].Value = "1987/04/01";

        sheet.Cells[0, 8].Value = "sigema_kikou@abc.co.jp";
        sheet.Cells[1, 8].Value = "kiyo_kanda@bbb.or.jp";
        sheet.Cells[2, 8].Value = "kiyo_owase@aaa.co.jp";
        sheet.Cells[3, 8].Value = "sayoko_ubu@bbb.or.jp";
        sheet.Cells[4, 8].Value = "kiyotomo_udatu@abc.co.jp";
        sheet.Cells[5, 8].Value = "shouzi_ibaragi@xyz.ne.jp";
        sheet.Cells[6, 8].Value = "siina_isigagyuu@abc.co.jp";
        sheet.Cells[7, 8].Value = "keizirou_akatukasa@abc.co.jp";
        sheet.Cells[8, 8].Value = "gyouiti_ohasi@abc.co.jp";
        sheet.Cells[9, 8].Value = "koudai_itizyuu@xyz.ne.jp";
        sheet.Cells[10, 8].Value = "shougorou_inami@bbb.or.jp";
        sheet.Cells[11, 8].Value = "kiyokazu_eihara@bbb.or.jp";
    }
}

Partial Public Class dataunbinding
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack Then
            Return
        End If

        ' データ設定
        setdata(FpSpread1.Sheets(0))

        ' SPREAD初期化
        InitSpread(FpSpread1.Sheets(0))
    End Sub

    Private Sub InitSpread(ByVal sheet As FarPoint.Web.Spread.SheetView)
        ' SPREAD設定
        sheet.FpSpread.CommandBar.Visible = False
        sheet.FpSpread.CssClass = "spreadStyle"
        sheet.FpSpread.UseClipboard = False

        ' フォントサイズの設定
        sheet.DefaultStyle.Font.Size = FontUnit.Parse("80%")
        sheet.ColumnHeader.DefaultStyle.Font.Size = FontUnit.Parse("80%")
        sheet.RowHeader.DefaultStyle.Font.Size = FontUnit.Parse("80%")
        sheet.SheetCorner.DefaultStyle.Font.Size = FontUnit.Parse("80%")

        ' シート設定
        sheet.PageSize = sheet.RowCount

        ' 列幅の設定
        sheet.Columns(0).Width = 36
        sheet.Columns(1).Width = 88
        sheet.Columns(2).Width = 91
        sheet.Columns(3).Width = 80
        sheet.Columns(4).Width = 36
        sheet.Columns(5).Width = 46
        sheet.Columns(6).Width = 49
        sheet.Columns(7).Width = 80
        sheet.Columns(8).Width = 181

        ' 縦方向の揃え位置を中央に設定
        sheet.DefaultStyle.VerticalAlign = VerticalAlign.Middle
    End Sub

    Private Sub setdata(ByVal sheet As FarPoint.Web.Spread.SheetView)
        sheet.RowCount = 12
        sheet.ColumnCount = 9

        sheet.ColumnHeader.Cells(0, 0).Text = "ID"
        sheet.ColumnHeader.Cells(0, 1).Text = "氏名"
        sheet.ColumnHeader.Cells(0, 2).Text = "カナ"
        sheet.ColumnHeader.Cells(0, 3).Text = "生年月日"
        sheet.ColumnHeader.Cells(0, 4).Text = "性別"
        sheet.ColumnHeader.Cells(0, 5).Text = "血液型"
        sheet.ColumnHeader.Cells(0, 6).Text = "部署"
        sheet.ColumnHeader.Cells(0, 7).Text = "入社日"
        sheet.ColumnHeader.Cells(0, 8).Text = "メールアドレス"


        sheet.Cells(0, 0).Value = "1001"
        sheet.Cells(1, 0).Value = "1002"
        sheet.Cells(2, 0).Value = "1003"
        sheet.Cells(3, 0).Value = "1004"
        sheet.Cells(4, 0).Value = "1005"
        sheet.Cells(5, 0).Value = "1006"
        sheet.Cells(6, 0).Value = "1007"
        sheet.Cells(7, 0).Value = "1008"
        sheet.Cells(8, 0).Value = "1009"
        sheet.Cells(9, 0).Value = "1010"
        sheet.Cells(10, 0).Value = "1011"
        sheet.Cells(11, 0).Value = "1012"

        sheet.Cells(0, 1).Value = "亀甲 滋万"
        sheet.Cells(1, 1).Value = "寒田 希世"
        sheet.Cells(2, 1).Value = "小和瀬 澄"
        sheet.Cells(3, 1).Value = "宇夫 早余子"
        sheet.Cells(4, 1).Value = "宇田津 聖智"
        sheet.Cells(5, 1).Value = "茨城 昭児"
        sheet.Cells(6, 1).Value = "石ヶ休 椎茄"
        sheet.Cells(7, 1).Value = "赤司 恵治郎"
        sheet.Cells(8, 1).Value = "小橋 仰一"
        sheet.Cells(9, 1).Value = "一重 公大"
        sheet.Cells(10, 1).Value = "稲並 勝五郎"
        sheet.Cells(11, 1).Value = "穎原 紀代一"

        sheet.Cells(0, 2).Value = "キコウ シゲマ"
        sheet.Cells(1, 2).Value = "カンダ キヨ"
        sheet.Cells(2, 2).Value = "オワセ キヨ"
        sheet.Cells(3, 2).Value = "ウブ サヨコ"
        sheet.Cells(4, 2).Value = "ウダツ キヨトモ"
        sheet.Cells(5, 2).Value = "イバラギ ショウジ"
        sheet.Cells(6, 2).Value = "イシガキュウ シイナ"
        sheet.Cells(7, 2).Value = "アカツカサ ケイジロウ"
        sheet.Cells(8, 2).Value = "オハシ ギョウイチ"
        sheet.Cells(9, 2).Value = "イチジュウ コウダイ"
        sheet.Cells(10, 2).Value = "イナミ ショウゴロウ"
        sheet.Cells(11, 2).Value = "エイハラ キヨカズ"

        sheet.Cells(0, 3).Value = "1950/02/04"
        sheet.Cells(1, 3).Value = "1959/06/28"
        sheet.Cells(2, 3).Value = "1969/03/06"
        sheet.Cells(3, 3).Value = "1976/07/28"
        sheet.Cells(4, 3).Value = "1965/09/04"
        sheet.Cells(5, 3).Value = "1963/04/28"
        sheet.Cells(6, 3).Value = "1953/02/21"
        sheet.Cells(7, 3).Value = "1968/08/02"
        sheet.Cells(8, 3).Value = "1972/03/02"
        sheet.Cells(9, 3).Value = "1964/04/19"
        sheet.Cells(10, 3).Value = "1962/02/18"
        sheet.Cells(11, 3).Value = "1965/02/13"

        sheet.Cells(0, 4).Value = ""
        sheet.Cells(1, 4).Value = ""
        sheet.Cells(2, 4).Value = ""
        sheet.Cells(3, 4).Value = ""
        sheet.Cells(4, 4).Value = ""
        sheet.Cells(5, 4).Value = ""
        sheet.Cells(6, 4).Value = ""
        sheet.Cells(7, 4).Value = ""
        sheet.Cells(8, 4).Value = ""
        sheet.Cells(9, 4).Value = ""
        sheet.Cells(10, 4).Value = ""
        sheet.Cells(11, 4).Value = ""

        sheet.Cells(0, 5).Value = "A"
        sheet.Cells(1, 5).Value = "B"
        sheet.Cells(2, 5).Value = "A"
        sheet.Cells(3, 5).Value = "O"
        sheet.Cells(4, 5).Value = "A"
        sheet.Cells(5, 5).Value = "O"
        sheet.Cells(6, 5).Value = "O"
        sheet.Cells(7, 5).Value = "O"
        sheet.Cells(8, 5).Value = "B"
        sheet.Cells(9, 5).Value = "B"
        sheet.Cells(10, 5).Value = "A"
        sheet.Cells(11, 5).Value = "O"

        sheet.Cells(0, 6).Value = "人事部"
        sheet.Cells(1, 6).Value = "人事部"
        sheet.Cells(2, 6).Value = "人事部"
        sheet.Cells(3, 6).Value = "人事部"
        sheet.Cells(4, 6).Value = "営業部"
        sheet.Cells(5, 6).Value = "営業部"
        sheet.Cells(6, 6).Value = "営業部"
        sheet.Cells(7, 6).Value = "経理部"
        sheet.Cells(8, 6).Value = "経理部"
        sheet.Cells(9, 6).Value = "経理部"
        sheet.Cells(10, 6).Value = "営業部"
        sheet.Cells(11, 6).Value = "営業部"

        sheet.Cells(0, 7).Value = "1972/04/01"
        sheet.Cells(1, 7).Value = "1981/04/01"
        sheet.Cells(2, 7).Value = "1991/04/01"
        sheet.Cells(3, 7).Value = "1998/04/01"
        sheet.Cells(4, 7).Value = "1987/04/01"
        sheet.Cells(5, 7).Value = "1985/04/01"
        sheet.Cells(6, 7).Value = "1975/04/01"
        sheet.Cells(7, 7).Value = "1990/04/01"
        sheet.Cells(8, 7).Value = "1994/04/01"
        sheet.Cells(9, 7).Value = "1986/04/01"
        sheet.Cells(10, 7).Value = "1984/04/01"
        sheet.Cells(11, 7).Value = "1987/04/01"

        sheet.Cells(0, 8).Value = "sigema_kikou@abc.co.jp"
        sheet.Cells(1, 8).Value = "kiyo_kanda@bbb.or.jp"
        sheet.Cells(2, 8).Value = "kiyo_owase@aaa.co.jp"
        sheet.Cells(3, 8).Value = "sayoko_ubu@bbb.or.jp"
        sheet.Cells(4, 8).Value = "kiyotomo_udatu@abc.co.jp"
        sheet.Cells(5, 8).Value = "shouzi_ibaragi@xyz.ne.jp"
        sheet.Cells(6, 8).Value = "siina_isigagyuu@abc.co.jp"
        sheet.Cells(7, 8).Value = "keizirou_akatukasa@abc.co.jp"
        sheet.Cells(8, 8).Value = "gyouiti_ohasi@abc.co.jp"
        sheet.Cells(9, 8).Value = "koudai_itizyuu@xyz.ne.jp"
        sheet.Cells(10, 8).Value = "shougorou_inami@bbb.or.jp"
        sheet.Cells(11, 8).Value = "kiyokazu_eihara@bbb.or.jp"
    End Sub
End Class
<%@ Page MasterPageFile="~/MasterPage.master" Language="c#" AutoEventWireup="true" 
         Inherits="dataunbinding" CodeFile="dataunbinding.aspx.cs" %>

<%@ Register Assembly="FarPoint.Web.SpreadJ" Namespace="FarPoint.Web.Spread" TagPrefix="FarPoint" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <farpoint:FpSpread ID="FpSpread1" runat="server">
        <CommandBar BackColor="Control" ButtonFaceColor="Control" ButtonHighlightColor="ControlLightLight"
            ButtonShadowColor="ControlDark" />
        <Sheets>
            <farpoint:SheetView SheetName="Sheet1">
            </farpoint:SheetView>
        </Sheets>
    </farpoint:FpSpread>
</asp:Content>