Build a Rich Excel Report with ZK Spreadsheet and Database"
(Created page with '{{ZKSpreadsheetEssentialsPageHeader}} __TOC__ ZK Spreadsheet APIs support importing Excel file and exporting to PDF file, copying and pasting cells, and updating values. With a…') |
|||
Line 26: | Line 26: | ||
===ZUML Example=== | ===ZUML Example=== | ||
<source lang="xm"> | <source lang="xm"> | ||
− | + | <window id="reportwin" apply="demo.genreport.ReportComposer" vflex="1"> | |
+ | <button label="Generate the report" onClick="reportwin$composer.generate();"/> | ||
+ | <spreadsheet id="report" src="/genreport.xls" maxrows="40" maxcolumns="8" vflex="1" width="100%"/> | ||
+ | </window> | ||
</source> | </source> | ||
Revision as of 01:53, 19 November 2010
ZK Spreadsheet APIs support importing Excel file and exporting to PDF file, copying and pasting cells, and updating values. With all these capabilities plus versatile formula functions provided make it a perfect tool to generate a rich enterprise level report. You can either view(or even do some after editing) the report on the browser and/or print it into PDF later.
Purpose
Combine ZK Spreadsheet with a back end database to generate a rich report.
Template Excel File with Proper Styles
Construct an Excel template file with proper formulas and styles for header in ReportSheet and row in TemplateSheet.
Generate Report
Use ReportSheet as Report showing page, and TemplateSheet as Row template sheet plus some control variables.
The operation is straightforward:
- Load data list from the back-end database.
- Per the number of the retrieved data, copy row template from TemplateSheet to ReportSheet.
- Fill in data to each row on the ReportSheet.
- There you go!
ZUML Example
<window id="reportwin" apply="demo.genreport.ReportComposer" vflex="1">
<button label="Generate the report" onClick="reportwin$composer.generate();"/>
<spreadsheet id="report" src="/genreport.xls" maxrows="40" maxcolumns="8" vflex="1" width="100%"/>
</window>
Version History
Version | Date | Content |
---|---|---|
All source code listed in this book is at Github.