https://github.com/cuba-platform/yarg-demo
Simple YARG library demo
https://github.com/cuba-platform/yarg-demo
java reporting reporting-engine yarg
Last synced: 2 months ago
JSON representation
Simple YARG library demo
- Host: GitHub
- URL: https://github.com/cuba-platform/yarg-demo
- Owner: cuba-platform
- Created: 2017-09-28T22:07:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-28T22:17:13.000Z (over 7 years ago)
- Last Synced: 2025-01-23T08:19:25.863Z (4 months ago)
- Topics: java, reporting, reporting-engine, yarg
- Language: Java
- Size: 62.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Simple YARG library demo
========================See main YARG repository: https://github.com/cuba-platform/yarg
Here we easily enable YARG using JCenter repository:
```
repositories {
jcenter()
}apply plugin: 'java'
dependencies {
compile 'com.haulmont.yarg:yarg:2.0.7'
}
```After that we can prepare report XML description, XLSX report template and run report using YARG:
```java
Report report = new DefaultXmlReader()
.parseXml(IOUtils.toString(IncomesDemo.class.getResource("/incomes-report.xml")));Reporting reporting = new Reporting();
reporting.setFormatterFactory(new DefaultFormatterFactory());
reporting.setLoaderFactory(new DefaultLoaderFactory()
.setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl())));ReportOutputDocument reportOutputDocument = reporting.runReport(
new RunParams(report), new FileOutputStream(resultFile));
```That's it!
Start demo:
> gradlew run
See template and result in ./work directory