服务器管理 > 报告 > 高级报告脚本写入 > 导出和导入报告模板
导出和导入报告模板
较早的报告是使用报告模板而非报告脚本创建的。报告模板仍是报告框架的一部分,用作脚本和所显示报告之间的中间步骤。
模板存储在数据库中,您可使用 CLI 查看。随后,您可使用已提取的模板从 CLI 创建报告。报告模板创建的报告无法通过报告向导读取或使用。您必须在文本编辑器中编辑代码,以使其可兼容。除非您有特殊需要,否则 PTC 不建议从报告模板创建报告。
以下示例介绍了如何从现有报告 (Report Recipe - Basic) 导出报告模板,然后使用该报告模板创建新报告:
1. 导出 Report Recipe - Basic 报告的模板:
im viewreport "Report Recipe - Basic" > basic_report.txt
2. 使用 im viewreport 命令的输出创建新报告:
a. 移除 basic_report.txt 文件中 <HTML> 标记上方和 </HTML> 标记下方的所有文本。
b. 保存您的更改。
3. 运行以下命令:
im createreport --reportTemplateFile="basic_report.txt"
--name="Report Recipe – Report Template Report"
-–query="All Items" -–sharedAdmin
Windchill RV&S 管理客户端 中创建了一个新的报告,名为 Report Recipe - Report Template Report
4. Windchill RV&S 管理客户端 中,运行 Report Recipe - Report Template Report
该报告看上去与 Report Recipe Training – Basic 报告完全相同。
5. Windchill RV&S 管理客户端 中,编辑 Report Recipe - Report Template Report
报告编辑器不显示报告向导,而是显示如下内容:
6. 单击“模板”选项卡。
7. 要更新报告,请编辑 HTML 和报告标记,并保存报告。
这对您有帮助吗?