apply_template
Create a new page in a PBIR report by cloning and rebinding visuals from a template kit, avoiding manual layout work; close the .pbip in Power BI Desktop first.
Instructions
Dựng TRANG MỚI vào báo cáo PBIR từ template kit (clone-and-rebind — không dựng layout từ đầu). ⚠️ File .pbip phải ĐANG ĐÓNG trong Power BI Desktop (mở + Ctrl+S sẽ đè mất trang mới).
report_path: file .pbip, folder *.Report, hoặc folder definition (SẼ GHI vào đây).
kit_dir: thư mục kit (tạo bởi distill_template, hoặc report-templates/ có sẵn — xem list_templates).
page_spec: JSON string: {"displayName": "Tên trang", "visuals": [ {"block": "cardVisual", "x": 30, "y": 100, "z": 1000, "width": 280, "height": 110, "visualType": "(tùy chọn — đổi loại chart, phải chỉnh roles khớp)", "title": "(tùy chọn — ghi đè text title, giữ style)", "fields": {"Data": [{"type": "Measure", "entity": "Công thức", "property": "Tổng TB"}]}} ]} Role theo loại: card/slicer=Values · cardVisual=Data · line/area/combo=Category/Y/Series · pivotTable=Rows/Columns/Values. Field type: Measure | Column. Trả về: đường trang mới + việc cần làm tay (mở lại Power BI để nghiệm thu).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kit_dir | Yes | ||
| page_spec | Yes | ||
| report_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |