لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Build tables and crosstabs

آزاد تازه‌وارد تاییدشده امن

داده‌ها را پاک‌سازی و تحلیل می‌کند، شاخص‌های کلیدی را استخراج می‌کند و در پیاده‌سازی مدل‌ها یا خط لولهٔ RAG کمک می‌کند. (شامل ۱۰ گام عملی · سازگار با Claude Code و Cursor).

سازگاری با ابزارها: سازنده فقط میزبان‌های نام‌برده را تأیید کرده است. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: tables-crosstabs
description: Build and debug JasperReports table and crosstab components, including dataset runs, column and row groups, measures, subtotal and grand-total cells, empty cells and output that spans or overflows pages. Use when table or crosstab values, totals or headers are wrong, missing or repeated, or a table or crosstab must be designed; not for plain detail-band reports without table or crosstab components.
---

# Build tables and crosstabs

## Establish the component contract

Identify the exact engine/Java versions, the rows the component reads (main report data or a sub-dataset with its own data source), the grouping keys, measures and their types, which subtotals and grand totals are expected, how empty groups and null values must print, and the page size and export formats that must hold the result. Ask for the expected output, ideally a small table of input rows and printed values, instead of guessing totals.

## Workflow

1. Choose the component by shape. Use a table when rows are records with fixed columns and optional group subtotals; use a crosstab when both rows and columns come from data values, such as regions by quarter. Use a detail band or list instead when neither is needed.
2. Feed the component its own data. A table reads a `subDataset` through `datasetRun` and needs a fresh data source per fill, for example `new JRBeanCollectionDataSource($P{Rows})`. A crosstab with an empty `<dataset/>` reads the main report data; place it in the summary (or another band printed once) so it sees every row. A crosstab with a `datasetRun` follows the same fresh-cursor rule. Sort or group input as the component expects.
3. Define crosstab groups and measures with explicit classes. Give each `rowGroup` and `columnGroup` a `bucket` with a typed `expression`, and set `totalPosition="End"` (or `Start`) only for groups that need totals. Use `BigDecimal` measures for money, with `calculation="Sum"`, `Count`, `Average` or another calculation as required.
4. Declare every cell combination. The base `<cell>` holds group values; add cells with `columnTotalGroup`, `rowTotalGroup` and both attributes for row totals, column totals and the grand total. A missing total cell leaves that area blank. Label totals in the total headers, not by guessing in the cell.
5. Decide how empty values print. In the tested 7.1.1 runtime, a crosstab `Sum` cell without matching rows and a cell whose only value is null both print `0`, not null, and a crosstab with no input rows prints nothing at all. If an empty cell must print a dash or blank, add a second measure with `calculation="Count"` over the same field and test it in the cell expression, for example `$V{Rows} == 0 ? "-" : String.valueOf($V{Amount})`. Crosstab measures have no automatic `_COUNT` variable, and `Count` skips null values, so a cell holding only nulls also counts as empty.
6. Build table subtotals from dataset groups. Declare the group and its variables (`resetType="Group"`) in the sub-dataset, then add `<groupHeader groupName="...">` or `<groupFooter groupName="...">` with a `<cell height>` to each column; use `tableFooter` for report totals. Without a table `whenNoDataType`, an empty table prints nothing; `whenNoDataType="AllSectionsNoDetail"` prints headers and footers with null totals, so guard them.
7. Plan for overflow. A table continues across pages and repeats its column header on each page; check that totals print only once at the end. A crosstab that is too wide breaks its columns into blocks and repeats row headers in each block; keep `repeatColumnHeaders` and `repeatRowHeaders` at their defaults unless the output must differ, and size cell widths for the narrowest export target.

## Validate and deliver

Fill with input that covers every group, a group with no data for some column, a null measure, empty input and enough rows or columns to break the page. Assert exact cell values, every subtotal and grand total, how empty cells print and which headers repeat on each page or column block. Read values from the filled print or from the exported output rather than from screenshots. State commands and results, and label any export or page size you could not execute as unverified.

## Sources

- [Sample reference](https://jasperreports.sourceforge.net/sample.reference/README.html)
- [Schema reference](https://jasperreports.sourceforge.net/schema.reference.html)
- [API](https://jasperreports.sourceforge.net/api/index.html)


— ‹guest · 2026-11-29› —

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
داده و تحلیل
✦ Pro

XLSX creation, editing, and analysis

«XLSX creation, editing, and analysis» یک مهارت آماده در حوزهٔ داده و تحلیل است؛ به دستیار هوش مصنوعی شما یاد می‌دهد «پ…

⚡ /xlsx SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۱۹۸,۷۹۴
داده و تحلیل
✦ Pro

BigQuery Migration Data Exporter

«BigQuery Migration Data Exporter» همان چیزی است که وقتی سر داده و تحلیل کار می‌کنید کم است: دستیار شما با این مهارت «ط…

⚡ /bigquery-migration-data-exporter SKILL.md
MCP
۹۶/۱۰۰ ★ ۲۴,۵۴۸
داده و تحلیل
✦ Pro

BigQuery Migration Data Loader

«BigQuery Migration Data Loader» یک مهارت آماده در حوزهٔ داده و تحلیل است؛ به دستیار هوش مصنوعی شما یاد می‌دهد «طراحی و…

⚡ /bigquery-migration-data-loader SKILL.md
MCP
۹۶/۱۰۰ ★ ۲۴,۵۴۸
داده و تحلیل
✦ Pro

BigQuery Migration Metadata Extraction

برای کارهای داده و تحلیل، «BigQuery Migration Metadata Extraction» یک راهنمای کوتاه و روشن است: مسیر «طراحی و بهینه‌ساز…

⚡ /bigquery-migration-metadata-extractor SKILL.md
MCP
۹۶/۱۰۰ ★ ۲۴,۵۴۸
داده و تحلیل
✦ Pro

BigQuery Migration Service (BQMS) SQL Translator

«BigQuery Migration Service (BQMS) SQL Translator» همان چیزی است که وقتی سر داده و تحلیل کار می‌کنید کم است: دستیار شما…

⚡ /bigquery-migration-sql-translator SKILL.md
Claude / Claude CodeCursor +۲
۹۶/۱۰۰ ★ ۲۴,۵۴۸
داده و تحلیل
✦ Pro

BigQuery Migration Validator

برای کارهای داده و تحلیل، «BigQuery Migration Validator» یک راهنمای کوتاه و روشن است: مسیر «طراحی و بهینه‌سازی دیتابیس»…

⚡ /bigquery-migration-validator SKILL.md
MCP
۹۶/۱۰۰ ★ ۲۴,۵۴۸