diff --git a/.claude/settings.local.json b/.claude/settings.local.json
new file mode 100644
index 0000000..1956da5
--- /dev/null
+++ b/.claude/settings.local.json
@@ -0,0 +1,46 @@
+{
+ "permissions": {
+ "allow": [
+ "Bash(git submodule *)",
+ "Bash(python -c \"import py_compile; py_compile.compile\\('scripts/init_kb.py', doraise=True\\); print\\('init_kb.py OK'\\)\")",
+ "Bash(python -c \"import py_compile; py_compile.compile\\('agent/nodes.py', doraise=True\\); print\\('nodes.py OK'\\)\")",
+ "Bash(python -c \"import py_compile; py_compile.compile\\('backend/embeddings.py', doraise=True\\); print\\('embeddings.py OK'\\)\")",
+ "Bash(python *)",
+ "Bash(PYTHONIOENCODING=utf-8 python batch_chunker.py jrxml_source)",
+ "Bash(taskkill /F /IM python.exe)",
+ "Bash(pkill -f embed_chunks)",
+ "Bash(pip show *)",
+ "Bash(streamlit run *)",
+ "Bash(curl -s http://localhost:8001/validate -X POST -H \"Content-Type: application/json\" -d '{\"jrxml\":\"\"}')",
+ "Bash(STREAMLIT_SERVER_HEADLESS=true streamlit run app.py --server.port 8501)",
+ "Bash(git add *)",
+ "Bash(git commit -m ' *)",
+ "Bash(pip install *)",
+ "Bash(git push *)",
+ "Bash(claude mcp *)",
+ "mcp__zai-mcp-server__extract_text_from_screenshot",
+ "mcp__MiniMax__understand_image",
+ "Bash(curl -s http://localhost:8001/health)",
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8501)",
+ "Bash(curl -s -X POST http://localhost:8001/validate -H \"Content-Type: application/json\" -d \"{\\\\\"jrxml\\\\\": \\\\\"\\\\\"}\")",
+ "Bash(curl -s -X POST http://localhost:8001/validate -H \"Content-Type: application/json\" -d \"{\\\\\"jrxml\\\\\": \\\\\"\\\\\"}\")",
+ "Bash(curl -s -X POST http://localhost:8001/validate -H \"Content-Type: application/json\" -d \"{\\\\\"jrxml\\\\\": \\\\\"\\\\\"}\")",
+ "Bash(curl -s -X POST http://localhost:8001/validate -H 'Content-Type: application/json' -d '{\"jrxml\": \"\"}')",
+ "Bash(curl -s -o /dev/null -w \"Streamlit: %{http_code}\\\\n\" http://localhost:8501)",
+ "Bash(grep -v \"Complete$\")",
+ "Bash(git pull *)",
+ "Bash(pip search *)",
+ "Read",
+ "Write",
+ "Edit",
+ "Bash",
+ "Git",
+ "Npm",
+ "Pip",
+ "Grep",
+ "Glob",
+ "Bash(rm -rf components/* assets/* style.css)",
+ "Bash(mkdir -p api stores components utils)"
+ ]
+ }
+}
diff --git a/.env.example b/.env.example
index 5fa95f1..aba9d01 100644
--- a/.env.example
+++ b/.env.example
@@ -48,7 +48,7 @@ RAG_USE_FP16=true
RAG_BATCH_SIZE=64
# 最大自动修正尝试次数
-MAX_RETRY=3
+MAX_RETRY=5
# 上下文压缩阈值(token 数)
CONTEXT_MAX_TOKENS=6000
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
new file mode 100644
index 0000000..ccc5301
--- /dev/null
+++ b/ARCHITECTURE.md
@@ -0,0 +1,341 @@
+# JRXML 生成代理 — 架构文档
+
+## 概览
+
+一个三层架构的桌面应用,通过自然语言多轮对话帮助非技术用户创建 JasperReports 模板(JRXML)。核心流程:用户输入 → 意图识别 → 模板检索 → LLM 生成/修改 → 自动验证修正 → 输出可编译的 JRXML。
+
+```
+┌──────────────────────────────────────────────────────────────┐
+│ Vue 3 + Vite 前端 (:5173) │
+│ frontend/ (聊天界面 + SSE 流式) │
+│ 聊天界面 / 会话管理 / JRXML 预览 / 下载 / 快捷操作 │
+└─────────────────────┬────────────────────────────────────────┘
+ │ HTTP + SSE (/api/*)
+ ▼
+┌──────────────────────────────────────────────────────────────┐
+│ FastAPI SSE 后端 (:8000) │
+│ api_server.py │
+│ REST: /api/sessions, /api/upload, /api/.../download/latest │
+│ SSE: /api/sessions/{id}/chat (流式推送) │
+│ 事件: node_start | node_complete | stream_token │
+│ agent_complete | agent_error │
+└─────────────────────┬────────────────────────────────────────┘
+ │ run_agent(user_input)
+ ▼
+┌──────────────────────────────────────────────────────────────┐
+│ LangGraph 状态机 (agent/) │
+│ │
+│ load_session → process_input → manage_context │
+│ → save_state_snapshot → classify_intent │
+│ │ │ │ │ │ │
+│ ▼ ▼ ▼ ▼ ▼ │
+│ retrieve modify_jrxml preview consult undo/reset │
+│ │ │ /export │
+│ ▼ ▼ │
+│ generate save_session │
+│ │ │ │
+│ └────┬─────┘ │
+│ ▼ │
+│ (jrxml_reorder 自动规范化元素顺序) │
+│ ▼ │
+│ validate ──(fail)──► explain_error ──► correct_jrxml │
+│ │ ▲ │ │
+│ (pass) └──(retry` 声明)
+ - `` 是否含有效 SQL SELECT
+ - `` 必需属性(pageWidth, pageHeight, name)
+
+2. **XSD Schema 校验**(可选):
+ - 需要 `validation_service/schemas/jasperreport_7_0_6.xsd` 文件
+ - 使用 `lxml.etree.XMLSchema` 进行完整 schema 校验
+
+### 会话持久化(backend/session.py)
+
+```
+sessions/{session_id}.json
+ {
+ "session_id": "abc123def456",
+ "session_name": "员工名册报表",
+ "created_at": "2026-05-19T09:00:00+00:00",
+ "updated_at": "2026-05-19T09:30:00+00:00",
+ "agent_state": { ... } // 完整的 AgentState 字段
+ }
+```
+
+## 关键 Prompt 设计
+
+| Prompt | 用途 | 输出约束 |
+|--------|------|---------|
+| `INTENT_CLASSIFY_PROMPT` | 8 分类意图识别 | 只输出意图名称 |
+| `INITIAL_GENERATION_PROMPT` | 首次生成 JRXML | 只输出 JRXML,无 markdown |
+| `MODIFICATION_PROMPT` | 修改现有 JRXML | 只输出完整 JRXML |
+| `CORRECTION_PROMPT` | 自动修正错误 | 只输出修复后 JRXML |
+| `EXPLAIN_PROMPT` | 错误转人话 | 2-3 句话 |
+| `COMPRESSION_PROMPT` | 对话压缩 | ≤200 字摘要 |
+| `CONSULT_PROMPT` | 咨询解答 | 简洁中文 |
+
+## 配置参数(.env)
+
+| 参数 | 默认值 | 说明 |
+|------|--------|------|
+| `LLM_BACKEND` | cloud | cloud / local |
+| `LLM_PROVIDER` | openai | openai / anthropic |
+| `OPENAI_API_KEY` | — | API 密钥 |
+| `OPENAI_BASE_URL` | https://api.openai.com/v1 | API 端点 |
+| `LLM_MODEL` | gpt-4o | 模型名称 |
+| `LOCAL_LLM_MODEL` | qwen2.5-coder:7b | Ollama 模型 |
+| `EMBED_BACKEND` | local | local / cloud |
+| `LOCAL_EMBED_MODEL` | Qwen/Qwen3-Embedding-0.6B | 本地嵌入模型 |
+| `VALIDATION_SERVICE_URL` | http://localhost:8001/validate | 验证端点 |
+| `CHROMA_PERSIST_DIR` | ./db/chroma | ChromaDB 路径 |
+| `MAX_RETRY` | 5 | 自动修正最大尝试次数 |
+| `CONTEXT_MAX_TOKENS` | 6000 | 触发压缩的 token 阈值 |
+| `CONTEXT_KEEP_RECENT` | 4 | 保留最近 N 轮完整对话 |
+| `SESSIONS_DIR` | ./sessions | 会话 JSON 存储目录 |
+| `HISTORY_MAX_SNAPSHOTS` | 10 | 撤销快照保留数量 |
+
+## 启动流程
+
+```bash
+# 1. 安装依赖
+pip install -r requirements.txt
+
+# 2. 配置环境
+cp .env.example .env
+# 编辑 .env 填入 API 密钥
+
+# 3. 初始化知识库(预下载嵌入模型)
+python scripts/init_kb.py --download-model
+
+# 4. 启动验证服务(终端 1)
+python -m uvicorn validation_service.main:app --port 8001 --host 0.0.0.0
+
+# 5. 启动 Streamlit 界面(终端 2)
+STREAMLIT_SERVER_HEADLESS=true streamlit run app.py --server.port 8501
+
+# 6. 访问 http://localhost:8501
+```
+
+## 测试
+
+```bash
+pytest tests/test_validation.py -v # 验证服务单元测试
+pytest tests/test_agent.py -v # 代理集成测试
+pytest tests/ -v # 全部测试
+```
+
+## 技术栈
+
+| 层 | 技术 |
+|----|------|
+| UI | Streamlit 1.57 |
+| 工作流引擎 | LangGraph 1.2 |
+| LLM 接入 | Anthropic SDK / LangChain-OpenAI / LangChain-Ollama |
+| 向量数据库 | ChromaDB 1.5 |
+| 嵌入模型 | Sentence-Transformers (HuggingFace) |
+| 验证服务 | FastAPI + lxml XMLSchema |
+| HTTP 客户端 | httpx |
+| Token 计算 | tiktoken |
+| 持久化 | JSON 文件 + ChromaDB PersistentClient |
diff --git a/CODE_GUIDE.md b/CODE_GUIDE.md
index 314536b..d004c5b 100644
--- a/CODE_GUIDE.md
+++ b/CODE_GUIDE.md
@@ -31,7 +31,7 @@
## 1. 项目是什么
-**一句话**:用户用中文描述报表需求 → LLM 生成 JRXML 模板 → 自动验证 → 失败则自动修正(最多 3 次)→ 重试耗尽后失败上下文自动注入下一轮 → 返回可用的 JRXML 文件。
+**一句话**:用户用中文描述报表需求 → LLM 生成 JRXML 模板 → 自动验证 → 失败则自动修正(最多 5 次)→ 重试耗尽后失败上下文自动注入下一轮 → 返回可用的 JRXML 文件。
**技术栈**:Streamlit(UI) + LangGraph(状态机) + LLM(MiniMax/OpenAI/Ollama) + ChromaDB(向量库) + FastAPI(验证微服务)
@@ -110,7 +110,7 @@ streamlit run app.py --server.port 8501
│ │ │ │
│ │ correct_jrxml │
│ │ │ │
-│ │ (retry < 3) ────┘ │
+│ │ (retry < 5) ────┘ │
│ ▼ │
│ finalize → END │
└──────────────────────────┬───────────────────────────────────┘
@@ -251,14 +251,14 @@ def route_after_correct(state) -> Literal["validate", "finalize"]:
return "validate" if state.get("retry_count", 0) < MAX_RETRY else "finalize"
```
-**MAX_RETRY 默认为 3**(`.env` 中配置)。重试耗尽后进入 finalize,finalize 会将失败上下文写入 `pending_failure_context`,下次用户输入时 `process_input` 自动注入。
+**MAX_RETRY 默认为 5**(`.env` 中配置)。重试耗尽后进入 finalize,finalize 会将失败上下文写入 `pending_failure_context`,下次用户输入时 `process_input` 自动注入。
```
**关键路由逻辑**:
- `route_by_intent`:8 种意图分叉,是整个系统的"交通枢纽"
- `route_after_retrieve`:有 layout_schema → 3 阶段精确生成(generate_skeleton → refine_layout → map_fields),无 schema → 原 1-shot generate
- `route_after_save`:预览/导出意图**跳过验证**直通 finalize(这是修复预览问题的关键)
-- `route_after_correct`:重试次数 < 3 则继续验证循环,否则认输
+- `route_after_correct`:重试次数 < 5 则继续验证循环,否则认输
### 5.2 图构建
@@ -347,9 +347,9 @@ def build_graph():
│ ▼ │
│ correct_jrxml │
│ │ │
- │ ├── retry < 3? ──► validate (循环) │
+ │ ├── retry < 5? ──► validate (循环) │
│ │ │
- │ └── retry >= 3? ──► finalize (放弃) │
+ │ └── retry >= 5? ──► finalize (放弃) │
│ │
▼ │
finalize ──► END │
@@ -1169,7 +1169,7 @@ parent.addEventListener('keydown', function(e) {
| `RAG_USE_GPU` | `true` | GPU 加速 |
| `RAG_USE_FP16` | `true` | 半精度推理 |
| `VALIDATION_SERVICE_URL` | `http://localhost:8001/validate` | 验证服务地址 |
-| `MAX_RETRY` | `3` | 最大自动修正次数 |
+| `MAX_RETRY` | `5` | 最大自动修正次数 |
| `CONTEXT_MAX_TOKENS` | `6000` | 触发压缩的 token 阈值 |
| `CONTEXT_KEEP_RECENT` | `4` | 压缩时保留最近 N 轮 |
| `SESSIONS_DIR` | `./sessions` | 会话文件目录 |
diff --git a/RAG_INTEGRATION.md b/RAG_INTEGRATION.md
new file mode 100644
index 0000000..4a88d77
--- /dev/null
+++ b/RAG_INTEGRATION.md
@@ -0,0 +1,91 @@
+# RAG 知识库集成说明
+
+## 概述
+
+使用 `rag_jrxml` 子项目的语义分块管线替换原有的简单向量知识库。`rag_jrxml` 独立运行产出 ChromaDB,主项目通过 `backend/rag_adapter.py` 查询。
+
+## 架构
+
+```
+rag/ ← git submodule (rag_jrxml)
+├── jrxml_source/ ← 源数据目录 (242 .jrxml + 16 .md)
+├── models/ ← 嵌入模型本地存放
+│ └── paraphrase-multilingual-MiniLM-L12-v2/ (449MB, 384维)
+├── jrxml_source_chunks/ ← 分块产物 (all_chunks.json, 15,510 chunks)
+├── embeddings/ ← 向量产物 (embeddings.npy, 23MB)
+
+db/chroma/ ← ChromaDB 持久化 (主项目查询端读取)
+│ 集合: jrxml_chunks (15,510 条记录, cosine 距离)
+
+backend/rag_adapter.py ← RAGSearcher: 加载模型 + 连接 ChromaDB + 搜索
+agent/nodes.py ← retrieve() 调用 search_chunks()
+```
+
+## 管线流程
+
+```
+源文件 (.jrxml + .md)
+ → batch_chunker.py 语义分块 (按 XML 元素/标题层级切分)
+ → embed_chunks.py 向量化 (Sentence-Transformers, CPU)
+ → import_to_chroma.py 导入 ChromaDB
+ → rag_adapter.py 主项目查询
+```
+
+## 当前数据
+
+| 指标 | 数值 |
+|---|---|
+| 源文件 | 258 (242 JRXML + 16 MD) |
+| Chunks 总数 | 15,510 |
+| 嵌入维度 | 384 |
+| 嵌入模型 | sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 |
+| 分块类型 | query, field, parameter, variable, band_*, chart, crosstab, element_*, section_* 等 |
+| 知识库大小 | embeddings.npy 23MB, ChromaDB ~50MB |
+
+## 主项目配置
+
+`.env` 中相关变量:
+
+```env
+# 嵌入模型 (本地路径优先)
+RAG_EMBED_MODEL=./rag/models/paraphrase-multilingual-MiniLM-L12-v2
+# ChromaDB 路径
+RAG_CHROMA_PATH=./db/chroma
+# 集合名称 (与 rag 子项目一致)
+RAG_COLLECTION_NAME=jrxml_chunks
+```
+
+## 全量构建
+
+```bash
+cd rag
+python batch_chunker.py jrxml_source
+python embed_chunks.py jrxml_source_chunks/all_chunks.json
+python import_to_chroma.py --chroma_path ../db/chroma
+```
+
+## 增量更新
+
+```bash
+# 1. 将新的 .jrxml / .md 放入 rag/jrxml_source/
+# 2. 增量运行
+cd rag
+python batch_chunker.py jrxml_source --incremental
+python embed_chunks.py --incremental
+python import_to_chroma.py --chroma_path ../db/chroma --incremental
+```
+
+## 更新 rag 子项目
+
+```bash
+git submodule update --remote rag
+```
+
+## 搜索接口
+
+```python
+from backend.rag_adapter import search_chunks
+
+# 返回拼接好的上下文字符串,可直接注入 LLM prompt
+context = search_chunks("如何创建饼图", k=5)
+```
diff --git a/README.md b/README.md
index c112acc..99c6191 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
- **多轮聊天**:通过对话优化报表 -- 添加列、更改标题、添加汇总
- **自动验证**:每次生成或修改后都会验证 JRXML
-- **自动修正**:如果验证失败,代理会分析错误并自动修正(最多 3 次)
+- **自动修正**:如果验证失败,代理会分析错误并自动修正(最多 5 次)
- **模板检索**:使用 Chroma 向量数据库检索相关的 JRXML 示例以获得更好的生成效果
- **文件上传**:支持图片(OCR识别)、PDF、Word、Excel、文本文件等
- **聊天粘贴/拖拽**:支持直接在对话框中 Ctrl+V 粘贴或拖拽文件(图片/PDF/Excel/Word)
@@ -182,7 +182,7 @@ jrxml-agent/
| LOCAL_EMBED_MODEL | 嵌入模型 | Qwen/Qwen3-Embedding-0.6B |
| VALIDATION_SERVICE_URL | 验证端点 | http://localhost:8001/validate |
| CHROMA_PERSIST_DIR | Chroma 存储位置 | ./db/chroma |
-| MAX_RETRY | 自动修正尝试次数 | 3 |
+| MAX_RETRY | 自动修正尝试次数 | 5 |
| CONTEXT_MAX_TOKENS | 上下文压缩阈值 | 6000 |
| LOG_DIR | 日志目录 | ./logs |
| LOG_LEVEL | 日志级别 | DEBUG |
diff --git a/agent/nodes.py b/agent/nodes.py
index 952c76d..e296b45 100644
--- a/agent/nodes.py
+++ b/agent/nodes.py
@@ -18,11 +18,11 @@ from backend.logger import get_logger, set_trace_id
from backend.validation import validate_jrxml
from prompts.loader import load_prompt
-load_dotenv()
+load_dotenv(override=True)
_node_log = get_logger("agent")
-MAX_RETRY = int(os.getenv("MAX_RETRY", "3"))
+MAX_RETRY = int(os.getenv("MAX_RETRY", "5"))
CONTEXT_MAX_TOKENS = int(os.getenv("CONTEXT_MAX_TOKENS", "6000"))
CONTEXT_KEEP_RECENT = int(os.getenv("CONTEXT_KEEP_RECENT", "4"))
HISTORY_MAX_SNAPSHOTS = int(os.getenv("HISTORY_MAX_SNAPSHOTS", "10"))
@@ -815,6 +815,14 @@ def validate(state: AgentState) -> Dict:
state["error_msg"] = f"JRXML 内容过短({len(jrxml.strip())} 字符),可能为不完整或空内容。"
return state
+ # 自动规范化 JRXML 元素顺序(符合 XSD sequence 要求)
+ try:
+ from backend.jrxml_reorder import normalize_jrxml
+ jrxml = normalize_jrxml(jrxml)
+ state["current_jrxml"] = jrxml
+ except Exception:
+ pass # 规范化失败不影响后续流程
+
result = validate_jrxml(jrxml)
state["status"] = "pass" if result.get("valid") else "fail"
state["error_msg"] = result.get("error", "")
@@ -923,6 +931,20 @@ def finalize(state: AgentState) -> Dict:
# 验证未通过:不覆盖 final_jrxml,保留上一次成功的版本
retries = state.get("retry_count", 0)
error_msg = state.get("error_msg", "未知错误")
+ # 保存失败版本到 jrxml_versions(用户可以选择下载)
+ if jrxml.strip():
+ versions = state.get("jrxml_versions", [])
+ if not isinstance(versions, list):
+ versions = []
+ versions.append({
+ "ts": _now_iso(),
+ "jrxml": jrxml,
+ "intent": state.get("intent", ""),
+ "label": f"失败版本 (第{retries}次重试)",
+ "status": "fail",
+ "error_msg": error_msg,
+ })
+ state["jrxml_versions"] = versions
# 记录失败上下文,下次用户输入时自动注入
state["pending_failure_context"] = {
"error_msg": error_msg,
@@ -934,8 +956,8 @@ def finalize(state: AgentState) -> Dict:
"role": "assistant",
"content": (
f"❌ 经过 {retries} 次重试后仍无法生成有效的 JRXML。\n"
- f"错误: {error_msg}\n"
- f"请描述您想要的修改,系统会自动加载失败上下文继续修复。"
+ f"错误: {error_msg}\n\n"
+ f"您可以:\n1. 继续描述修改要求,系统将自动重试修复\n2. 点击下载按钮获取当前版本(虽未通过 XSD 验证,但可能可在 Studio 中手动修复)"
),
})
return state
@@ -966,4 +988,4 @@ def _extract_jrxml(text: str) -> str:
if xml_start >= 0 and jr_end > xml_start:
return text[xml_start:jr_end + len("")].strip()
- return text
+ return text
\ No newline at end of file
diff --git a/api_server.py b/api_server.py
index 61c2796..630807f 100644
--- a/api_server.py
+++ b/api_server.py
@@ -181,6 +181,13 @@ def _run_graph_sync(agent_state: AgentState, event_q: queue.Queue):
for node_state in data.values():
if isinstance(node_state, dict):
agent_state.update(node_state)
+ # 在 graph 完成后立即保存 session,防止 SSE 流中断导致数据丢失
+ sid = agent_state.get("session_id", "")
+ if sid:
+ try:
+ save_session(sid, agent_state)
+ except Exception:
+ pass # 静默失败,SSE 流中还有一次保存机会
event_q.put(("done", {"reason": "graph_completed"}))
except Exception as exc:
event_q.put(("error", {
@@ -218,6 +225,8 @@ async def _sse_generator(agent_state: AgentState, session_id: str = "") -> str:
total_ms = round((time.time() - t_start) * 1000)
if session_id:
save_session(session_id, agent_state)
+ versions = agent_state.get("jrxml_versions", [])
+ last_ver = versions[-1] if versions else {}
yield _sse_line("agent_complete", {
"reason": "done",
"intent": agent_state.get("intent", ""),
@@ -228,6 +237,9 @@ async def _sse_generator(agent_state: AgentState, session_id: str = "") -> str:
"retry_count": agent_state.get("retry_count", 0),
"total_duration_ms": total_ms,
"ocr_extraction_result": agent_state.get("ocr_extraction_result", {}),
+ "versions": len(versions),
+ "has_failed_version": last_ver.get("status") == "fail" if last_ver else False,
+ "failed_version_index": len(versions) - 1 if last_ver.get("status") == "fail" else -1,
})
await future
return
@@ -532,7 +544,17 @@ async def chat(session_id: str, payload: dict):
# ── 返回 SSE 流 ──
async def stream_and_save():
- final_state = None
+ # 如果上传了附件,先发送处理状态
+ if file_ids:
+ yield _sse_line("node_start", {
+ "node": "process_attachments",
+ "label": "正在处理附件",
+ })
+ yield _sse_line("node_complete", {
+ "node": "process_attachments",
+ "label": "正在处理附件",
+ "detail": f"已解析 {len(file_ids)} 个文件",
+ })
async for sse_chunk in _sse_generator(agent_state, session_id):
yield sse_chunk
@@ -622,4 +644,4 @@ async def download_file(file_id: str):
if __name__ == "__main__":
import uvicorn
port = int(os.getenv("API_PORT", "8000"))
- uvicorn.run("api_server:app", host="0.0.0.0", port=port, reload=True)
+ uvicorn.run("api_server:app", host="0.0.0.0", port=port, reload=False)
\ No newline at end of file
diff --git a/app.py b/app.py
index 2fcd67f..5b6980c 100644
--- a/app.py
+++ b/app.py
@@ -17,13 +17,16 @@ try:
except Exception:
pass
+import base64
+import tempfile
import time
from pathlib import Path
import streamlit as st
+import streamlit.components.v1 as components
from dotenv import load_dotenv
-load_dotenv()
+load_dotenv(override=True)
from agent.graph import build_graph, create_initial_state
from backend.session import (
@@ -109,86 +112,6 @@ def _render_jrxml(jrxml: str, max_lines: int = 30):
st.code(preview, language="xml")
-# ---- 共享文件上传处理 ----
-def _process_uploaded_file(uploaded_file, suffix: str) -> dict:
- """处理单个上传文件:保存临时文件、解析、布局分析。
-
- 返回: {"name": str, "text": str, "type": str, "tmp_path": str|None}
- """
- import tempfile
- from backend.file_parser import parse_file
- from backend.layout_analyzer import analyze_layout
-
- with tempfile.NamedTemporaryFile(suffix=suffix, delete=False) as tmp:
- tmp.write(uploaded_file.getvalue())
- tmp_path = tmp.name
-
- result = parse_file(tmp_path, suffix)
- parsed_text = result["text"]
- parsed_type = result["file_type"]
-
- # 对图片/PDF 进行 A4 模板布局分析
- if suffix in (".png", ".jpg", ".jpeg", ".bmp", ".webp", ".pdf"):
- layout = analyze_layout(tmp_path)
- tt = layout.get("template_type", "unknown")
- current_jrxml = st.session_state.agent_state.get("current_jrxml", "")
-
- if tt == "full_a4":
- parsed_text = layout["description"]
- parsed_type = "a4_template"
- # 存储布局 schema 供分层精确生成使用
- from backend.layout_analyzer import extract_layout_schema
- schema = extract_layout_schema(layout)
- st.session_state.agent_state["layout_schema"] = schema
- st.session_state.agent_state["ocr_elements"] = layout.get("rows", [])
- elif tt == "partial_rows":
- parsed_type = "a4_partial"
- if current_jrxml.strip():
- from backend.layout_analyzer import match_rows_to_jrxml
- match = match_rows_to_jrxml(layout, current_jrxml)
- parsed_text = (
- f"[行片段修改] 上传图片包含 {layout['total_rows']} 行,"
- f"视为 A4 报表的一部分。\n\n"
- f"{match['description']}\n\n"
- f"--- 行结构 ---\n{layout['description']}"
- )
- else:
- parsed_text = layout["description"]
- else:
- has_ocr = result.get("method") not in ("metadata_only", None)
- img_w, img_h = layout["image_size"]
- ratio = layout["aspect_ratio"]
- if has_ocr:
- parsed_text = (
- f"[图片上传] 尺寸 {img_w}x{img_h}px, 比例 {ratio}。"
- f"未检测到 A4 报表结构,图片将被视为参考样式。\n"
- f"请根据用户的文字描述生成报表。"
- )
- else:
- parsed_text = (
- f"[图片上传] 尺寸 {img_w}x{img_h}px, 比例 {ratio}。\n"
- f"⚠ OCR 引擎未安装,无法识别图片中的文字内容。\n"
- f"请严格根据用户的文字描述来推断图片中的报表需求。\n"
- f"(提示:如需图片文字识别,请运行 pip install paddleocr)"
- )
- parsed_type = "image_reference"
-
- elif suffix in (".pdf", ".docx", ".xlsx", ".xls", ".doc"):
- parsed_type = suffix.lstrip(".")
-
- keep_temp = (
- suffix in (".png", ".jpg", ".jpeg", ".bmp", ".webp")
- and result.get("method") not in ("metadata_only", None)
- )
-
- return {
- "name": uploaded_file.name,
- "text": parsed_text,
- "type": parsed_type,
- "tmp_path": tmp_path if keep_temp else None,
- }
-
-
# ---- URL 参数 ----
query_params = st.query_params
url_session_id = query_params.get("session_id", "")
@@ -344,14 +267,6 @@ def run_agent(user_input: str):
if stream_active:
streaming_placeholder.empty()
- # 清理已处理的临时文件
- for p in st.session_state.get("uploaded_temp_paths", []):
- try:
- Path(p).unlink(missing_ok=True)
- except Exception:
- pass
- st.session_state.uploaded_temp_paths = []
-
# ---- 总结卡片 ----
# 注:node_state 只含变更字段,用 agent_state(被所有节点就地修改)获取完整状态
final_state = agent_state
@@ -557,62 +472,12 @@ with st.sidebar:
run_agent("重新来,清空当前报表")
st.rerun()
- st.divider()
- st.markdown("### 上传文件")
- st.caption("支持图片 (OCR)、PDF、Word、文本文件。内容将附加到您的下一条消息中。")
-
- if "uploaded_files" not in st.session_state:
- st.session_state.uploaded_files = [] # [{name, text, type}]
-
- if "uploaded_temp_paths" not in st.session_state:
- st.session_state.uploaded_temp_paths = [] # 待清理的临时文件路径
-
- uploaded = st.file_uploader(
- "选择文件",
- type=["png", "jpg", "jpeg", "bmp", "webp", "pdf", "docx", "xlsx", "xls", "doc",
- "txt", "csv", "json", "xml"],
- accept_multiple_files=True,
- key="file_uploader",
- label_visibility="collapsed",
- )
-
- if uploaded:
- for uf in uploaded:
- # 去重
- if any(f["name"] == uf.name for f in st.session_state.uploaded_files):
- continue
-
- suffix = Path(uf.name).suffix.lower()
- result = _process_uploaded_file(uf, suffix)
-
- if result["text"]:
- st.session_state.uploaded_files.append({
- "name": result["name"],
- "text": result["text"],
- "type": result["type"],
- })
-
- tmp_path = result["tmp_path"]
- if tmp_path:
- st.session_state.agent_state["uploaded_file_path"] = tmp_path
- st.session_state.uploaded_temp_paths.append(tmp_path)
-
- if st.session_state.uploaded_files:
- for i, f in enumerate(st.session_state.uploaded_files):
- cols = st.columns([5, 1])
- with cols[0]:
- st.caption(f"📎 {f['name']} ({f['type']}, {len(f['text'])} 字符)")
- with cols[1]:
- if st.button("✕", key=f"rm_uf_{i}", help="移除"):
- st.session_state.uploaded_files.pop(i)
- st.rerun()
-
st.divider()
st.markdown("### 配置")
llm_backend = os.getenv("LLM_BACKEND", "cloud")
llm_model = os.getenv("LLM_MODEL", os.getenv("LOCAL_LLM_MODEL", "gpt-4o"))
st.caption(f"大语言模型: {llm_backend} / {llm_model}")
- st.caption(f"最大重试次数: {os.getenv('MAX_RETRY', '3')}")
+ st.caption(f"最大重试次数: {os.getenv('MAX_RETRY', '5')}")
st.caption(f"验证服务: {os.getenv('VALIDATION_SERVICE_URL', 'http://localhost:8001/validate')}")
st.divider()
@@ -666,106 +531,396 @@ for msg in st.session_state.messages:
else:
st.markdown(msg["content"])
-# ---- 聊天输入(支持粘贴/拖拽文件) ----
-from st_multimodal_chatinput import multimodal_chatinput
-import base64
-import io
-from pathlib import Path as _Path
+# ---- 统一聊天输入组件 ----
+UNIFIED_CHAT_HTML = r"""
+
+
+
+
+
+
+
+
+
+
+
+"""
+
+chat_result = components.html(UNIFIED_CHAT_HTML, height=180)
+
+if chat_result and isinstance(chat_result, dict):
+ prompt = chat_result.get("text", "")
+ files = chat_result.get("files", [])
+
+ from backend.file_parser import parse_file
+ from backend.layout_analyzer import analyze_layout, extract_layout_schema
+
+ file_texts = []
+ attached_info = []
+ first_image_path = None
+ temp_paths = []
+
+ for f in files:
+ header, b64data = f.get("data", ",").split(",", 1)
+ raw = base64.b64decode(b64data)
+
+ mime = f.get("type", "")
+ mime_to_suffix = {
+ "image/png": ".png", "image/jpeg": ".jpg", "image/bmp": ".bmp",
+ "image/webp": ".webp", "application/pdf": ".pdf",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
+ "application/vnd.ms-excel": ".xls", "application/msword": ".doc",
+ "text/plain": ".txt",
+ }
+ suffix = mime_to_suffix.get(mime, Path(f["name"]).suffix.lower())
+
+ with tempfile.NamedTemporaryFile(suffix=suffix, delete=False) as tmp:
+ tmp.write(raw)
+ tmp_path = tmp.name
+ temp_paths.append(tmp_path)
+
+ result = parse_file(tmp_path, suffix)
+ text = result["text"]
+ file_type = result["file_type"]
+
+ img_suffixes = (".png", ".jpg", ".jpeg", ".bmp", ".webp")
+ if suffix in img_suffixes and result.get("method") not in ("metadata_only", None):
+ try:
+ layout = analyze_layout(tmp_path)
+ tt = layout.get("template_type", "unknown")
+ if tt == "full_a4":
+ text = layout["description"]
+ file_type = "a4_template"
+ schema = extract_layout_schema(layout)
+ st.session_state.agent_state["layout_schema"] = schema
+ st.session_state.agent_state["ocr_elements"] = layout.get("rows", [])
+ elif tt == "partial_rows":
+ file_type = "a4_partial"
+ except Exception:
+ pass
+
+ file_texts.append(f"[附加文件: {f['name']} ({file_type})]\n{text}")
+ attached_info.append({"name": f["name"], "type": file_type, "length": len(text)})
+
+ if not first_image_path and file_type in ("image", "a4_template", "a4_partial"):
+ first_image_path = tmp_path
+
+ if file_texts:
+ full_prompt = "\n\n".join(file_texts) + "\n\n---\n用户需求:\n" + prompt
+ else:
+ full_prompt = prompt
+
+ if first_image_path:
+ st.session_state.agent_state["uploaded_file_path"] = first_image_path
+
+ _app_log.info(
+ "收到用户输入",
+ extra={
+ "session_id": current_session_id,
+ "prompt_preview": prompt[:200],
+ "prompt_length": len(prompt),
+ "has_uploaded_files": bool(attached_info),
+ "uploaded_files": attached_info,
+ },
+ )
+
+ st.session_state.messages.append({"role": "user", "content": prompt})
+ with st.chat_message("user"):
+ st.markdown(prompt)
+ run_agent(full_prompt)
+
+ for p in temp_paths:
try:
- data = base64.b64decode(content_b64)
+ Path(p).unlink(missing_ok=True)
except Exception:
- continue
+ pass
- suffix = _Path(name).suffix.lower()
- if not suffix and mime in MIME_TO_EXT:
- suffix = MIME_TO_EXT[mime]
- name = f"{_Path(name).stem}{suffix}"
-
- wrapper = _Base64File(name, data)
- result = _process_uploaded_file(wrapper, suffix)
-
- if result["text"]:
- uploaded_texts.append(f"[上传文件: {result['name']}]\n{result['text']}")
- uploaded_files_info.append({"name": result["name"], "type": result["type"], "length": len(result["text"])})
-
- tmp_path = result["tmp_path"]
- if tmp_path:
- st.session_state.agent_state["uploaded_file_path"] = tmp_path
- st.session_state.uploaded_temp_paths.append(tmp_path)
-
- if prompt or uploaded_texts:
- if uploaded_texts:
- full_prompt = "\n\n".join(uploaded_texts)
- if prompt:
- full_prompt += "\n\n---\n用户需求:\n" + prompt
- else:
- full_prompt = prompt
-
- displayed_prompt = prompt or "(已上传文件,未输入文字)"
-
- _app_log.info(
- "收到用户输入",
- extra={
- "session_id": current_session_id,
- "prompt_preview": displayed_prompt[:200],
- "prompt_length": len(full_prompt),
- "has_uploaded_files": bool(uploaded_files_info),
- "uploaded_files": uploaded_files_info,
- },
- )
-
- st.session_state.messages.append({"role": "user", "content": displayed_prompt})
- with st.chat_message("user"):
- st.markdown(displayed_prompt)
- run_agent(full_prompt)
- st.rerun()
+ st.rerun()
diff --git a/backend/jrxml_reorder.py b/backend/jrxml_reorder.py
new file mode 100644
index 0000000..c941545
--- /dev/null
+++ b/backend/jrxml_reorder.py
@@ -0,0 +1,201 @@
+"""
+JRXML 元素自动排序 — 按 JasperReports XSD 要求重排子元素。
+
+XSD 要求 jasperReport 子元素严格按以下顺序:
+property, propertyExpression, import, template, reportFont,
+style, subDataset, scriptlet, parameter, queryString, field,
+sortField, variable, filterExpression, group, background, title,
+pageHeader, columnHeader, detail, columnFooter, pageFooter,
+lastPageFooter, summary, noData
+
+以及 band 内部的 reportElement 必须在其他元素之前。
+"""
+import re
+import xml.etree.ElementTree as ET
+from typing import Optional
+
+# JasperReports XSD sequence 顺序(索引越小越靠前)
+JASPERREPORT_ORDER = {
+ "property": 0,
+ "propertyExpression": 1,
+ "import": 2,
+ "template": 3,
+ "reportFont": 4,
+ "style": 5,
+ "subDataset": 6,
+ "scriptlet": 7,
+ "parameter": 8,
+ "queryString": 9,
+ "field": 10,
+ "sortField": 11,
+ "variable": 12,
+ "filterExpression": 13,
+ "group": 14,
+ "background": 15,
+ "title": 16,
+ "pageHeader": 17,
+ "columnHeader": 18,
+ "detail": 19,
+ "columnFooter": 20,
+ "pageFooter": 21,
+ "lastPageFooter": 22,
+ "summary": 23,
+ "noData": 24,
+}
+
+# 带命名空间的标签映射(去掉 ns 前缀后匹配)
+NS = "http://jasperreports.sourceforge.net/jasperreports"
+
+
+def _tag_local(tag: str) -> str:
+ """提取标签本地名(去掉命名空间前缀)。"""
+ return tag.split("}")[-1] if "}" in tag else tag
+
+
+def _sort_key(elem: ET.Element) -> int:
+ """排序键:按 JASPERREPORT_ORDER 中的顺序,未知元素放最后。"""
+ local = _tag_local(elem.tag)
+ return JASPERREPORT_ORDER.get(local, 999)
+
+
+def reorder_jrxml_elements(xml_string: str) -> str:
+ """重排 JRXML 字符串中的子元素顺序,使其符合 XSD sequence 要求。
+
+ 处理范围:
+ - jasperReport 的直接子元素
+ - band 的直接子元素(reportElement 在前)
+
+ 返回重排后的 XML 字符串。如果解析失败,返回原始字符串。
+ """
+ try:
+ root = ET.fromstring(xml_string)
+ except ET.ParseError:
+ return xml_string # 无法解析,返回原始
+
+ _reorder_children(root)
+ _reorder_bands(root)
+
+ # 序列化回字符串
+ result = ET.tostring(root, encoding="unicode")
+
+ # 恢复 XML 声明、CDATA、命名空间
+ result = _restore_formatting(xml_string, result)
+ return result
+
+
+def _reorder_children(parent: ET.Element):
+ """递归重排所有子元素。"""
+ children = list(parent)
+ if not children:
+ return
+
+ # 按 XSD 顺序排序
+ children.sort(key=_sort_key)
+
+ # 重建子元素列表
+ for i, child in enumerate(children):
+ # ET 不支持直接 reorder,用 remove + insert
+ pass
+
+ # 实际上 ElementTree 不支持直接重排,需要重建
+ # 我们用更可靠的方式:收集所有子元素,清空,再按顺序添加
+ sorted_children = sorted(list(parent), key=_sort_key)
+
+ # 移除所有子元素
+ for child in list(parent):
+ parent.remove(child)
+
+ # 按排序后的顺序重新添加(保持 tail 文本在最后)
+ tail_text = ""
+ for child in sorted_children:
+ tail_text = child.tail or ""
+ child.tail = ""
+ parent.append(child)
+
+ # 恢复最后一个元素的 tail
+ if sorted_children and tail_text:
+ sorted_children[-1].tail = tail_text
+
+ # 递归处理子元素
+ for child in parent:
+ _reorder_children(child)
+
+
+def _reorder_bands(root: ET.Element):
+ """确保 band 内部 reportElement 在其他元素之前。"""
+ for elem in root.iter():
+ if _tag_local(elem.tag) == "band":
+ _ensure_reportelement_first(elem)
+
+
+def _ensure_reportelement_first(band: ET.Element):
+ """在 band 内部,确保 reportElement 元素排在最前面。"""
+ children = list(band)
+ report_elements = [c for c in children if _tag_local(c.tag) == "reportElement"]
+ other_elements = [c for c in children if _tag_local(c.tag) != "reportElement"]
+
+ if not report_elements:
+ return
+
+ # 移除所有
+ for c in list(band):
+ band.remove(c)
+
+ # 先添加 reportElement
+ tail = ""
+ for r in report_elements:
+ r.tail = ""
+ band.append(r)
+ # 再添加其他
+ for o in other_elements:
+ o.tail = ""
+ band.append(o)
+ # 恢复 tail
+ last = band[-1] if list(band) else None
+ if last and children:
+ last.tail = children[-1].tail or ""
+
+
+def _restore_formatting(original: str, reordered: str) -> str:
+ """恢复 XML 声明和 CDATA 段。"""
+ # 保留原始声明
+ decl = ""
+ if original.strip().startswith("', original)
+ if m:
+ decl = m.group()
+ if decl and not reordered.strip().startswith("', re.DOTALL)
+ cdata_blocks = cdata_pattern.findall(original)
+
+ if cdata_blocks:
+ # 在重排后的 XML 中,对应位置的文本用 CDATA 包裹
+ def _restore_cdata(match):
+ nonlocal cdata_blocks
+ text = match.group(1)
+ for cdata in cdata_blocks:
+ if cdata.strip() == text.strip():
+ return f""
+ return match.group(0)
+
+ # 替换已转义的文本为 CDATA
+ reordered = re.sub(
+ r'(]*>)\s*(.*?)\s*()',
+ lambda m: m.group(1) + f"\n \n " + m.group(3),
+ reordered,
+ flags=re.DOTALL
+ )
+
+ return reordered
+
+
+def normalize_jrxml(jrxml_text: str) -> str:
+ """规范化 JRXML:排序元素 + 恢复格式。"""
+ if not jrxml_text or not jrxml_text.strip():
+ return jrxml_text
+ result = reorder_jrxml_elements(jrxml_text)
+ return result
diff --git a/backend/llm.py b/backend/llm.py
index de171fa..eeaa0f5 100644
--- a/backend/llm.py
+++ b/backend/llm.py
@@ -179,7 +179,8 @@ def _build_raw_llm(caller: str = "") -> tuple[_BaseLLM, str, str]:
messages=[{"role": "user", "content": [{"type": "text", "text": prompt}]}],
)
for block in resp.content:
- if block.type == "text":
+ block_type = getattr(block, "type", "")
+ if block_type == "text":
return type("Response", (), {"content": block.text})()
return type("Response", (), {"content": ""})()
diff --git a/backend/session.py b/backend/session.py
index 63cf1eb..1333592 100644
--- a/backend/session.py
+++ b/backend/session.py
@@ -90,6 +90,8 @@ def save_session(session_id: str, agent_state: dict, session_name: str = ""):
)
try:
json.dump(data, tmp, ensure_ascii=False, indent=2)
+ tmp.flush()
+ os.fsync(tmp.fileno())
tmp.close()
os.replace(tmp.name, str(fp))
except Exception:
diff --git a/backend/validation.py b/backend/validation.py
index 9fe4352..f906525 100644
--- a/backend/validation.py
+++ b/backend/validation.py
@@ -7,7 +7,7 @@ from dotenv import load_dotenv
from backend.logger import get_logger
-load_dotenv()
+load_dotenv(override=True)
_val_log = get_logger("validation")
diff --git a/e2e_test.py b/e2e_test.py
new file mode 100644
index 0000000..9f88685
--- /dev/null
+++ b/e2e_test.py
@@ -0,0 +1,114 @@
+"""
+JRXML Agent E2E test — Playwright automation.
+Tests: page load, upload image, send message, wait for response.
+Usage: python test_e2e.py
+Prerequisites: Servers must be running (start.bat or with_server.py)
+"""
+import os, sys, time, base64, tempfile
+from playwright.sync_api import sync_playwright
+
+FRONTEND = "http://localhost:5173"
+API = "http://localhost:8000"
+TEST_IMAGE = r"D:\Idea Project\agent_jrxml\test_invoice_e2e.png"
+
+def run():
+ with sync_playwright() as p:
+ browser = p.chromium.launch(headless=True)
+ page = browser.new_page(viewport={"width": 1280, "height": 900})
+
+ # Capture console errors
+ errors = []
+ page.on("console", lambda msg: errors.append(msg.text) if msg.type == "error" else None)
+
+ # 1. Navigate and wait
+ print("[1] Loading frontend...")
+ page.goto(FRONTEND, timeout=15000)
+ page.wait_for_load_state("networkidle")
+ page.wait_for_timeout(1000)
+
+ # Screenshot initial state
+ page.screenshot(path=r"D:\Idea Project\agent_jrxml\e2e_01_initial.png", full_page=True)
+ print(" Screenshot: e2e_01_initial.png")
+
+ # Verify sidebar loads
+ sidebar = page.locator(".sidebar")
+ assert sidebar.is_visible(), "Sidebar not visible"
+ print(" OK: Sidebar visible")
+
+ # 2. Create new session (click +)
+ print("[2] Creating new session...")
+ page.locator(".btn-icon").click()
+ page.wait_for_timeout(500)
+ page.screenshot(path=r"D:\Idea Project\agent_jrxml\e2e_02_session.png")
+ print(" OK: New session created")
+
+ # 3. Upload test image
+ print("[3] Uploading test image...")
+ upload_input = page.locator('input[type="file"]')
+ upload_input.set_input_files(TEST_IMAGE)
+ page.wait_for_timeout(500)
+ # Verify file chip appears
+ chip = page.locator(".chip").first
+ assert chip.is_visible(), "File chip not visible after upload"
+ print(f" OK: File chip visible — {chip.inner_text()}")
+
+ # 4. Type message and send
+ print('[4] Sending message...')
+ textarea = page.locator("textarea").first
+ textarea.fill("根据这张图片生成车历卡报表模板")
+ page.wait_for_timeout(200)
+ page.screenshot(path=r"D:\Idea Project\agent_jrxml\e2e_03_input.png")
+
+ # Click send button or press Enter
+ page.locator('button[type="submit"]').click()
+ print(" Sent!")
+
+ # 5. Wait for streaming response
+ print("[5] Waiting for AI response...")
+ try:
+ # Wait up to 3 minutes for a success or error message
+ page.wait_for_selector('.message.assistant', timeout=180000)
+ page.wait_for_timeout(2000)
+ page.screenshot(path=r"D:\Idea Project\agent_jrxml\e2e_04_response.png", full_page=True)
+
+ # Check for success/error
+ messages = page.locator('.message.assistant').all()
+ for m in messages:
+ text = m.inner_text()
+ if "成功" in text:
+ print(f" ✅ SUCCESS: {text[:100]}")
+ elif "失败" in text or "错误" in text:
+ print(f" ❌ ERROR: {text[:100]}")
+ elif "JRXML" in text:
+ print(f" 📄 JRXML generated ({len(text)} chars)")
+ except Exception as e:
+ page.screenshot(path=r"D:\Idea Project\agent_jrxml\e2e_04_timeout.png", full_page=True)
+ print(f" ⚠️ Timeout waiting for response: {e}")
+
+ # 6. Check download button
+ print("[6] Checking download button...")
+ download_btn = page.locator(".btn-download").first
+ if download_btn.is_visible():
+ text = download_btn.inner_text()
+ print(f" Download button: '{text}'")
+ if "暂无" not in text:
+ print(" ✅ Download link available!")
+ else:
+ print(" ⚠️ Download shows '暂无下载文件'")
+ else:
+ print(" ⚠️ Download button not found")
+
+ # Console errors
+ if errors:
+ print(f"\n[!] Console errors ({len(errors)}):")
+ for e in errors[:5]:
+ print(f" {e[:200]}")
+ else:
+ print("\n ✅ No console errors")
+
+ print("\n=== E2E test complete ===")
+ browser.close()
+
+if __name__ == "__main__":
+ os.makedirs(r"D:\Idea Project\agent_jrxml", exist_ok=True)
+ run()
diff --git a/requirements.txt b/requirements.txt
index e65b2ff..104e15e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -33,8 +33,6 @@ openpyxl>=3.1.0
paddleocr>=2.9.0,<3.0.0
paddlepaddle>=2.6.0,<3.0.0
easyocr>=1.7.0
-# 聊天输入增强(粘贴/拖拽上传)
-st-multimodal-chatinput>=0.2.1
# 多格式文件解析
openpyxl>=3.1.0
diff --git a/start.bat b/start.bat
index 41aba81..bd142ca 100644
--- a/start.bat
+++ b/start.bat
@@ -1,53 +1,47 @@
@echo off
setlocal enabledelayedexpansion
+echo ================================================
+echo agent_jrxml 启动 (API + 验证)
+echo ================================================
+cd /d "%~dp0"
-echo ============================================
-echo JRXML Agent - One-Click Start
-echo ============================================
-echo.
-
-REM ========== Kill processes on ports ==========
-echo [Pre-check] Cleaning up occupied ports...
-for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING" 2^>nul') do (
- echo Killing PID %%a on port 8001...
- taskkill /PID %%a /F 2>nul
+:: 清理残留进程
+echo [清理] 检查残留进程...
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING"') do (
+ taskkill /F /PID %%a >nul 2>&1 && echo 已清理 PID %%a
)
-for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING" 2^>nul') do (
- echo Killing PID %%a on port 8000...
- taskkill /PID %%a /F 2>nul
-)
-for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173.*LISTENING" 2^>nul') do (
- echo Killing PID %%a on port 5173...
- taskkill /PID %%a /F 2>nul
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING"') do (
+ taskkill /F /PID %%a >nul 2>&1 && echo 已清理 PID %%a
)
echo.
-REM ========== Detect Python ==========
-set PYTHON=python
-if exist "%~dp0.venv\Scripts\python.exe" set "PYTHON=%~dp0.venv\Scripts\python.exe"
-echo Using Python: %PYTHON%
+:: 启动验证服务 (后台最小化)
+echo [启动] 验证服务 :8001
+start "jrxml-validator" /MIN .venv\Scripts\python.exe -c "import uvicorn; uvicorn.run('validation_service.main:app',host='0.0.0.0',port=8001,reload=False)"
+
+:: 等待验证服务就绪 (用 PowerShell 检测)
+echo [等待] 验证服务就绪...
+:wait_val
+ping -n 2 127.0.0.1 >nul
+powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:8001/health -TimeoutSec 2 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1
+if errorlevel 1 goto wait_val
+echo :8001 就绪
+
+:: 启动 API 服务 (前台,Ctrl+C 退出)
+echo [启动] API 服务 :8000
+echo ================================================
+echo 服务已就绪:
+echo API: http://localhost:8000/docs
+echo 验证: http://localhost:8001/health
+echo 按 Ctrl+C 停止 API 服务
+echo 关闭窗口后会自动清理验证服务
+echo ================================================
+.venv\Scripts\python.exe -c "import uvicorn; uvicorn.run('api_server:app',host='0.0.0.0',port=8000,reload=False)"
+
+:: API 进程退出后自动清理
echo.
-
-REM ========== Start services ==========
-echo [1/3] Starting validation service on port 8001...
-start "JRXML-Validator" cmd /k cd /d "%~dp0" ^&^& "%PYTHON%" -m uvicorn validation_service.main:app --port 8001 --host 0.0.0.0
-timeout /t 3 /nobreak >nul
-
-echo [2/3] Starting backend API on port 8000...
-start "JRXML-API" cmd /k cd /d "%~dp0" ^&^& "%PYTHON%" -m uvicorn api_server:app --port 8000 --host 0.0.0.0
-timeout /t 3 /nobreak >nul
-
-echo [3/3] Starting frontend dev server on port 5173...
-start "JRXML-Frontend" cmd /k cd /d "%~dp0frontend" ^&^& npm run dev
-timeout /t 3 /nobreak >nul
-
-echo.
-echo ============================================
-echo All services started!
-echo Frontend : http://localhost:5173
-echo Backend : http://localhost:8000
-echo Validator : http://localhost:8001
-echo ============================================
-echo.
-echo Close the service windows or run stop.bat to stop.
+echo [清理] 停止验证服务...
+taskkill /F /FI "WINDOWTITLE eq jrxml-validator*" >nul 2>&1
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING"') do taskkill /F /PID %%a >nul 2>&1
+echo 已停止所有服务
pause
diff --git a/start_agent_jrxml.py b/start_agent_jrxml.py
new file mode 100644
index 0000000..059e365
--- /dev/null
+++ b/start_agent_jrxml.py
@@ -0,0 +1,144 @@
+"""
+agent_jrxml 统一启动/停止脚本
+用法: python start.py [--frontend]
+"""
+import subprocess
+import sys
+import time
+import signal
+import os
+import socket
+
+PROCESSES = []
+
+def kill_port(port):
+ """杀掉占用指定端口的所有进程"""
+ killed = []
+ try:
+ result = subprocess.run(
+ ['netstat', '-ano'], capture_output=True, text=True, timeout=10
+ )
+ for line in result.stdout.splitlines():
+ if f':{port}' in line and 'LISTENING' in line:
+ parts = line.strip().split()
+ pid = parts[-1]
+ try:
+ subprocess.run(['taskkill', '/F', '/PID', pid],
+ capture_output=True, timeout=5)
+ killed.append(pid)
+ except:
+ pass
+ except:
+ pass
+ if killed:
+ print(f"[清理] 端口 {port} 已清理 {len(killed)} 个进程: {', '.join(killed)}")
+ return len(killed)
+
+
+def wait_port(port, timeout=30):
+ """等待端口就绪"""
+ for i in range(timeout * 2):
+ try:
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.settimeout(1)
+ s.connect(('127.0.0.1', port))
+ s.close()
+ return True
+ except:
+ time.sleep(0.5)
+ return False
+
+
+def start(port, module, cwd=None):
+ """启动一个 uvicorn 服务"""
+ cmd = [
+ sys.executable, '-c',
+ f"import uvicorn; uvicorn.run('{module}', host='0.0.0.0', port={port}, reload=False)"
+ ]
+ proc = subprocess.Popen(cmd, cwd=cwd)
+ PROCESSES.append((port, proc))
+ print(f"[启动] {module} -> :{port} (PID: {proc.pid})")
+ return proc
+
+
+def cleanup():
+ """清理所有子进程"""
+ print("\n[清理] 正在停止所有服务...")
+ for port, proc in PROCESSES:
+ try:
+ proc.terminate()
+ except:
+ pass
+ time.sleep(2)
+ for port, proc in PROCESSES:
+ try:
+ proc.kill()
+ except:
+ pass
+ kill_port(port)
+ print("[清理] 完成")
+
+
+def main():
+ frontend = '--frontend' in sys.argv
+
+ # 1. 清理残留进程
+ print("=" * 50)
+ print("agent_jrxml 启动脚本")
+ print("=" * 50)
+ kill_port(8000)
+ kill_port(8001)
+ if frontend:
+ kill_port(5173)
+
+ # 2. 启动服务(基于脚本所在目录自动定位项目)
+ project = os.path.dirname(os.path.abspath(__file__))
+ start(8000, 'api_server:app', cwd=project)
+ start(8001, 'validation_service.main:app', cwd=project)
+
+ if frontend:
+ # 前端用 npm 启动
+ frontend_dir = os.path.join(project, 'frontend')
+ proc = subprocess.Popen(
+ ['npm', 'run', 'dev'], cwd=frontend_dir,
+ shell=True
+ )
+ PROCESSES.append((5173, proc))
+ print(f"[启动] frontend (Vite) -> :5173")
+
+ # 3. 等待就绪
+ print("\n[等待] 等待服务就绪...")
+ ok = True
+ for port, _ in PROCESSES:
+ if wait_port(port):
+ print(f" :{port} ✓")
+ else:
+ print(f" :{port} ✗ 超时!")
+ ok = False
+
+ if not ok:
+ print("\n[错误] 部分服务启动失败")
+ cleanup()
+ sys.exit(1)
+
+ print(f"\n{'='*50}")
+ print("服务就绪:")
+ print(f" API: http://localhost:8000/docs")
+ print(f" 验证: http://localhost:8001/health")
+ if frontend:
+ print(f" 前端: http://localhost:5173")
+ print(f"\n按 Ctrl+C 停止所有服务")
+ print(f"{'='*50}")
+
+ # 4. 等待退出信号
+ try:
+ while True:
+ time.sleep(1)
+ except KeyboardInterrupt:
+ pass
+ finally:
+ cleanup()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/start_all.bat b/start_all.bat
new file mode 100644
index 0000000..7197429
--- /dev/null
+++ b/start_all.bat
@@ -0,0 +1,50 @@
+@echo off
+setlocal enabledelayedexpansion
+echo ================================================
+echo agent_jrxml 启动 (全栈)
+echo ================================================
+cd /d "%~dp0"
+
+:: 清理残留进程
+echo [清理] 检查残留进程...
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING"') do taskkill /F /PID %%a >nul 2>&1
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING"') do taskkill /F /PID %%a >nul 2>&1
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173.*LISTENING"') do taskkill /F /PID %%a >nul 2>&1
+echo.
+
+:: 1. 验证服务
+echo [1/3] 验证服务 :8001
+start "jrxml-validator" /MIN .venv\Scripts\python.exe -c "import uvicorn; uvicorn.run('validation_service.main:app',host='0.0.0.0',port=8001,reload=False)"
+:wait_val
+ping -n 2 127.0.0.1 >nul
+powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:8001/health -TimeoutSec 2 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1
+if errorlevel 1 goto wait_val
+echo :8001 就绪
+
+:: 2. API 服务
+echo [2/3] API 服务 :8000
+start "jrxml-api" /MIN .venv\Scripts\python.exe -c "import uvicorn; uvicorn.run('api_server:app',host='0.0.0.0',port=8000,reload=False)"
+:wait_api
+ping -n 2 127.0.0.1 >nul
+powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:8000/api/health -TimeoutSec 2 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1
+if errorlevel 1 goto wait_api
+echo :8000 就绪
+
+:: 3. 前端
+echo [3/3] 前端 :5173
+start "jrxml-frontend" /MIN cmd /c "cd /d "%~dp0frontend" && npm run dev"
+:wait_fe
+ping -n 3 127.0.0.1 >nul
+powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:5173 -TimeoutSec 3 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1
+if errorlevel 1 goto wait_fe
+echo :5173 就绪
+
+echo.
+echo ================================================
+echo 全部就绪:
+echo 前端: http://localhost:5173
+echo API: http://localhost:8000/docs
+echo 验证: http://localhost:8001/health
+echo 运行 stop.bat 停止所有服务
+echo ================================================
+pause
diff --git a/stop.bat b/stop.bat
index b24b71e..5d3e9ba 100644
--- a/stop.bat
+++ b/stop.bat
@@ -1,9 +1,8 @@
@echo off
-echo 正在停止 JRXML 代理服务...
-
-taskkill /fi "WINDOWTITLE eq JRXML 验证服务*" /f 2>nul
-taskkill /fi "WINDOWTITLE eq JRXML API*" /f 2>nul
-taskkill /fi "WINDOWTITLE eq JRXML Frontend*" /f 2>nul
-
-echo 已停止。
+chcp 65001 >nul
+echo [清理] 停止所有 agent_jrxml 服务...
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING"') do taskkill /F /PID %%a 2>nul
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING"') do taskkill /F /PID %%a 2>nul
+for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173.*LISTENING"') do taskkill /F /PID %%a 2>nul
+echo 已停止
pause
diff --git a/test_invoice_e2e.png b/test_invoice_e2e.png
new file mode 100644
index 0000000..5f2d908
Binary files /dev/null and b/test_invoice_e2e.png differ
diff --git a/test_reorder.py b/test_reorder.py
new file mode 100644
index 0000000..a033a1e
--- /dev/null
+++ b/test_reorder.py
@@ -0,0 +1,29 @@
+import sys, io
+sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
+import xml.etree.ElementTree as ET
+from backend.jrxml_reorder import normalize_jrxml
+
+bad = '''
+
+
+
+
+
+
+
+ Hi
+'''
+
+fixed = normalize_jrxml(bad)
+print('=== Before ===')
+root = ET.fromstring(bad)
+print('Children:', [c.tag.split('}')[-1] for c in root])
+
+print('\n=== After ===')
+root2 = ET.fromstring(fixed)
+print('Children:', [c.tag.split('}')[-1] for c in root2])
+
+# 验证
+import requests
+r = requests.post('http://localhost:8001/validate', json={'jrxml': fixed}, timeout=10)
+print(f'\nValidation: {r.json()}')
diff --git a/tests/test_agent.py b/tests/test_agent.py
index 61a85c8..787848d 100644
--- a/tests/test_agent.py
+++ b/tests/test_agent.py
@@ -57,7 +57,7 @@ class TestAcceptanceScenarios:
state["stage"] = "initial_generation"
final = run_graph(graph, state)
- assert final.get("retry_count", 0) <= 3, "不应超过最大重试次数"
+ assert final.get("retry_count", 0) <= 5, "不应超过最大重试次数"
print(f"场景 2 状态: {final.get('status')}, 重试次数: {final.get('retry_count', 0)}")
def test_scenario3_multi_turn_modification(self, graph):
@@ -128,8 +128,8 @@ class TestAcceptanceScenarios:
state = create_initial_state()
state["current_jrxml"] = "xml<<<"
state["user_input"] = "Fix this"
- state["retry_count"] = 3 # 已达到最大重试次数
+ state["retry_count"] = 5 # 已达到最大重试次数
state["status"] = "fail"
final = run_graph(graph, state)
- assert final.get("retry_count", 0) >= 3 or final.get("status") == "pass"
+ assert final.get("retry_count", 0) >= 5 or final.get("status") == "pass"
diff --git a/uploads/2340dca12d63/0c62efe977c2_车历卡_01.png b/uploads/2340dca12d63/0c62efe977c2_车历卡_01.png
new file mode 100644
index 0000000..a0c0b9b
Binary files /dev/null and b/uploads/2340dca12d63/0c62efe977c2_车历卡_01.png differ
diff --git a/uploads/715bc9f6b37d/22120557a7f6_车历卡_01.png b/uploads/715bc9f6b37d/22120557a7f6_车历卡_01.png
new file mode 100644
index 0000000..a0c0b9b
Binary files /dev/null and b/uploads/715bc9f6b37d/22120557a7f6_车历卡_01.png differ
diff --git a/uploads/72712fc709e1/7a576c5de8ed_车历卡_01.png b/uploads/72712fc709e1/7a576c5de8ed_车历卡_01.png
new file mode 100644
index 0000000..a0c0b9b
Binary files /dev/null and b/uploads/72712fc709e1/7a576c5de8ed_车历卡_01.png differ
diff --git a/uploads/9b00a97a087c/a8d6bec7ab56_车历卡_01.png b/uploads/9b00a97a087c/a8d6bec7ab56_车历卡_01.png
new file mode 100644
index 0000000..a0c0b9b
Binary files /dev/null and b/uploads/9b00a97a087c/a8d6bec7ab56_车历卡_01.png differ
diff --git a/uploads/aeb1d7a60b96/94bc69b0c753_车历卡_01.png b/uploads/aeb1d7a60b96/94bc69b0c753_车历卡_01.png
new file mode 100644
index 0000000..a0c0b9b
Binary files /dev/null and b/uploads/aeb1d7a60b96/94bc69b0c753_车历卡_01.png differ
diff --git a/uploads/aed51871b24f/0008242cff56_车历卡_01.png b/uploads/aed51871b24f/0008242cff56_车历卡_01.png
new file mode 100644
index 0000000..a0c0b9b
Binary files /dev/null and b/uploads/aed51871b24f/0008242cff56_车历卡_01.png differ
diff --git a/uploads/d970494e3f54/192baebee93a_test.txt b/uploads/d970494e3f54/192baebee93a_test.txt
new file mode 100644
index 0000000..7e2a6c5
--- /dev/null
+++ b/uploads/d970494e3f54/192baebee93a_test.txt
@@ -0,0 +1 @@
+测试文件内容
\ No newline at end of file
diff --git a/uploads/da3f2d57ce01/66ffd07aafb9_车历卡_01.png b/uploads/da3f2d57ce01/66ffd07aafb9_车历卡_01.png
new file mode 100644
index 0000000..a0c0b9b
Binary files /dev/null and b/uploads/da3f2d57ce01/66ffd07aafb9_车历卡_01.png differ
diff --git a/validation_service/main.py b/validation_service/main.py
index 2945176..2a95d29 100644
--- a/validation_service/main.py
+++ b/validation_service/main.py
@@ -159,4 +159,4 @@ async def health():
"schema_available": schema_available,
"validation_type": "XSD" if schema_available else "仅结构检查",
"note": "如需完整的 JasperReports 7.0.6 编译验证,请使用基于 Java 的验证器",
- }
+ }
\ No newline at end of file
diff --git a/validation_service/schemas/jasperreport_7_0_6.xsd b/validation_service/schemas/jasperreport_7_0_6.xsd
new file mode 100644
index 0000000..12602c0
--- /dev/null
+++ b/validation_service/schemas/jasperreport_7_0_6.xsd
@@ -0,0 +1,7670 @@
+
+
+
+
+
+
+ Root element representing the definition of a report.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name of the report.
+
+
+
+
+ Specifies the language used for the report expressions.
+
+
+
+
+ Number of columns on the report.
+
+
+
+
+ Columns filling order.
+
+
+
+
+
+ Columns on the report are filled vertically.
+
+
+
+
+ Columns on the report are filled horizontally.
+
+
+
+
+
+
+
+ Columns filling direction.
+
+
+
+
+
+ Columns on the report are filled from left to right.
+
+
+
+
+ Columns on the report are filled from right to left.
+
+
+
+
+
+
+
+ Page width.
+
+
+
+
+ Page height.
+
+
+
+
+ Page printing orientation.
+
+
+
+
+
+ Portrait page layout.
+
+
+
+
+ Landscape page layout.
+
+
+
+
+
+
+
+ Allows users to customize the behavior of the reporting engine when there are now rows in the data source.
+
+
+
+
+
+ The generated document contains zero pages.
+
+
+
+
+ The generated document contains one blank page.
+
+
+
+
+ All the report sections except the detail section will get printed.
+
+
+
+
+ The generated document contains only the noData section.
+
+
+
+
+
+
+
+ Specifies if the report design is made of sections containing bands or containing parts.
+
+
+
+
+
+ The report template is made of sections containing bands.
+
+
+
+
+ The report template is made of sections containing parts.
+
+
+
+
+
+
+
+ Column width.
+
+
+
+
+ Space between columns.
+
+
+
+
+ Left margin.
+
+
+
+
+ Right margin.
+
+
+
+
+ Top margin.
+
+
+
+
+ Bottom margin.
+
+
+
+
+ Flag used to specify if the title section should be printed on a separate initial page.
+
+
+
+
+
+ Title section will be printed on a separate initial page
+
+
+
+
+ Title section will be printed on the first page of the report, along with the other sections.
+
+
+
+
+
+
+
+ Flag used to specify if the summary section should be printed on a separate last page.
+
+
+
+
+
+ Summary section will be printed on a separate last page.
+
+
+
+
+ Summary section will be printed on the last page of the report, along with the other sections, if there is enough space.
+
+
+
+
+
+
+
+ Flag used to specify if the summary section should be accompanied by the page header and footer.
+
+
+
+
+
+ Summary section will be printed along with the page header and footer.
+
+
+
+
+ Summary section will be printed without page header and footer.
+
+
+
+
+
+
+
+ Flag used to specify if the column footer section should be printed at the bottom of the column or if it should immediately follow the last detail or group footer printed on the current column.
+
+
+
+
+
+ The column footer section is printed immediately after the last detail or group footer printed on the current column.
+
+
+
+
+ The column footer section is printed at the bottom of the current column.
+
+
+
+
+
+
+
+ Indicates which class implements the scriptlets functionality for this report. The specified class must be a subclass of JRAbstractScriptlet class. If omitted, an instance of JRDefaultScriptlet will be created.
+
+
+
+
+ The base name of the report associated resource bundle.
+
+
+
+
+ Allows customizing the way the engine deals with missing resources in the resource bundle.
+
+
+
+
+
+ Null is returned for the missing resource.
+
+
+
+
+ An empty string is returned for the missing resource.
+
+
+
+
+ The key is returned for the missing resources.
+
+
+
+
+ An exception is thrown when the resource with the specified key is missing.
+
+
+
+
+
+
+
+ Flag used to specify whether to use pagination.
+
+ This attribute can be overridden at fill time by the IS_IGNORE_PAGINATION parameter.
+
+
+
+
+
+ The report will be generated on one long page. The specified page height will still be used for report design.
+
+
+
+
+ The report will be paginated according to the pageHeight attribute.
+
+
+
+
+
+
+
+ Specifies the name of the class implementing the net.sf.jasperreports.engine.util.FormatFactory interface to use with this report. If omitted, an instance of net.sf.jasperreports.engine.util.DefaultFormatFactory will be created.
+
+
+
+
+ This attribute is auto-generated and is used to uniquely identify JRXMLs.
+
+
+
+
+
+
+
+ Allows the creation of a name-value pair property for a report object (e.g. the report itself, a field, a parameter, etc).
+
+
+
+
+ Name of the object property.
+
+
+
+
+ Value of the object property.
+
+
+
+
+
+
+
+
+ Name of the object property.
+
+
+
+
+ Specifies the type of expression.
+
+
+
+
+
+ Expression is written in the report expression language.
+
+
+
+
+ Expression is a simple text expression where parameter, field, variable references have their values converted to string and expanded in-place in the resulting text.
+
+
+
+
+
+
+
+
+
+ Allows the creation of a dynamic name-value pair property for a report element.
+ The contents of this element is interpreted as a java.lang.String expression,
+ which will be evaluated at fill time, the result being used as property value.
+
+
+
+
+
+
+
+
+ Specifies when the default value expression of a parameter is evaluated.
+
+
+
+
+
+ Evaluate the property expression before parameter contributors.
+
+
+
+
+ Evaluate the property expression after parameter contributors.
+
+
+
+
+ Evaluate the property expression at the end of the report.
+
+
+
+
+
+
+
+
+
+
+
+ Translates into an import statement inside the expression class order to eliminate the need to use complete class names in the report expressions.
+
+
+
+
+ Class name or package to import.
+
+
+
+
+
+
+
+ A style template (*.jrtx file/JRTemplate instance) included in a report.
+ The contents of this element is interpreted as an expression which is resolved to a style template at fill time.
+
+
+
+
+
+ Class for the style template source expression.
+
+
+
+
+
+
+
+ Represents the definition of a report font. Report fonts are used as default or base font settings in other font definitions throughout the report.
+
+
+
+
+ Name of the report font definition.
+
+
+
+
+ The default report font is used as base font for all the font definitions that do not explicitly reference a report font definition.
+
+
+
+
+
+
+
+
+
+
+ Name of the font.
+
+
+
+
+ Size of the font.
+
+
+
+
+ Flag indicating if the font weight is bold
+
+
+
+
+
+
+
+
+
+
+ Flag indicating if the font is italic
+
+
+
+
+
+
+
+
+
+
+ Flag indicating if the font is underlined
+
+
+
+
+
+
+
+
+
+
+ Flag indicating if the font is strikethrough
+
+
+
+
+
+
+
+
+
+
+ Name of the PDF font.
+
+
+
+
+ Encoding type to use with the PDF font.
+
+
+
+
+ Specifies if the PDF font should be embedded in the document.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Definition of a report style.
+
+
+
+
+
+
+
+
+
+
+ Name of the report style definition.
+
+
+
+
+ The default report style is used as base style for all the elements that do not explicitly reference a report style definition.
+
+
+
+
+
+
+
+
+
+
+ Parent style reference.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag pen.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+ Deprecated. Replaced by tag box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by attribute markup.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Groups the properties of the pen used to draw lines or borders.
+
+
+
+
+ The line width of the pen.
+
+
+
+
+ The line style of the pen.
+
+
+
+
+
+ Solid line.
+
+
+
+
+ Dashed line.
+
+
+
+
+ Dotted line.
+
+
+
+
+ Double line.
+
+
+
+
+
+
+
+ The line color of the pen.
+
+
+
+
+
+
+
+ Paragraph properties for text elements.
+
+
+
+
+
+
+
+ Type of line spacing for the text object.
+
+
+
+
+
+ Normal line spacing
+
+
+
+
+ Medium line spacing.
+
+
+
+
+ Double line spacing
+
+
+
+
+ Line spacing is at least the amount specified by lineSpacingSize.
+
+
+
+
+ Line spacing is exactly as specified by lineSpacingSize.
+
+
+
+
+ Line spacing is normal line spacing multiplied by lineSpacingSize.
+
+
+
+
+
+
+
+ The line spacing size to be used in combination with the line spacing type.
+
+
+
+
+ The indent of the first line of text.
+
+
+
+
+ The left indent of text.
+
+
+
+
+ The right indent of text.
+
+
+
+
+ The spacing before text.
+
+
+
+
+ The spacing after text.
+
+
+
+
+ The tab stop width of the text.
+
+
+
+
+
+
+
+ Custom tab stop definition.
+
+
+
+
+ The alignment of the custom tab stop.
+
+
+
+
+
+ Left aligned tab stop.
+
+
+
+
+ Center aligned tab stop.
+
+
+
+
+ Right aligned tab stop.
+
+
+
+
+
+
+
+ The position of the custom tab stop.
+
+
+
+
+
+
+
+ Used for adding conditions to a current style, to create dynamic styles.
+
+ Modifies the properties of the parent style, based on various conditions evaluated at fill time. It must be placed inside a top level style.
+
+
+
+
+
+
+
+
+
+
+
+
+ A boolean expression which indicates if the style properties associated with it should be applied to the parent style.
+
+
+
+
+
+
+
+ Definition of a dataset. A dataset can be used to feed data not present in the report to charts and crosstabs without using subreports.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name of the dataset.
+
+
+
+
+ Indicates which class implements the scriptlets functionality for this dataset. The specified class must be a subclass of JRAbstractScriptlet class. If omitted, an instance of JRDefaultScriptlet will be created.
+
+
+
+
+ The base name of the dataset associated resource bundle.
+
+
+
+
+ Allows customizing the way the engine deals with missing resources in the resource bundle.
+
+
+
+
+
+ Null is returned for the missing resource.
+
+
+
+
+ An empty string is returned for the missing resource.
+
+
+
+
+ The key is returned for the missing resources.
+
+
+
+
+ An exception is thrown when the resource with the specified key is missing.
+
+
+
+
+
+
+
+ This attribute is auto-generated and is used to uniquely identify subdatasets.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents the definition of a report parameter. Parameters are very useful for passing data to the report engine and can be used in the expressions or in the query string of the report.
+
+
+
+
+
+
+
+
+
+ Name of the parameter.
+
+
+
+
+ Class of the parameter values.
+
+
+
+
+ Type of the nested elements, if the parameter's value is a collection
+
+
+
+
+ Optional flag that might be used by the parent application to prompt the user for the parameter value.
+
+
+
+
+
+
+
+
+
+
+ Specifies when the default value expression of a parameter is evaluated.
+
+
+
+
+
+ Evaluate the parameter default value expression before parameter contributors.
+
+
+
+
+ Evaluate the parameter default value expression after parameter contributors.
+
+
+
+
+
+
+
+
+
+
+ Can be used to specify a short text description for the parameter and is useful especially when prompting for the user to supply a value for this parameter at runtime.
+
+
+
+
+
+
+
+ Specifies the parameter default value to use when not supplied by the parent application at runtime.
+
+
+
+
+
+
+
+ Contains the SQL query that will be used to retrieve the data needed to fill the report.
+
+
+
+
+ Specifies the query language.
+
+ Based on the query language, a corresponding
+ net.sf.jasperreports.engine.query.QueryExecuterFactory is used to create
+ net.sf.jasperreports.engine.query.JRQueryExecuter instance.
+ The query executer is responsible for executing the query and creating a JRDataSource from the result.
+
+ A executer for a query language is registered using a JR propery named
+ net.sf.jasperreports.query.executer.factory.<language>
+
+
+
+
+
+
+
+ Represents the definition of a data field that will store values retrieved from the data source of the report.
+
+
+
+
+
+
+
+
+
+ Name of the field.
+
+
+
+
+ Class of the field values.
+
+
+
+
+
+
+
+ Can be used to specify a short text description for the field and is useful especially when creating special designed data sources and an extra information is needed in order to extract the value of the field.
+
+
+
+
+
+
+
+ Introduces a field to use for sorting the data source.
+
+
+
+
+ Name of the report field to use for sorting.
+
+
+
+
+ The sort order for the field.
+
+
+
+
+
+
+
+
+
+
+ The type of the sort field.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents the definition of a report variable. Variables are objects that store the values of their associated expressions or perform various calculations on those expression values. Expressions are java expressions build on top of fields and variables declared in the report. They are evaluated at runtime, when filling the report.
+
+
+
+
+
+
+
+
+
+ Name of the variable.
+
+
+
+
+ Class of the variable values.
+
+
+
+
+ Reset level for variables that perform calculations.
+
+
+
+
+
+ Variable is never initialized using the initial value expression and only holds the values obtained by evaluating its main expression.
+
+
+
+
+ Variable is initialized only once, at the beginning of the report.
+
+
+
+
+ Variable is initialized at the beginning of each page.
+
+
+
+
+ Variable is initialized at the beginning of each column.
+
+
+
+
+ Variable is initialized when the group specified by the resetGroup attribute changes.
+
+
+
+
+ Used internally for certain built-in variables.
+
+
+
+
+
+
+
+ Name of the group at which the variable is reinitialized, when resetType is "Group".
+
+
+
+
+ Increment level for variables that perform calculations.
+
+
+
+
+
+ Variable is incremented with every record in the data source.
+
+
+
+
+ Variable is incremented only once, at the end of the report.
+
+
+
+
+ Variable is incremented at the end of each page.
+
+
+
+
+ Variable is incremented at the end of each column.
+
+
+
+
+ Variable is incremented when the group specified by the incrementGroup attribute changes.
+
+
+
+
+
+
+
+ Name of the group at which the variable is incremented, when incrementType is "Group".
+
+
+
+
+ Calculation to perform on the variable expression when filling the report.
+
+
+
+
+
+ No calculations are performed.
+
+
+
+
+ Variable stores the number of the not null values encountered for the variable expression.
+
+
+
+
+ Variable stores the number of distinct not null values encountered for the variable expression.
+
+
+
+
+ Variable stores the sum of the not null values encountered for the variable expression. Numeric variables only.
+
+
+
+
+ Variable stores the average of the not null values encountered for the variable expression. Numeric variables only.
+
+
+
+
+ Variable stores the lowest value encountered for the variable expression.
+
+
+
+
+ Variable stores the highest value encountered for the variable expression.
+
+
+
+
+ Variable stores the standard deviation of the not null values encountered for the variable expression. Numeric variables only.
+
+
+
+
+ Variable stores the variance of the not null values encountered for the variable expression. Numeric variables only.
+
+
+
+
+ Variable stores a system (custom) calculated value.
+
+
+
+
+ Variable stores the first value encountered and ignores subsequent values.
+
+
+
+
+
+
+
+ The name of a class that implements the net.sf.jasperreports.engine.fill.JRIncrementerFactory interface to use when creating the incrementer instance for this variable. Incrementers are objects that implement the net.sf.jasperreports.engine.fill.JRIncrementer interface and handle the incremental calculation performed on the variable's current value with every iteration in the data source.
+
+
+
+
+
+
+
+ Can be used to specify a short text description for the variable.
+
+
+
+
+
+
+
+ Definition of the expression associated with the variable. The value of this expression will be calculated at runtime and will represent the value of the corresponding variable or it will be used in calculation to obtain the value of the calculated variable.
+
+
+
+
+
+
+
+ Definition of the expression that will be used to calculate the initial value of the variable, before any calculations are made.
+
+
+
+
+
+
+
+ Boolean expression used to filter the rows of a data source.
+
+ This expression is used to filter the rows of the data source that this dataset will iterate on.
+
+ Boolean.TRUE the row gets processed by the report filling engine.
+ When the result is null or Boolean.FALSE, the current row will be skipped and the datasource will be asked for the next row.
+ ]]>
+
+
+
+
+
+
+
+ Definition of a group on the report.
+
+
+
+
+
+
+
+
+
+ Name of the group.
+
+
+
+
+ Flag that signals if the group header should be printed always on a new column.
+
+
+
+
+
+ Group header section is printed always on a new column.
+
+
+
+
+ Group header section is printed on the current column, if there is enough space.
+
+
+
+
+
+
+
+ Flag that signals if the group header should be printed always on a new page.
+
+
+
+
+
+ Group header section is printed always on a new page.
+
+
+
+
+ Group header section is printed on the current page, if there is enough space.
+
+
+
+
+
+
+
+ Flag that signals if the group header should be printed always on a new page, along with the re-initialization of the page number.
+
+
+
+
+
+ Group header section is printed always on a new page and the page number is reinitialized.
+
+
+
+
+ Group header section is printed accordingly with the isStartNewPage attribute and the page number is not affected.
+
+
+
+
+
+
+
+ Flag that signals if the group header should be reprinted at the beginning of each page.
+
+
+
+
+
+ Group header section is reprinted always at the beginning of a new page.
+
+
+
+
+ Group header section is not reprinted at the beginning of a new page.
+
+
+
+
+
+
+
+ Flag that signals if the group header should be reprinted at the beginning of each column, in vertically filled reports only.
+
+
+
+
+
+ Group header section is reprinted always at the beginning of a new column.
+
+
+
+
+ Group header section is not reprinted at the beginning of a new column.
+
+
+
+
+
+
+
+ Minimum amount of vertically space needed at the bottom of the column in order to place the group header on the current column.
+
+
+
+
+ Minimum number of details to be rendered on the current column, to avoid starting the group on a new column.
+
+
+
+
+ Specifies how the group footer section behaves with regards to its position on the current page.
+
+
+
+
+
+ The group footer section is rendered at normal position, just right after the last detail or right after the nested group footer section.
+
+
+
+
+ The group footer section is rendered at bottom of the current page, provided that an inner group having this value would force outer group footers to stack at the bottom of the current page, regardless of the outer group footer setting.
+
+
+
+
+ The group footer section is rendered at bottom of the current page, provided that an inner group having this value would render its footer right at the bottom of the page, forcing the outer group footers to render on the next page.
+
+
+
+
+ The group footer section is rendered at bottom of the current page, provided that the outer footers have a similar footer display option to render at the page bottom as well, because otherwise, they cannot be forced to change their behavior in any way.
+
+
+
+
+
+
+
+ Flag that prevents the group from splitting on two separate pages/columns, but only on the first break attempt.
+
+
+
+
+
+ Group can split across two separate pages/column at any moment.
+
+
+
+
+ Group is moved onto a new new page/column, before being split.
+
+
+
+
+
+
+
+ Flag that prevents the group from appearing alone at the top of a new page/column.
+
+
+
+
+
+ The last detail section is moved onto the new page/column so that the group footer does not appear alone.
+
+
+
+
+ The group footer can appear alone at the top of a new page/column, without a detail section.
+
+
+
+
+
+
+
+
+
+
+ Specifies the expression that will be evaluated at runtime to determine the group ruptures.
+
+
+
+
+
+
+
+ Contains the definition of the header section for this group.
+
+
+
+
+
+
+
+
+
+
+
+ Contains the definition of the footer section for this group.
+
+
+
+
+
+
+
+
+
+
+
+ Definition of the page background section for this report. The background section is displayed on every page and cannot overflow to the next page. Elements placed on this section are evaluated at page initialization time and are displayed in the back. All other page elements are displayed on top of the background elements. This section allows creating watermark or other similar effects in documents.
+
+
+
+
+
+
+
+
+
+
+ Definition of the title section for this report. The title section appears only once at the beginning of the report.
+
+
+
+
+
+
+
+
+
+
+ Definition of the page header section for this report. The page header is printed at the beginning of each page on the report.
+
+
+
+
+
+
+
+
+
+
+ Definition of the column header section for this report. The column header is printed at the beginning of each column on the report. If the report's column count is 1, column header and footer sections are ignored.
+
+
+
+
+
+
+
+
+
+
+ Definition of a detail band for this report. A detail band is repeated for each line of data supplied by the report's data source. There can be multiple detail bands in a report.
+
+
+
+
+
+
+
+
+
+
+
+ Definition of the column footer section for this report. The column footer is printed at the bottom of each column on the report. If the report's column count is 1, column header and footer sections are ignored.
+
+
+
+
+
+
+
+
+
+
+ Definition of the page footer section for this report. The page footer is printed at the bottom of each page on the report.
+
+
+
+
+
+
+
+
+
+
+ The page footer section to use on the last page instead of the normal page footer. This might not be the very last page of the document in case the summary section is also present. This section is sometimes useful when summary information has to be displayed at the bottom of the last page.
+
+
+
+
+
+
+
+
+
+
+ Definition of the summary section for this report. The summary section is printed only once at the end of the report.
+
+
+
+
+
+
+
+
+
+
+ Definition of the noData section for this report. The noData section is printed only if whenNoDataType attribute is set to "NoDataSection".
+
+
+
+
+
+
+
+
+
+
+ Generic definition of a report section.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Height of the band.
+
+
+
+
+ Deprecated. Replaced by attribute splitType. Flag that indicates if the band is allowed to split when it stretches.
+
+
+
+
+
+ Page breaks are accepted within this band.
+
+
+
+
+ When the band stretches and it does not fit on the current page, the content of the band will be transferred on the next new page. On this new page the flag will be ignored since the band has to be displayed even there is not enough space to acquire the stretch.
+
+
+
+
+
+
+
+ Specifies the band split behavior.
+
+
+
+
+
+ The band is allowed to split, but never within its declared height. This means the band splits only when its content stretches.
+
+
+
+
+ Prevents the band from splitting on first break attempt. On subsequent pages/columns, the band is allowed to split, to avoid infinite loops.
+
+
+
+
+ The band is allowed to split anywhere, as early as needed, but not before at least one element being printed on the current page/column.
+
+
+
+
+
+
+
+
+
+
+ Generic definition of a report part.
+
+
+
+
+
+
+
+
+
+
+ This attribute is auto-generated and is used to uniquely identify parts.
+
+
+
+
+ Determines the time at which the part is to be evaluated.
+
+
+
+
+
+ The part is to be evaluated immediately.
+
+
+
+
+ The part is to be evaluated when the report ends.
+
+
+
+
+ The part is to be evaluated when a group breaks.
+
+
+
+
+
+
+
+ Specifies the group at which to evaluate the part when evaluationTime is Group.
+
+
+
+
+
+
+
+ An expression that will provide a name for a report part.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Introduces a page break or column break
+
+
+
+
+
+
+
+ Specifies the type of the break element.
+
+
+
+
+
+ Page break.
+
+
+
+
+ Column break.
+
+
+
+
+
+
+
+
+
+
+ Definition of a line object.
+
+
+
+
+
+
+
+
+ Lines are drawn as diagonals of the rectangle defined by the report element properties. This attribute specifies which of the two diagonals should be drawn.
+
+
+
+
+
+ The diagonal that starts in the top-left corner of the rectangle will be drawn.
+
+
+
+
+ The diagonal that starts in the bottom-left corner of the rectangle will be drawn.
+
+
+
+
+
+
+
+
+
+
+ Element used to specify the common properties of an object on the report.
+
+
+
+
+
+
+
+
+
+ This attribute is auto-generated and is used to uniquely identify elements across multiple report templates.
+
+
+
+
+ This attribute is used to identify band elements by their "key" when wanting to alter their settings at runtime. The key value must be unique for elements within report band.
+
+
+
+
+ Name of the report level style to use as base style (see style element).
+
+
+
+
+ Specifies the object position when the report section is affected by stretch.
+
+
+
+
+
+ The element moves relative to the size of the surrounding elements.
+
+
+
+
+ The element maintains its position relative to the top of the band.
+
+
+
+
+ The element maintains its position relative to the bottom of the band.
+
+
+
+
+
+
+
+ Specifies the element stretch behavior relative to its element group siblings or element container stretch.
+
+
+
+
+
+ The element won't stretch vertically beyond its natural stretch height, when the container stretches to display other elements.
+
+
+
+
+ Deprecated. Replaced by ElementGroupHeight value.
+
+
+
+
+ Deprecated. Replaced by ContainerHeight value.
+
+
+
+
+ The element will stretch to accommodate the overall natural growth of its group, but also taking into account the shifting Y position of the element within its group. See the elementGroup element, to see how to group elements.
+
+
+
+
+ The element will stretch to accommodate the overall natural growth of its group, without taking into account the shifting Y position of the element within its group. See the elementGroup element, to see how to group elements.
+
+
+
+
+ The element will stretch to fit the container height, while taking into account its new Y position. This results in the element preserving its distance to the container's bottom edge.
+
+
+
+
+ The element will stretch to fit the container height, but without taking into account its new Y position. This might results in the element being shifted up (due to collapsing elements above) or down (due to stretching elements above that push it downards) relative to the container bottom edge. In case the element its already pushed downwards, the additional stretch imposed by the container might actually throw it beyond the container's bottom edge, in which case the element will not render at all.
+
+
+
+
+
+
+
+ This flag allows suppressing the repeating values for the dynamic elements such as text fields and image fields and to fully customize the behavior of the static elements like rectangles, lines, ellipses and static texts.
+
+
+
+
+
+ Dynamic elements will print even if their values repeat. Static elements will appear every time the band that contains them is started.
+
+
+
+
+ Suppresses the repeated values for the dynamic elements. The static elements will print only according to the other 3 attributes: isPrintInFirstWholeBand, isPrintWhenDetailOverflows, printWhenGroupChanges.
+
+
+
+
+
+
+
+ Specifies whether the background of an object is transparent or opaque.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the x coordinate for the object within the band.
+
+
+
+
+ Specifies the y coordinate for the object within the band.
+
+
+
+
+ Width of the object.
+
+
+
+
+ Height of the object.
+
+
+
+
+ Collapses the band if the element is not printing and no other element is occupying the same horizontal space.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The element gets printed in the first band of a new page or column that is not an overflow from a previous page or column.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The element will be printed when the band overflows to a new page or a new column.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The element will be printed when the specified group changes.
+
+
+
+
+ Fore color to use when drawing the object. Hexadecimal formatted values preceded by the # character or decimal values are accepted along with the following predefined color values: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, yellow, white.
+
+
+
+
+ Back color to use when drawing the object. Hexadecimal formatted values preceded by the # character or decimal values are accepted along with the following predefined color values: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, yellow, white.
+
+
+
+
+
+
+
+ Definition of a Boolean expression that will determine if the element or the band should be printed or not.
+
+
+
+
+
+
+
+ Element used to specify the common properties of a graphic object on the report (line, rectangle, ellipse or image).
+
+
+
+
+
+
+
+ Deprecated. Replaced by attribute with the same name in tag reportElement.
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag pen.
+
+
+
+
+
+ No line.
+
+
+
+
+ Thin line.
+
+
+
+
+ Normal line.
+
+
+
+
+ Medium line.
+
+
+
+
+ Thick line.
+
+
+
+
+ Dotted line.
+
+
+
+
+
+
+
+ Type of the fill pattern used to fill objects.
+
+
+
+
+
+ Solid fill.
+
+
+
+
+
+
+
+
+
+
+ Definition of a rectangle object.
+
+
+
+
+
+
+
+
+ The radius of the arc corner.
+
+
+
+
+
+
+
+ Definition of an ellipse object.
+
+
+
+
+
+
+
+
+
+
+
+ Definition of an image object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Image displaying type.
+
+
+
+
+
+ Only the portion of the image that fits the specified object width and height will be printed. Image is not stretched.
+
+
+
+
+ Image will be stretched to adapt to the specified object width and height.
+
+
+
+
+ Image will adapt to the specified object width or height keeping its original shape.
+
+
+
+
+ A scale image type that instructs the engine to stretch the image height to fit the actual height of the image.
+
+Several restrictions apply to the image stretching mechanism:
+
+ - It only works when the image renderer implements JRRenderable.getDimension().
+ - If the actual image width exceeds the declared image element width, the image is proportionally stretched to fit the declared width.
+ - Images with delayed evaluation (see the
evaluationTime attribute) do not stretch and is proportionally shrunk to fit the declared height/width.
+ - An image overflows (to the next page/column) only once, after this the image gets rendered on the available space by proportionally shrinking its size.
+
+
+
+
+
+
+
+ A scale image type that stretches the images height in the same way as RealHeight, and in addition it changes the image width to the actual with of the image.
+
+This can be useful when, for instance, a border has to be drawn around the image, respecting its actual size.
+
+
+
+
+
+
+
+
+ Type of rotation for the image object.
+
+
+
+
+
+ Image is not rotated.
+
+
+
+
+ Image is rotated 90 degrees counter clockwise.
+
+
+
+
+ Image is rotated 90 degrees clockwise.
+
+
+
+
+ Image is rotated 180 degrees.
+
+
+
+
+
+
+
+ Horizontal image alignment.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Vertical image alignment.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If true, tells the report engine to cache the images that are loaded from the same location.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gives control over when the images are retrieved from their specified location.
+
+
+
+
+
+ The image is loaded from the specified location only when the document is viewed or exported to other formats.
+
+
+
+
+ The image is loaded during the report filling process and stored in the resulting document.
+
+
+
+
+
+
+
+ Controls the behavior of the engine in case the image is not available.
+
+
+
+
+
+ An exception is raised when loading the image.
+
+
+
+
+ The exception is ignored and the image displays as blank.
+
+
+
+
+ The exception is ignored and an image replacement icon is displayed.
+
+
+
+
+
+
+
+ The image to be printed is supplied by the associated expression. This expression can be evaluated at a specified moment. This could be useful, for example, when we want to have on the first page a chart that will be generated only after fetching all the data source rows.
+
+
+
+
+ Used to specify the group at which to evaluate the image expression value, when evaluationTime is "Group".
+
+
+
+
+
+ Indicates the type of the hyperlink element.
+
+ The type can be:
+
+ -
+ One of the built-in types:
+
+ None
+ - The current element doesn't represent a hyperlink.
+ Reference
+ - The current hyperlink points to an external resource specified by the corresponding hyperlinkReferenceExpression element, usually an URL.
+ LocalAnchor
+ - The current hyperlink points to a local anchor specified by the corresponding hyperlinkAnchorExpression element.
+ LocalPage
+ - The current hyperlink points to a 1 based page index within the current document specified by the corresponding hyperlinkPageExpression element.
+ RemoteAnchor
+ - The current hyperlink points to an anchor specified by the hyperlinkAnchorExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+ RemotePage
+ - The current hyperlink points to a 1 based page index specified by the hyperlinkPageExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+
+
+ -
+ A custom (arbitrary) type.
+
+
+
+
+
+
+
+ Indicates the target of the hyperlink.
+
+
+
+
+ The level of the bookmark corresponding to the anchor.
+
+ The PDF exporter can create a bookmark tree using anchors defined in the report.
+ This attribute specifies the level of the tree entry corresponding to this element's anchor.
+ If set to "0" (the default), no bookmark will be created for the anchor.
+
+
+
+
+
+
+
+
+ Definition of the expression that will be used to determine the image to be displayed.
+
+
+
+
+ Class of the image source.
+
+
+
+
+
+
+
+ Tag used to specify the border and padding properties of a report element.
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag pen
+
+
+
+
+
+ No border.
+
+
+
+
+ Thin border.
+
+
+
+
+ Normal border.
+
+
+
+
+ Medium border.
+
+
+
+
+ Thick border.
+
+
+
+
+ Dotted border.
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag pen
+
+
+
+
+ The amount of empty space between the border and the element's content.
+
+
+
+
+ Deprecated. Replaced by tag topPen
+
+
+
+
+
+ No top border.
+
+
+
+
+ Thin top border.
+
+
+
+
+ Normal top border.
+
+
+
+
+ Medium top border.
+
+
+
+
+ Thick top border.
+
+
+
+
+ Dotted top border.
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag topPen
+
+
+
+
+ The amount of empty space between the top border and the element's content.
+
+
+
+
+ Deprecated. Replaced by tag leftPen
+
+
+
+
+
+ No left border.
+
+
+
+
+ Thin left border.
+
+
+
+
+ Normal left border.
+
+
+
+
+ Medium left border.
+
+
+
+
+ Thick left border.
+
+
+
+
+ Dotted left border.
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag leftPen
+
+
+
+
+ The amount of empty space between the left border and the element's content.
+
+
+
+
+ Deprecated. Replaced by tag bottomPen
+
+
+
+
+
+ No bottom border.
+
+
+
+
+ Thin bottom border.
+
+
+
+
+ Normal bottom border.
+
+
+
+
+ Medium bottom border.
+
+
+
+
+ Thick bottom border.
+
+
+
+
+ Dotted bottom border.
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag bottomPen
+
+
+
+
+ The amount of empty space between the bottom border and the element's content.
+
+
+
+
+ Deprecated. Replaced by tag rightPen
+
+
+
+
+
+ No right border.
+
+
+
+
+ Thin right border.
+
+
+
+
+ Normal right border.
+
+
+
+
+ Medium right border.
+
+
+
+
+ Thick right border.
+
+
+
+
+ Dotted right border.
+
+
+
+
+
+
+
+ Deprecated. Replaced by tag rightPen
+
+
+
+
+ The amount of empty space between the right border and the element's content.
+
+
+
+
+
+
+
+ Groups the properties of the pen used to draw top lines or borders.
+
+
+
+
+ The line width of the pen.
+
+
+
+
+ The line style of the pen.
+
+
+
+
+
+ Solid line.
+
+
+
+
+ Dashed line.
+
+
+
+
+ Dotted line.
+
+
+
+
+ Double line.
+
+
+
+
+
+
+
+ Line color for the pen. Hexadecimal formatted values preceded by the # character or decimal values are accepted along with the following predefined color values: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, yellow, white.
+
+
+
+
+
+
+
+ Groups the properties of the pen used to draw left lines or borders.
+
+
+
+
+ The line width of the pen.
+
+
+
+
+ The line style of the pen.
+
+
+
+
+
+ Solid line.
+
+
+
+
+ Dashed line.
+
+
+
+
+ Dotted line.
+
+
+
+
+ Double line.
+
+
+
+
+
+
+
+ Line color for the pen. Hexadecimal formatted values preceded by the # character or decimal values are accepted along with the following predefined color values: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, yellow, white.
+
+
+
+
+
+
+
+ Groups the properties of the pen used to draw bottom lines or borders.
+
+
+
+
+ The line width of the pen.
+
+
+
+
+ The line style of the pen.
+
+
+
+
+
+ Solid line.
+
+
+
+
+ Dashed line.
+
+
+
+
+ Dotted line.
+
+
+
+
+ Double line.
+
+
+
+
+
+
+
+ Line color for the pen. Hexadecimal formatted values preceded by the # character or decimal values are accepted along with the following predefined color values: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, yellow, white.
+
+
+
+
+
+
+
+ Groups the properties of the pen used to draw right lines or borders.
+
+
+
+
+ The line width of the pen.
+
+
+
+
+ The line style of the pen.
+
+
+
+
+
+ Solid line.
+
+
+
+
+ Dashed line.
+
+
+
+
+ Dotted line.
+
+
+
+
+ Double line.
+
+
+
+
+
+
+
+ Line color for the pen. Hexadecimal formatted values preceded by the # character or decimal values are accepted along with the following predefined color values: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, yellow, white.
+
+
+
+
+
+
+
+ If specified, it will supply the name of the local anchor that will mark to the corresponding element.
+
+
+
+
+
+
+
+ Used in hyperlink elements to point to external documents and resources.
+
+
+
+
+
+
+
+ Used in hyperlink elements to specify whether the hyperlink is to be displayed or not.
+
+
+
+
+
+
+
+ Used in hyperlink elements to point to document anchors.
+
+
+
+
+
+
+
+ Used in hyperlink elements to point to document pages.
+
+
+
+
+
+
+
+ Used in hyperlink elements to generate a tooltip for the hyperlink. The type of the expression should be java.lang.String.
+
+
+
+
+
+
+
+ Definition of a hyperlink parameter. Hyperlink parameters can be used to parametrize hyperlinks of custom types.
+
+
+
+
+
+
+
+ The name of the hyperlink parameter.
+
+
+
+
+
+
+
+ Expression that will produce the value for a hyperlink parameter.
+
+
+
+
+ Type of the parameter value.
+
+
+
+
+
+
+
+ Definition of a static text object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the text to print for a static text object.
+
+
+
+
+
+
+
+ Element used to specify the common properties of a text object on the report (staticText or textField).
+
+
+
+
+
+
+
+
+ Type of alignment for the text object.
+
+
+
+
+
+ Text is aligned to the left.
+
+
+
+
+ Text is centered.
+
+
+
+
+ Text is aligned to the right.
+
+
+
+
+ Text is justified.
+
+
+
+
+
+
+
+ Type of vertical alignment for the text object.
+
+
+
+
+
+ Text is aligned to the top.
+
+
+
+
+ Text is vertically centered.
+
+
+
+
+ Text is aligned to the bottom.
+
+
+
+
+ Text is justified.
+
+
+
+
+
+
+
+ Type of rotation for the text object.
+
+
+
+
+
+ Text runs horizontally from left to right and from top to bottom.
+
+
+
+
+ Text runs vertically from bottom to top and from left to right.
+
+
+
+
+ Text runs vertically from top to bottom and from right to left.
+
+
+
+
+ Text is rotated with 180 degrees.
+
+
+
+
+
+
+
+ Type of line spacing for the text object.
+
+
+
+
+
+ Normal line spacing
+
+
+
+
+ Medium line spacing.
+
+
+
+
+ Double line spacing
+
+
+
+
+
+
+
+ Deprecated. Replaced by attribute markup.
+
+ When set to true, this attribute signals to the rendering engine that the text element contains preformatted text. Style information can be introduced in the text content using nested <style> tags that support the folowing attributes : fontName, size, isBold, isItalic, isUnderline, isStrikeThrough, pdfFontName, pdfEncoding, isPdfEmbedded, forecolor, backcolor.
+
+
+
+
+
+
+ The text element contains text formatted using nested <style> tags.
+
+
+
+
+ The text element has a pure text content, without style information.
+
+
+
+
+
+
+
+ Specifies the name of the markup language used to embed style information into the text content. Supported values are none (plain text), styled (styled text), rtf (RTF format) and html (HTML format), but any custom made markup language can be used as long as there is a net.sf.jasperreports.engine.util.MarkupProcessorFactory implementation specified using a net.sf.jasperreports.markup.processor.factory.{markup} configuration property.
+
+
+
+
+
+
+
+ Defines the font to use with the text element.
+
+
+
+
+ Name of the report level font to use as base font (see reportFont element).
+
+
+
+
+ Name of the font.
+
+
+
+
+ Size of the font.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name of the PDF font.
+
+
+
+
+ Encoding type to use with the PDF font.
+
+
+
+
+ Specifies if the PDF font should be embedded in the document.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Definition of a text field object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deprecated. Replaced by attribute textAdjust.
+
+ Instructs the report engine to allow the text field to stretch downwards in order to display all its text when it doesn't fit in the defined text field height.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Text adjust type.
+
+
+
+
+
+ The text is cut, if it does not fit the text field element size.
+
+
+
+
+ The text field element is stretched in height to accommodate the entire content.
+
+
+
+
+ The font size of the text is scaled down so that the entire content fits the text field element size.
+
+ Font size is scaled down using decreasing font size increments/decrements, until the best fit is found. The minimum font size increment/decrement amount
+ is configured using the net.sf.jasperreports.scale.font.step.limit
+ property, which also serves as minimum acceptable font size.
+
+
+
+
+
+
+
+
+ Text to be printed is supplied by the text field associated expression. This expression can be evaluated at a specified moment. This could be useful, for example, when we want to have on the first page the total number of pages. The total number of pages is known only after filling the entire report, so we can specify that the text filed that will represent the total number of pages placed at the beginning of the report should be evaluated only when reaching the end of the report.
+
+
+
+
+ Used to specify the group at which to evaluate the text field value, when evaluationTime is "Group".
+
+
+
+
+ Pattern to use when formatting the output of the text field expression.
+
+
+
+
+ Specifies that the text field should display a blank character instead of "null" when the text field expression evaluates to null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates the type of the hyperlink element.
+
+ The type can be:
+
+ -
+ One of the built-in types:
+
+ None
+ - The current element doesn't represent a hyperlink.
+ Reference
+ - The current hyperlink points to an external resource specified by the corresponding hyperlinkReferenceExpression element, usually an URL.
+ LocalAnchor
+ - The current hyperlink points to a local anchor specified by the corresponding hyperlinkAnchorExpression element.
+ LocalPage
+ - The current hyperlink points to a 1 based page index within the current document specified by the corresponding hyperlinkPageExpression element.
+ RemoteAnchor
+ - The current hyperlink points to an anchor specified by the hyperlinkAnchorExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+ RemotePage
+ - The current hyperlink points to a 1 based page index specified by the hyperlinkPageExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+
+
+ -
+ A custom (arbitrary) type.
+
+
+
+
+
+
+
+
+ Indicates the target of the hyperlink.
+
+
+
+
+ The level of the bookmark corresponding to the anchor.
+
+ The PDF exporter can create a bookmark tree using anchors defined in the report.
+ This attribute specifies the level of the tree entry corresponding to this element's anchor.
+ If set to "0" (the default), no bookmark will be created for the anchor.
+
+
+
+
+
+
+
+
+ Defines the expression to use for this textField.
+
+
+
+
+ Class for the text field values.
+
+
+
+
+
+
+
+ Defines the pattern expression to use for this textField.
+
+
+
+
+
+ Definition of a subreport object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If true, tells the report engine to cache the report definition objects that are loaded from the same location.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Flag to specify if the subreport should consume all the available space on the current page. When this flag is set, the subreport would consume the entire vertical space available on the master page, and its column and page footers will be printed at the bottom of this space.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Determines what happens when the subreport contents overflows the element height. If not specified, the subreport will stretch to accomodate the contents.
+
+
+
+
+
+ The subreport stretches to to accomodate the overflown contents.
+
+
+
+
+ The contents do not stretch beyond the subreport element height. The band on which the subreport is placed overflows to a new page if allowed, and the subreport contents continues there.
+
+
+
+
+
+
+
+
+
+
+ Allows bulk passing the parameters to the subreport/subdataset into a java.lang.Map object. There are cases when we want to pass to the subreport/subdataset the same parameters that the master report has received. This can be achieved by passing the system-defined parameter called REPORT_PARAMETERS_MAP and maybe adding to or overriding those parameters using additional subreportParameter elements.
+
+
+
+
+
+
+
+ Definition of a subreport parameter.
+
+
+
+
+
+
+
+ The name of the parameter that will be passed when filling the subreport.
+
+
+
+
+
+
+
+ Definition of the expression associated with the subreport parameter.
+
+
+
+
+
+
+
+ Maps a subreport variable to a master report variable in order to allow returning values from subreport to the master report.
+
+
+
+
+ Name of the subreport variable whose value will be returned to the master report.
+
+
+
+
+ Name of the master report variable to which the value is returned. This should be a variable with calculation="System"
+
+
+
+
+ Calculation to perform on the master report variable when returning the value from the subreport.
+
+
+
+
+
+ No calculations are performed.
+
+
+
+
+ Variable stores the number of the not null values returned from the subreport.
+
+
+
+
+ Variable stores the number of distinct not null values returned from the subreport.
+
+
+
+
+ Variable stores the sum of the not null values returned from the subreport. Numeric variables only.
+
+
+
+
+ Variable stores the average of the not null values returned from the subreport. Numeric variables only.
+
+
+
+
+ Variable stores the lowest value returned from the subreport.
+
+
+
+
+ Variable stores the highest value returned from the subreport.
+
+
+
+
+ Variable stores the standard deviation of the not null values returned from the subreport. Numeric variables only.
+
+
+
+
+ Variable stores the variance of the not null values returned from the subreport. Numeric variables only.
+
+
+
+
+ Variable stores the first value encountered and ignores subsequent values.
+
+
+
+
+
+
+
+ The name of a class that implements the net.sf.jasperreports.engine.fill.JRIncrementerFactory interface to use when creating the incrementer instance to handle the value returned from the subreport.
+
+
+
+
+
+
+
+ If present, it is used to pass the java.sql.Connection object to the subreport filling or subdataset iteration routines.
+
+
+
+
+
+
+
+ If present, it is used to pass the net.sf.jasperreports.engine.JRDataSource object to the subreport filling or subdataset iteration routines.
+
+
+
+
+
+
+
+ Definition of the expression that will be used to determine the report object that will be loaded as a subreport.
+
+
+
+
+ Class of the image source.
+
+
+
+
+
+
+
+ Element for grouping objects on the report.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a chart report element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show legend flag
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The chart can be rendered at a specified moment. This could be useful, for example, when we want to have on the first page a chart that will be generated only after fetching all the data source rows.
+
+
+
+
+ Used to specify the group at which to render the chart, when evaluationTime is "Group".
+
+
+
+
+ Indicates the type of the hyperlink element.
+
+ The type can be:
+
+ -
+ One of the built-in types:
+
+ None
+ - The current element doesn't represent a hyperlink.
+ Reference
+ - The current hyperlink points to an external resource specified by the corresponding hyperlinkReferenceExpression element, usually an URL.
+ LocalAnchor
+ - The current hyperlink points to a local anchor specified by the corresponding hyperlinkAnchorExpression element.
+ LocalPage
+ - The current hyperlink points to a 1 based page index within the current document specified by the corresponding hyperlinkPageExpression element.
+ RemoteAnchor
+ - The current hyperlink points to an anchor specified by the hyperlinkAnchorExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+ RemotePage
+ - The current hyperlink points to a 1 based page index specified by the hyperlinkPageExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+
+
+ -
+ A custom (arbitrary) type.
+
+
+
+
+
+
+
+
+ Indicates the target of the hyperlink.
+
+
+
+
+ The level of the bookmark corresponding to the anchor.
+
+ The PDF exporter can create a bookmark tree using anchors defined in the report.
+ This attribute specifies the level of the tree entry corresponding to this element's anchor.
+ If set to "0" (the default), no bookmark will be created for the anchor.
+
+
+
+
+
+ The name of the chart customizer class.
+
+ A chart can have an associated customizer class to perform customizations that are not directly supported by JRXML.
+ The customizer class should implement net.sf.jasperreports.engine.JRChartCustomizer.
+ At fill time, the customize() method of this class will be called before the chart is rendered.
+
+ If values of report parameters, variables or fields are needed in the customization, the customizer implementation
+should extend net.sf.jasperreports.engine.JRAbstractChartCustomizer to gain access to such values.
+
+
+
+
+
+ Represents the specified format used to render the chart.
+
+
+
+
+ The chart theme used to draw the chart.
+
+
+
+
+
+
+
+ Title text of the chart.
+
+
+
+
+
+
+
+
+ Position of the title
+
+
+
+
+
+
+
+
+
+
+
+
+ Color of the title text
+
+
+
+
+
+
+
+ Title expression of the chart
+
+
+
+
+
+
+
+ Subtitle of the chart
+
+
+
+
+
+
+
+
+ Color of the subtitle text
+
+
+
+
+
+
+
+ Defines the expression for the chart subtitle
+
+
+
+
+
+
+
+ Specifies layout options for the legend of a chart.
+
+
+
+
+
+
+
+ The color of the text in the legend.
+
+
+
+
+ The color of the background of the legend.
+
+
+
+
+ Position of the legend.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Configures settings for item labels in a category plot.
+
+
+
+
+
+
+
+ The color of the label's text.
+
+
+
+
+ The background color of the label's text.
+
+
+
+
+
+
+
+
+ Defines a pie type chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a dataset to be used with pieChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a key in a pieDataset or pieSeries
+
+
+
+
+
+
+
+ Defines the expression for the value of a point in a chart.
+
+
+
+
+
+
+
+ Defines a label in a pieDataset or pieSeries.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Hyperlink specification for pie chart sections. This hyperlink definition will be evaluated for every chart section and a image map will be created for the chart.
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates the type of the hyperlink element.
+
+ The type can be:
+
+ -
+ One of the built-in types:
+
+ None
+ - The current element doesn't represent a hyperlink.
+ Reference
+ - The current hyperlink points to an external resource specified by the corresponding hyperlinkReferenceExpression element, usually an URL.
+ LocalAnchor
+ - The current hyperlink points to a local anchor specified by the corresponding hyperlinkAnchorExpression element.
+ LocalPage
+ - The current hyperlink points to a 1 based page index within the current document specified by the corresponding hyperlinkPageExpression element.
+ RemoteAnchor
+ - The current hyperlink points to an anchor specified by the hyperlinkAnchorExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+ RemotePage
+ - The current hyperlink points to a 1 based page index specified by the hyperlinkPageExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+
+
+ -
+ A custom (arbitrary) type.
+
+
+
+
+
+
+
+
+ Indicates the target of the hyperlink.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates the type of the hyperlink element.
+
+ The type can be:
+
+ -
+ One of the built-in types:
+
+ None
+ - The current element doesn't represent a hyperlink.
+ Reference
+ - The current hyperlink points to an external resource specified by the corresponding hyperlinkReferenceExpression element, usually an URL.
+ LocalAnchor
+ - The current hyperlink points to a local anchor specified by the corresponding hyperlinkAnchorExpression element.
+ LocalPage
+ - The current hyperlink points to a 1 based page index within the current document specified by the corresponding hyperlinkPageExpression element.
+ RemoteAnchor
+ - The current hyperlink points to an anchor specified by the hyperlinkAnchorExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+ RemotePage
+ - The current hyperlink points to a 1 based page index specified by the hyperlinkPageExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+
+
+ -
+ A custom (arbitrary) type.
+
+
+
+
+
+
+
+
+ Indicates the target of the hyperlink.
+
+
+
+
+
+
+
+ Plot options for a pieChart
+
+
+
+
+
+
+
+
+ Show labels flag.
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the pie chart is circular, or stretched into an elliptical shape
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dataset definition for a chart or crosstab.
+
+
+
+
+
+
+
+
+ Reset type for the dataset
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reset group name
+
+
+
+
+ Increment type of the dataset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Increment group of the dataset
+
+
+
+
+
+
+
+ Boolean expression that determines whether a chart or crosstab dataset will be incremented or not.
+ Boolean.TRUE; if the result is null or Boolean.FALSE, the dataset will not be incremented.
+ ]]>
+
+
+
+
+
+
+
+
+ Subdataset instantiation information for a chart/crosstab dataset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The name of the subdataset to instantiate.
+
+
+
+
+ This attribute is auto-generated and is used to uniquely identify dataset runs.
+
+
+
+
+
+
+
+
+ Name of the variable to which the value is returned. This should be a variable withcalculation="System"
+
+
+
+
+ Calculation to perform on the destination variable when returning the value.
+
+
+
+
+
+ No calculations are performed.
+
+
+
+
+ Variable stores the number of the not null returned values.
+
+
+
+
+ Variable stores the number of distinct not null returned values.
+
+
+
+
+ Variable stores the sum of the not null returned values. Numeric variables only.
+
+
+
+
+ Variable stores the average of the not null returned values. Numeric variables only.
+
+
+
+
+ Variable stores the lowest returned value.
+
+
+
+
+ Variable stores the highest returned value.
+
+
+
+
+ Variable stores the standard deviation of the not null values. Numeric variables only.
+
+
+
+
+ Variable stores the variance of the not null values. Numeric variables only.
+
+
+
+
+ Variable stores the first value encountered and ignores subsequent values.
+
+
+
+
+
+
+
+ The name of a class that implements thenet.sf.jasperreports.engine.fill.JRIncrementerFactory interface to use when creating the incrementer instance to handle the returned value.
+
+
+
+
+
+
+
+
+
+ Name of the source variable whose value will be returned.
+
+
+
+
+
+
+
+
+
+
+
+
+ Allows bulk passing the parameters to the subreport/subdataset into a java.lang.Map object. There are cases when we want to pass to the subreport/subdataset the same parameters that the master report has received. This can be achieved by passing the system-defined parameter called REPORT_PARAMETERS_MAP and maybe adding to or overriding those parameters using additional subreportParameter elements.
+
+
+
+
+
+
+
+
+
+
+
+ Definition of a subdataset parameter.
+
+
+
+
+
+
+
+ The name of the parameter that will be passed when iterating the subdataset.
+
+
+
+
+
+
+
+ Definition of the expression associated with the subdataset parameter.
+
+
+
+
+
+
+
+ Defines generic plot options for charts
+
+
+
+
+
+
+
+ Background color of the chart
+
+
+
+
+ Orientation of the chart
+
+
+
+
+
+
+
+
+
+
+ Alpha (transparency) parameter for the background.
+
+
+
+
+ Alpha (transparency) parameter for the foreground.
+
+
+
+
+ Deprecated. Replaced by attribute labelRotation of tag categoryAxisFormat. Degrees to rotate the text labels for the x axis of the chart. Positive
+ values rotate the text clockwise and negative values rotate it counterclockwise.
+ This attribute has no effect on charts where the x axis is either numeric or a
+ date.
+
+
+
+
+
+
+
+
+ Defines the color to use for a series in the report. If only one seriesColor
+ is specified it becomes the color of the first series. If more than one seriesColor is
+ specified the chart will cycle through the supplied colors. Meter and Thermometer charts
+ do not have series and
+ will ignore any seriesColor settings.
+
+ When used in a chart that part of a multi-axis chart series color is treated a bit
+ differently. The default color series to cycle through is defined in the plot of the
+ multi axis chart, and the color series for the nested charts define series colors
+ for that chart only. This is useful when a multiple axis chart contains several
+ line charts, each with one series. By default every line will be the first in its
+ plot and will have the first color defined in the multi axis plot, so every line will
+ be the same color. To solve this you can set a seriesColor for each nested chart to
+ override the default colors.
+
+
+
+
+
+ The relative order of this color. All seriesColors are sorted
+ by the value of this attribute, and appear in that order when coloring the
+ series.
+
+ When the chart is nested inside a multiple axis chart the seriesOrder is
+ the actual series number to apply the color to. Series use zero-based indexing.
+
+
+
+
+
+ The color to use for the series
+
+
+
+
+
+
+
+ Defines a pie chart with 3D effect
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines plot options for a pie3DChart
+
+
+
+
+
+
+
+
+ Show labels flag.
+
+
+
+
+
+
+
+
+
+
+ Depth factor for a pie chart plot.
+
+
+
+
+ Indicates whether the pie chart is circular, or stretched into an elliptical shape
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a bar chart. Dataset used with this chart is categoryDataset
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a dataset with one or more series and values associated with categories
+
+
+
+
+
+
+
+
+
+
+
+ Defines a series that will be mapped on the category axis.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a series expression in a dataset
+
+
+
+
+
+
+
+ Defines a category expression in a dataset.
+
+
+
+
+
+
+
+ Hyperlink specification for chart items. This hyperlink definition will be evaluated for every chart item and an image map will be created for the chart.
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates the type of the hyperlink element.
+
+ The type can be:
+
+ -
+ One of the built-in types:
+
+ None
+ - The current element doesn't represent a hyperlink.
+ Reference
+ - The current hyperlink points to an external resource specified by the corresponding hyperlinkReferenceExpression element, usually an URL.
+ LocalAnchor
+ - The current hyperlink points to a local anchor specified by the corresponding hyperlinkAnchorExpression element.
+ LocalPage
+ - The current hyperlink points to a 1 based page index within the current document specified by the corresponding hyperlinkPageExpression element.
+ RemoteAnchor
+ - The current hyperlink points to an anchor specified by the hyperlinkAnchorExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+ RemotePage
+ - The current hyperlink points to a 1 based page index specified by the hyperlinkPageExpression element, within an external document indicated by the corresponding hyperlinkReferenceExpression element.
+
+
+ -
+ A custom (arbitrary) type.
+
+
+
+
+
+
+
+
+ Indicates the target of the hyperlink.
+
+
+
+
+
+
+
+ Plot options for a barChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show labels flag.
+
+
+
+
+
+
+
+
+
+
+ Show tick marks on the value axis
+
+
+
+
+
+
+
+
+
+
+ Show tick labels on the value axis
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Expression that will be displayed on category axis
+
+
+
+
+
+
+
+ Defines the expression for the value axis of the chart
+
+
+
+
+
+
+
+ Defines the expression for the minimum value on the domain axis.
+
+
+
+
+
+
+
+ Defines the expression for the maximum value on the domain axis.
+
+
+
+
+
+
+
+ Defines the expression for the minimum value on the range axis.
+
+
+
+
+
+
+
+ Defines the expression for the maximum value on the range axis.
+
+
+
+
+
+
+
+ Specifies the formatting of a category axis, including how to
+ draw the axis line, its label and tick mark labels. Any tick label mask
+ specified will be ignored.
+
+
+
+
+
+
+
+
+ Degrees to rotate the text labels for the category axis of the chart. Positive
+ values rotate the text clockwise and negative values rotate it counterclockwise.
+
+
+
+
+
+
+
+
+ Specifies the formatting of a value axis, including how to
+ draw the axis line, its label and tick mark labels. If a tick label mask
+ is specified it will be treated as a numeric mask.
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the general formatting settings for an axis.
+
+
+
+
+
+
+
+
+ The color to use for the caption of the axis.
+
+
+
+
+ The color to use for the label of each tick mark on the axis.
+
+
+
+
+ A formatting mask to use for the label of each tick mark on the
+ axis. Only used if the axis is time based or numeric based. For numeric
+ axes the format of the mask is described in documentation for
+ java.text.DecimalFormat. For a date axis the
+ format used is described in java.text.SimpleDateFormat.
+ Finally, for date axes the values "SHORT", "MEDIUM", "LONG" and
+ "FULL" can be used as described in java.text.DateFormat.
+
+
+
+
+
+ Flag to force rendering the tick labels rotated 90 degrees.
+
+
+
+
+ The color to use when drawing the line showing the axis.
+
+
+
+
+
+
+
+ Specifies the font to use when drawing the label of an axis
+ in a chart. The label of an axis is the text that describes the axis.
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the font to use when drawing the label for each tick
+ mark on an axis in a chart.
+
+
+
+
+
+
+
+
+
+
+
+ Defines a bar chart with 3D effect
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines plot options for a bar chart with 3D effect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show labels flag.
+
+
+
+
+
+
+
+
+
+
+ Offset on the x axis.
+
+
+
+
+ Offset on the y axis.
+
+
+
+
+
+
+
+ Defines a bar chart that uses an xyDataset
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a time period dataset
+
+
+
+
+
+
+
+
+
+
+
+ Defines a time period series for a timePeriodDataset
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a stacked bar chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a stacked area chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a stacked bar chart with 3D effect
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a line chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines plot options for a lineChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show lines flag.
+
+
+
+
+
+
+
+
+
+
+ Show shapes flag.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a line chart that uses an xyzDataset
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines an XY type dataset
+
+
+
+
+
+
+
+
+
+
+
+ Defines a series used in an xyDataset
+
+
+
+
+
+
+
+
+
+
+
+ Auto sort values on x-axis.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the expression for the value of the X axis of the chart.
+
+
+
+
+
+
+
+ Defines the value for the Y axis.
+
+
+
+
+
+
+
+ Defines an area chart.
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines rendering options for an areaChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a area chart that uses an xyDataset
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a scatter chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the plot options for a scatterChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show lines flag
+
+
+
+
+
+
+
+
+
+
+ Show shapes flag
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the expression for the label of the X axis of the chart
+
+
+
+
+
+
+
+ Defines the expression for the Y axis label of the chart
+
+
+
+
+
+
+
+ Specifies the formatting of an x axis, including how to
+ draw the axis line, its label and tick mark labels. If a tick label mask
+ is specified it will be treated as a numeric mask.
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the formatting of a y axis, including how to
+ draw the axis line, its label and tick mark labels. If a tick label mask
+ is specified it will be treated as a numeric mask.
+
+
+
+
+
+
+
+
+
+
+
+ Creates a bubble chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a dataaset used for bubbleChart
+
+
+
+
+
+
+
+
+
+
+
+ Defines a series in an xyzDataset
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Plot options for a bubbleChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Scale options for the bubble chart items
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Expression that defines the value for the Z axis in an xyzSeries
+
+
+
+
+
+
+
+ Defines a time series dataset
+
+
+
+
+
+
+
+
+ Time period for the dataset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a time series for timeSeriesDataset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the expression used for a time period
+
+
+
+
+
+
+
+ Defines a time series chart.
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines plot options for a timeSeriesChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show lines flag.
+
+
+
+
+
+
+
+
+
+
+ Show shapes flag.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the expression used for the time axis label
+
+
+
+
+
+
+
+ Specifies the formatting of a time axis, including how to
+ draw the axis line, its label and tick mark labels. If a tick label mask
+ is specified it will be treated as a date mask.
+
+
+
+
+
+
+
+
+
+
+
+ Defines a high-low type chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a dataset that can be used with a highLowChart.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Plot options for a highLowChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show close tick flag.
+
+
+
+
+
+
+
+
+
+
+ Show open tick flag.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a date expression used in timeSeriesChart
+
+
+
+
+
+
+
+ High expresion in a highLowchart.
+
+
+
+
+
+
+
+ Low expresion in a highLowchart.
+
+
+
+
+
+
+
+ Open expression for a candlestickChart
+
+
+
+
+
+
+
+ Expression for the close value for candlestickChart
+
+
+
+
+
+
+
+ Defines the volumeExpression for a highLowDataset
+
+
+
+
+
+
+
+ Creates a candlestick chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Plot options for a candlestickChart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Flag that enables showing volume values for a candlestickChart.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a meter chart. A meter chart plots a single value on a dial. In addition to the value being
+ plotted multiple ranges can be specified to help interpret the value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a dataset that contains a single value.
+
+
+
+
+
+
+
+
+
+
+
+ Plot options for a meterChart.
+
+
+
+
+
+
+
+
+
+
+
+ Defines the shape of the meter. The final appearance is determined by the combination of
+ this attribute and the angle attribute. This attribute only matters when the meter
+ is using an angle over 180 degrees.
+
+ When a meter is over 180 degrees wide the space between the start and end of the meter can be filled
+ in several different ways. The best way to visualize this is to think of a twelve hour clock. If the angle of the meter is 240 degrees the
+ meter will start at 8, sweep up past 12 and down to 4. This attribute specifies how to fill the area
+ between 4 o'clock and 8 o'clock.
+
+
+
+
+
+
+
+ A straight line is drawn between the start point and the end point, and the area bounded by
+ the meter and this line is shaded with the background color.
+
+
+
+
+
+ The unused portion of the circle that describes the meter is shaded with the background color.
+
+
+
+
+ The unused portion of the circle that describes the meter is not shaded at all.
+
+
+
+
+ The unused portion of the circle that describes the meter is shaded with the background color and handled with specific dial objects.
+
+
+
+
+
+
+
+ The extent of the meter in degrees. Use 180 for a semicircle.
+
+
+
+
+ An optional string that describes the unit that the meter is displaying. This string will
+ be appended to the value.
+
+
+
+
+
+ The amount of space between values to mark as "ticks" on the face of the meter. If the meter has a data
+ range of 0-100 and the tick interval is 20, there will be 4 ticks at 20, 40, 60 and 80.
+
+
+
+
+
+ The color of meter. If meterIntervals are defined they may
+ mask this color.
+
+
+
+
+
+ The color used to draw the needle in the meter.
+
+
+
+
+ The color of the meter ticks, if any.
+
+
+
+
+ The number of major ticks on the meter scale.
+
+
+
+
+
+
+
+ Controls how the single data value is displayed in a meterChart or
+ thermometerChart.
+
+
+
+
+
+
+
+
+ The color to use when displaying the value.
+
+
+
+
+ The formatting mask to use to display the value. This mask must follow the rules
+ specified for a java.text.DecimalFormat pattern.
+
+ This attribute is currently ignored for a meterChart.
+
+
+
+
+
+
+
+
+ Defines a numeric range, such as the bounds of chart or a section of a chart.
+
+
+
+
+
+
+
+
+
+
+
+ Describes a range of a meterChart to highlight. A typical use is to
+ divide a meter up into sections such as "normal", "warning" and "critical" and color code them.
+
+
+
+
+
+
+
+
+ The name of this region. The name will appear in the meter's legend if the legend
+ is being displayed.
+
+
+
+
+
+ The color used to shade the region in the meter. If not set the region will have no
+ visual indicator.
+
+
+
+
+
+ The alpha (transparency) of the shading for the region. The values range from 0.0
+ (completely transparent) to 1.0 (completely opaque).
+
+
+
+
+
+
+
+
+ Defines a thermometer chart. A thermometer chart plots a single value on a thermometer.
+ In addition to the value being plotted three ranges can be specified to help interpret the value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Plot options for a thermometerChart.
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines where to display the textual representation of the value being displayed,
+ relative to the thermometer outline.
+
+
+
+
+
+
+ The textual value is not displayed.
+
+
+
+
+ The text value is displayed to the left of the thermometer outline.
+
+
+
+
+ The text value is displayed to the right of the thermometer outline.
+
+
+
+
+ The text value is displayed in the bulb at the bottom of the thermometer.
+
+
+
+
+
+
+
+ Deprecated. No longer used. Defines whether or not lines are drawn showing values on the thermometer.
+
+
+
+
+
+ Value lines are drawn.
+
+
+
+
+ Value lines are not drawn.
+
+
+
+
+
+
+
+ The color used to fill the thermometer.
+
+ If the value of the thermometer falls in one of the defined ranges the color specified in that range
+ will be used instead of this color.
+
+
+
+
+
+
+
+
+ Defines the low range in a thermometerChart.
+
+
+
+
+
+
+
+
+
+
+ Defines the medium range in a thermometerChart.
+
+
+
+
+
+
+
+
+
+
+ Defines the high range in a thermometerChart.
+
+
+
+
+
+
+
+
+
+
+ Definition of chart with multiple range axis, all sharing a common
+ domain axis. The domain is determined by the dataset of each nested report, and
+ they must all use the same type of dataset. The time period datasets (highLowDataset,
+ candlestickDataset and timeSeriesDataset) are considered the same and can be
+ mixed.
+
+ Each nested chart has its own range, so you can combine charts with significantly
+ different scales. Each chart will have its own axis showing its range, and it is
+ highly recommended to color the data series and the axis to match.
+
+ The plot options of the nested reports are ignored - the plot is configured via the
+ multiAxisPlot. The only exception to this is any seriesColors specified in the
+ plot of a nested report, which will be used to color a specific series in that
+ report. In this case the seriesOrder in the seriesColor is an absolute specification
+ of a series to color, not a relative ordering.
+
+
+
+
+
+
+
+
+
+
+
+
+ Plot options for a multiAxisChart.
+ The set plot options will be shared by all the charts inside this plot, and the
+ nested charts are specified via the axis tags.
+ All nested charts must share the same type of domain axis - a category, a numeric (xy)
+ or a time based axis.
+
+
+
+
+
+
+
+
+
+
+
+
+ Describes a range axis to use in a multiAxisChart. Each axis has its own range indicator and a data plot.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates where relative to the chart to display the range axis for this chart
+
+
+
+
+
+ Display the axis to the left (for charts with
+ a Vertical orientation) or top (for charts with a
+ Horizontal orientation.)
+
+
+
+
+
+ Display the axis to the right (for charts with
+ a Vertical orientation) or bottom (for charts with a
+ Horizontal orientation.)
+
+
+
+
+
+
+
+
+
+
+
+ Crosstab definition.
+
+ To be noted that the crosstab will stretch downwards to fit the data but it will not exceed its report element width.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Flag that indicates whether the column headers will be reprinted after a page break.
+
+
+
+
+
+ The column headers will be reprinted after a page break.
+
+
+
+
+ The column headers will be printed only on the page where the crosstab starts.
+
+
+
+
+
+
+
+ Flag that indicates whether the row headers will be reprinted after a crosstab column break.
+
+
+
+
+
+ The row headers will be reprinted after a crosstab column break.
+
+
+
+
+ The column headers will be printed for all rows only for the first set of columns and not after a column break.
+
+
+
+
+
+
+
+ Offset used when a column break occurs and the filling is continued on the same page.
+
+ When the crosstab columns do not fit the width, the crosstab breaks the columns and prints the ones that don't fit after printing the first set of columns for all rows.
+ This attribute is the offset to be used when continuing the printing after a column break.
+
+
+
+
+
+ The crosstab run direction.
+
+ Crosstabs can either be filled from left to right (the default) or from right to left (mainly for reports in RTL languages).
+
+ When a crosstab is filled from right to left, the crosstab contents will start from the right extremity of the crosstab element area and grow towards the left.
+
+
+
+
+
+
+ Left to right run direction.
+
+
+
+
+ Right to left run direction.
+
+
+
+
+
+
+
+
+This attribute determines whether the crosstab will break at the width set for
+the crosstab element, or whether the crosstab is to expand over this width
+(and over the page width as well).
+
+If this attribute is set to true, the crosstab will expand towards
+the right (or towards the left if the crosstab direction is RTL) as long
+as it needs to. This would result in crosstab cells being rendered over
+the page boundary; such elements will be exported by certain grid-based
+exporters such as the HTML or XLS ones, but will not be visible in export
+formats that observe the page width, such as the PDF exporter.
+
+
+The default value of this flag is given by the
+net.sf.jasperreports.crosstab.ignore.width
+property.
+
+
+
+
+
+
+ The position of the crosstab within its element box.
+
+ By default LTR crosstabs are positions at the left of the element box, and RTL crosstabs at the right of the box.
+
+
+
+
+
+
+ The crosstab is positioned at the left of the element box.
+
+
+
+
+ The crosstab is positioned at the right of the element box.
+
+
+
+
+ The crosstab is centered withing the element box.
+
+
+
+
+
+
+
+
+
+
+ Crosstab parameter definition and value. Values from the report can only be accessed inside crosstab elements by passing them as parameters.
+
+
+
+
+
+
+
+ Name of the parameter.
+
+
+
+
+ Class of the parameter values.
+
+
+
+
+
+
+
+ Crosstab parameter value expression.
+
+
+
+
+
+
+
+ Crosstab dataset definition.
+
+
+
+
+
+
+
+ Flag that indicates whether the crosstab data is already sorted according to the row bucket expressions and group bucket expressions (in this order).
+
+ The crosstab calculation engine can optimize the calculations if the data is sorted by the row groups and column groups.
+ For example, if there are two row groups R1 and R2 (subgroup of R1) and three column groups C1, C2 and C3 the data should be sorted by R1, R2, C1, C2, C3.
+
+
+
+
+
+
+ The calculation engine will assume that the data is presorted. If the data is not presorted, the outcome is undefined.
+
+
+
+
+ The crosstab dataset data is not presorted.
+
+
+
+
+
+
+
+
+
+
+ Crosstab cell that will be rendered at the upper-left corner of the crosstab.
+
+ The cell size will be calculated based on the row/column header cell widths/heights.
+
+
+
+
+
+
+
+
+
+
+
+ Crosstab row group definition.
+
+ Each group in the crosstab has a variable that can be used inside the group header or inside the crosstab cells as the current group value.
+ The variable has the same name as the group and the same type as the bucket expression of the group.
+
+
+
+
+
+
+
+
+
+ Group name.
+
+
+
+
+ The width of the row group header.
+
+
+
+
+ The position of the total row for this group.
+
+ A group can have a total row summing the values for all the entries in the group.
+ E.g. if there is a Year group having Month as a subgroup, the total row for the Year group would sum the values for all the years and the total row for the Month group would sum the values for all the months of an year.
+
+
+
+
+
+
+ The total row will be displayed before the group rows.
+
+
+
+
+ The total row will be displayed after the group rows.
+
+
+
+
+ The total row will not be displayed.
+
+
+
+
+
+
+
+ The position of the header contents on header span.
+
+ The row group headers stretch vertically by spanning when there are multiple sub group entries.
+ This attribute determines the way the header contents will be adjusted to the new height.
+
+
+
+
+
+ The contents will be rendered at the top of the header
+
+
+
+
+ The contents will be rendered on the center of the header
+
+
+
+
+ The contents will be rendered at the bottom of the header
+
+
+
+
+ The contents will be proportionally stretched to the new header height
+
+
+
+
+
+
+
+
+ Determines whether the header cell of this group spans across all rows in the group,
+ or whether the header cell repeats for each sub group entry.
+
+ If the header cell is set to repeat, the sub group should not have a total row.
+
+
+ By default the header cell spans across all rows that are part of the group.
+
+
+
+
+
+
+
+
+
+ Crosstab row header definition.
+
+ The size of the row header cell is computed based on the following rules:
+
+ - the width of the header is given by the width attribute of rowGroup
+ - the height of the last row group header is given by the height of the base cell
+ - the height of a non-last row group header is the sum of the next group header's height and
+ the next group total header's height (0 if the next group doesn't have a total header)
+
+
+
+
+
+
+
+
+
+
+
+
+ Crosstab total row header definition.
+
+ The size of a row group total header is computed based on the following rules:
+
+ - the width is the sum the widths of this and subsequent row groups
+ - the height is the height of the base cell for this total row
+
+
+ The total row is only printed if the totalPosition attribute of the group is different than None.
+
+
+
+
+
+
+
+
+
+
+
+ Crosstab column group definition.
+
+ Each group in the crosstab has a variable that can be used inside the group header or inside the crosstab cells as the current group value.
+ The variable has the same name as the group and the same type as the bucket expression of the group.
+
+
+
+
+
+
+
+
+
+
+
+ Group name.
+
+
+
+
+ The height of the column group header.
+
+
+
+
+ The position of the total column for this group.
+
+ A group can have a total column summing the values for all the entries in the group.
+ E.g. if there is a Year group having Month as a subgroup, the total column for the Year group would sum the values for all the years and the total column for the Month group would sum the values for all the months of an year.
+
+
+
+
+
+
+ The total column will be displayed before the group column.
+
+
+
+
+ The total column will be displayed after the group column.
+
+
+
+
+ The total column will not be displayed.
+
+
+
+
+
+
+
+ The position of the header contents on header span.
+
+ The column group headers stretch horizontally by spanning when there are multiple sub group entries.
+ This attribute determines the way the header contents will be adjusted to the new width.
+
+
+
+
+
+
+ The contents will be rendered on the left side of the header
+
+
+
+
+ The contents will be rendered on the center of the header
+
+
+
+
+ The contents will be rendered on the right side of the header
+
+
+
+
+ The contents will be proportionally stretched to the new header width
+
+
+
+
+
+
+
+
+ Determines whether the header cell of this group spans across all columns in the group,
+ or whether the header cell repeats for each sub group entry.
+
+ If the header cell is set to repeat, the sub group should not have a total column.
+
+
+ By default the header cell spans across all columns that are part of the group.
+
+
+
+
+
+
+
+
+
+ Crosstab column header definition.
+
+ The size of the column header cell is computed based on the following rules:
+
+ - the height of the header is given by the height attribute of columnGroup
+ - the width of the last column group header is given by the width of the base cell
+ - the width of a non-last column group header is the sum of the next group header's width and
+ the next group total header's width (0 if the next group doesn't have a total header)
+
+
+
+
+
+
+
+
+
+
+
+
+ Crosstab total column header definition.
+
+ The size of a column group total header is computed based on the following rules:
+
+ - the height is the sum the heights of this and subsequent column groups
+ - the width is the width of the base cell for this total column
+
+
+ The total column is only printed if the totalPosition attribute of the group is different than None.
+
+
+
+
+
+
+
+
+
+
+
+ Per column group cell that will be rendered at the left of the corresponding row of column headers, potentially overlapping the crosstab header cell.
+
+ The width of the cell is the total width of row group headers, and the height is the height of the corresponding column header.
+
+
+
+
+
+
+
+
+
+
+
+ Crosstab group bucketing information.
+
+
+
+
+
+
+
+
+
+ Class of the bucket values.
+
+
+
+
+ The bucket order type.
+
+
+
+
+
+ The buckets will be sorted in ascending order by using the specified comparator or by the natural order if no comparator specified.
+
+
+
+
+ The buckets will be sorted in descending order by using the specified comparator or by the natural order if no comparator specified.
+
+
+
+
+ The buckets will preserve the order in which the data is fed to the crosstab.
+
+
+
+
+
+
+
+
+
+
+ Crosstab group bucketing expression.
+
+
+
+
+
+
+
+
+
+ Expression that provides order by values for group buckets.
+ If not set, the bucket values as returned by bucketExpression are used to order the buckets.
+
+ The expression is evaluated in the context of the crosstab group and can reference measure variables, which evaluate to group totals.
+
+
+
+
+
+
+
+
+
+
+ Crosstab group bucket comparator expression.
+
+ The result of this expression is used to sort the buckets, in ascending or descending order.
+ If the bucket has an order by expression, the comparator will be used to compare values as produced by that expression.
+ If no comparator expression is specified, the natural order will be used.
+
+
+
+
+
+
+
+
+
+ Crosstab measure definition.
+
+ A measure is a value accumulated by the crosstab calculation engine and displayed in the crosstab data cells.
+
+ Each measure in the crosstab has a variable that can be used inside the data cells as the current measure value.
+ The variable has the same name and type as the measure.
+
+ Variables representing totals at different levels are also available. The names of these variables are:
+
+ - <Measure>_<Row/Column Group>_ALL - the total for the column/row group
+ - <Measure>_<Row Group>_<Column Group>_ALL - the combined total for the column and row groups
+
+
+ For instance, if one defines "Year" and "Month" column groups, a "City" row group and a "Sales" measure, then:
+
+ - Sales_Month_ALL will hold the total for all months (i.e. for one year)
+ - Sales_City_Month_ALL will hold the total for all months (one year) and all cities
+ - Sales_City_Year_ALL will hold the grand total
+
+
+
+
+
+
+
+
+
+ Measure name.
+
+
+
+
+ The measure values class.
+
+
+
+
+ The calculation type to be performed on the measure values.
+
+
+
+
+ The name of a class that implements the net.sf.jasperreports.engine.fill.JRIncrementerFactory interface to use when creating the incrementer instance for this measure. Incrementers are objects that implement the net.sf.jasperreports.engine.fill.JRIncrementer interface and handle the incremental calculation performed on the measure's current value with every entry in the crosstab dataset.
+
+
+
+
+ The percentage calculation type performed on this measure.
+
+ If percentage calculation is required, the value class should be one of the built-in supported percentage types or the percentage calculator class should be specified.
+ The classes with built-in support are java.lang.Float, java.lang.Double, java.lang.Byte, java.lang.Short, java.lang.Integer, java.lang.Long, java.math.BigDecimal and java.math.BigInteger.
+
+
+
+
+
+
+ The value will not be calculated as a percentage
+
+
+
+
+ The value will be calculated as percentage of the grand total value
+
+
+
+
+
+
+
+ The percentage calcualtor class name.
+
+ The class should implement the net.sf.jasperreports.crosstabs.fill.JRPercentageCalculator interface.
+
+
+
+
+
+
+
+
+
+
+ No calculations are performed.
+
+
+
+
+ The measure stores the number of the not null
+ values.
+
+
+
+
+ The measure stores the number of distinct not null
+ values.
+
+
+
+
+ The measure stores the sum of the not null values.
+ Numeric measures only.
+
+
+
+
+ The measure stores the average of the not null
+ values. Numeric measures only.
+
+
+
+
+ The measure stores the lowest value.
+
+
+
+
+ The measure stores the highest value.
+
+
+
+
+
+ The measure stores the standard deviation of the not
+ null values. Numeric measures only.
+
+
+
+
+ The measure stores the variance of the not null
+ values. Numeric measures only.
+
+
+
+
+ The measure stores the first value encountered and
+ ignores subsequent values.
+
+
+
+
+
+
+
+ Crosstab measure expression.
+
+
+
+
+
+
+
+ Crosstab data cell definition.
+
+ A crosstab can have multiple data cells for row/groups totals. Attributes rowTotalGroup and columnTotalGroup are used to specify that the cell corresponds to a total row/column.
+
+ E.g. if the crosstab has Country and City (subgroup of Country) row groups and Year and Month column groups, one can specify the following cells:
+
+ - no rowTotalGroup and columnTotalGroup - the crosstab base cell (total for a city and a year)
+ - columnTotalGroup="Month" - total for a city and a year
+ - columnTotalGroup="Year" - total for a city and all years
+ - rowTotalGroup="City" - total for all cities of a country and a month
+ - rowTotalGroup="City" columnTotalGroup="Month" - total for all cities of a country and a year
+ - rowTotalGroup="City" columnTotalGroup="Year" - total for all cities of a country and all years
+ - rowTotalGroup="Country" - total for all countries and a month
+ - rowTotalGroup="Country" columnTotalGroup="Month" - total for all countries and a year
+ - rowTotalGroup="Country" columnTotalGroup="Year" - grand total
+
+
+ If the data cell for a total row/column is not specified, the cell will be inherited from lower level cells, if possible.
+ For example, if the "total for all countries and a year" cell is not specified, the "total for a country and a year" or "total for a city and a year" cell will be used (in this order).
+
+ The data cell sizes are calculated from the base data cell sizes, i.e. the height of all data cells for a row will be the height of the base cell of that row.
+ The base cell sizes are also inherited, e.g. if the height of a total row is not specified the height of the base row will be used.
+
+
+
+
+
+
+
+
+ Crosstab cell width.
+
+ The width should be specified only for the base cell of a column (the one with no rowTotalGroup).
+
+
+
+
+
+ Crosstab cell height.
+
+ The height should be specified only for the base cell of a row (the one with no columnTotalGroup).
+
+
+
+
+
+ If this cell corresponds to a total row, this attribute should specify the name of the corresponding row group.
+ The attribute should not be specified if the cell corresponds to a base (not total) row.
+
+
+
+
+
+ If this cell corresponds to a total column, this attribute should specify the name of the corresponding column group.
+ The attribute should not be specified if the cell corresponds to a base (not total) column.
+
+
+
+
+
+
+
+
+ Crosstab header or data cell contents.
+
+ There are some restrictions/rules regarding crosstab cells:
+
+ - Subreports, crosstabs and charts are not allowed.
+ - Delayed evaluation for text fields and images is not allowed.
+ - Cells cannot split on multiple pages.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Crosstab cell background color.
+
+ The cell is filled with the background color only if the cell has opaque mode.
+
+
+
+
+
+ Crosstab cell transparency mode.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name of the report level style to use (see style element).
+
+ The style is only used for cell background and borders and is not inherited by elements inside the cell.
+
+
+
+
+
+
+
+
+ Crosstab cell that will be rendered when no data was fed to the crosstab.
+
+ If this cell is not specified for a crosstab, nothing will be rendered for an empty crosstab.
+
+ The cell size is the same as the crosstab element size.
+
+
+
+
+
+
+
+
+
+
+
+ A frame is a report element that contains sub elements. It has a backgroud, a border and it stretches to accommodate its content.
+
+ For the Graphics2D and PDF exporters, a frame is equivalent to a rectangle placed behind a group of elements.
+ The HTML exporter creates sub-tables for frames and the XLS exporter includes the frame sub elements into the grid.
+
+ For elements inside a frame, the coordinates, positionType and stretchType properties and relative to the frame instead of the band.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the way the frame border is to be drawn when the frame element splits.
+
+
+
+
+
+ When the frame splits, the bottom border of the first fragment and the top border of the second fragment are not drawn.
+
+
+
+
+ When the frame splits, both fragments are drawn will borders and paddings on all sides.
+
+
+
+
+
+
+
+
+
+
+ Defines a gantt chart
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines an gantt type dataset
+
+
+
+
+
+
+
+
+
+
+
+ Defines a gantt series for a ganttDataset
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the expression used to determine tasks in a ganttSeries.
+
+
+
+
+
+
+
+ Specifies the expression used to determine subtasks in a ganttSeries.
+
+
+
+
+
+
+
+ Specifies the expression used to determine the percent in a ganttSeries.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates the specific <valueExpression> tag for generic element parameters. Unlike other <valueExpression> elements, it contains a class attribute.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class of the bucket values.
+
+
+
+
+ The bucket order type.
+
+
+
+
+
+ The buckets will be sorted in ascending order by using the specified comparator or by the natural order if no comparator specified.
+
+
+
+
+ The buckets will be sorted in descending order by using the specified comparator or by the natural order if no comparator specified.
+
+
+
+
+ No sorting of bucket values will be performed, the buckets will show in the order the values come from the dataset.
+
+
+
+
+
+
+
+
+
+
+
+
+ Name of the bucket property.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+