# VisualforceページでのSheetの利用

作成したシートは任意のVisualforceページの中でVisualforceコンポーネントを利用して表示することが可能です。配置されたコンポーネントはVisualforceページからスクリプトを介して動作を制御することも可能です。

Visualforceページにシートを表示するコンポーネントを配置するには、以下の手順に従います。

1. Visualforceページを用意し、下記のようにして`msmxSheet:SheetView`コンポーネントを追加します。ブックIDおよびシートIDについては[「URLでのシートへのアクセス」](/mashmatrix-sheet/ja/customization/access_sheet_directly_with_url.md)を参考に指定します。

```
<apex:page>
  // ...
  <msmxSheet:SheetView
    id="(コンポーネントのID)"
    bookId="(ブックID)"
    sheetId="(シートID)"
    width="100%"
    height="400px"
  />
</apex:page>
```

`msmxSheet:SheetView`コンポーネントに指定可能な属性は以下のとおりです。

* **id** - 表示するコンポーネントのID
* **bookId** - 表示するシートを含むブックのID (必須)
* **sheetId** - 表示するシートのID。シートIDの値はシート設定から参照可能。指定されない場合はブックに含まれるシートが全てタブで表示される
* **recordId** - コンテキストとなるレコードのID。このID値がフィルタの「関連レコードID」として利用される
* **width** - コンポーネントの幅。ピクセルおよびパーセントでの指定が可能
* **height** - コンポーネントの高さ。ピクセルおよびパーセントでの指定が可能


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mashmatrix.com/mashmatrix-sheet/ja/customization/using_sheet_component_in_visualforce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
