Skip to content

Commit

Permalink
update manual document
Browse files Browse the repository at this point in the history
  • Loading branch information
mark.yky committed Sep 5, 2018
1 parent 4459d65 commit 01b0230
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 16 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ EasyReport是一个简单易用的Web报表工具,它的主要功能是把SQL语
* 数据访问采用mybatis框架,方便二次开发
* 报表展现支持自定义生成模板

## [2.0用户参考][]
## [1.0用户参考][]
## [入门手册][]
## [用户参考][]
## 捐助
您的热情,我的动力!开源是一种精神,也是一种生活...

![支付宝][]

[1.0用户参考]: https://github.com/xianrendzw/EasyReport/blob/master/docs/manual/version1_0.md
[2.0用户参考]: https://github.com/xianrendzw/EasyReport/blob/master/docs/manual/version2_0.md
[入门手册]: https://github.com/xianrendzw/EasyReport/blob/master/docs/manual/user-guide.md
[用户参考]: https://github.com/xianrendzw/EasyReport/blob/master/docs/manual/version2_0.md
[支付宝]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/alipay-code.png
Binary file added docs/assets/imgs/column-select.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/imgs/date-select.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/imgs/dem-select-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/imgs/dem-select-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/imgs/set-sort-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/imgs/set-sort-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 36 additions & 1 deletion docs/manual/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,35 @@ select area, year(dt), quality, pm25, pm10, o3 from fact_air_cn where area='北
这样,一份报表就做好了。


### 4 高级功能介绍:

#### 1 数值列可选
只选择感兴趣的数值列,让有限的页面空间显示更多我们感兴趣的内容
![column-select][]

#### 2 加入维度筛选
针对一个或多个维度列,生成下拉选择框,只显示感兴趣的维度列。
![dem-select-1][]

上面的城市选项,需要在“查询参数”tab下设置,而且下拉框的内容可以从数据库里查出来,也可以自己按照name1,text1|name2,text2|... 格式输入。
同时sql语句里要加上对应的筛选项名,比如:where area in ('${area}')
![dem-select-2][]

#### 3 加入日期筛选
报表的内容一般每天都会更新,所以日期的筛选很重要,本工具内置了startTime(七天前),endTime(今天)两个变量,可以很方便地滚动查看前7天的数据表内容。
Sql语句里也要加上对应的筛选项名,比如:where dt > '${startTime}' and dt < '${endTime}',
startTime,endTime是内置参数,不需要想配置城市筛选项那样定义值
![date-select][]

#### 4 报表的另一个重要方面是排序方式,按需排序后可以方便地发现重要信息
在设计报表页面,每一列都有排序方式设置,比如我想按照自己的顺序对城市名称进行排序,可以这么操作:
![set-sort-1][]
显示的报表如下:
![set-sort-2][]
#### 5 通过报表右上角的图标,点击即可导出excel文件



[jdk1.8]: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
[jre1.8]: http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
[maven3]: http://maven.apache.org/download.cgi
Expand Down Expand Up @@ -89,4 +118,10 @@ select area, year(dt), quality, pm25, pm10, o3 from fact_air_cn where area='北
[report-ex1]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/report-ex1.jpg
[design-1]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/design-1.jpg
[design-2]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/design-2.jpg
[design-3]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/design-3.jpg
[design-3]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/design-3.jpg
[column-select]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/column-select.jpg
[dem-select-1]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/dem-select-1.jpg
[dem-select-2]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/dem-select-2.jpg
[date-select]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/date-select.jpg
[set-sort-1]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/set-sort-1.jpg
[set-sort-2]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/set-sort-2.jpg
4 changes: 4 additions & 0 deletions easyreport-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,9 @@
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.easytoolsoft.easyreport.engine.util;

import java.util.Map;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.templatemode.TemplateMode;
import org.thymeleaf.templateresolver.StringTemplateResolver;

public class ThymeleafUtils {
private static TemplateEngine TEMPLATE_ENGINE = null;

/**
* 替换的模板中的参数
*
* @param template
* @param parameters
* @return 替换后的文本
*/
public static String parse(final String template, final Map<String, Object> parameters) {
final org.thymeleaf.context.Context ctx = new org.thymeleaf.context.Context();
ctx.setVariables(parameters);
return getThymeLeafTemplate().process(template, ctx);
}

public static TemplateEngine getThymeLeafTemplate() {
if (TEMPLATE_ENGINE == null) {
TEMPLATE_ENGINE = new TemplateEngine();
// Resolver for String
StringTemplateResolver templateResolver = new StringTemplateResolver();
templateResolver.setTemplateMode(TemplateMode.TEXT);
TEMPLATE_ENGINE.addTemplateResolver(templateResolver);
return TEMPLATE_ENGINE;
} else {
return TEMPLATE_ENGINE;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ public static void exportToExcel(final String uid, final String name, String htm
response.reset();
response.setHeader("Content-Disposition", String.format("attachment; filename=%s", fileName));
response.setContentType("application/vnd.ms-excel; charset=utf-8");
response.addCookie(new Cookie("fileDownload", "true"));
//response.addCookie(new Cookie("fileDownload", "true"));
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
//out.write(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF}); // 生成带bom的utf8文件
out.write(htmlText.getBytes());
out.flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var PreviewMainMVC = {
var tableUrl = juicer(PreviewMainMVC.URLs.table.url, {uid: uid});
var chartUrl = juicer(PreviewMainMVC.URLs.chart.url, {uid: uid});
PreviewMainMVC.Controller.updateTab('表格', tableUrl, TableReport.init);
PreviewMainMVC.Controller.updateTab('图表', chartUrl, ChartReport.init);
// PreviewMainMVC.Controller.updateTab('图表', chartUrl, ChartReport.init);
}
},
Controller: {
Expand Down
12 changes: 6 additions & 6 deletions easyreport-web/src/main/resources/templates/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
</div>
</div>
</div>
<div region="south" class="footer">
<div id="footer-left">
<div>EasyReport(v2.1)</div>
</div>
<div id="footer-right">Copyright © 2017 www.easytoolsoft.com</div>
</div>
<!--<div region="south" class="footer">-->
<!--<div id="footer-left">-->
<!--<div>EasyReport(v2.1)</div>-->
<!--</div>-->
<!--<div id="footer-right">Copyright © 2017 www.easytoolsoft.com</div>-->
<!--</div>-->
</div>
<!-- tabs右键菜单 -->
<div id="main-tab-ctx-menu" class="easyui-menu" style="width: 120px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<script src="../../static/vendor/jquery.fileDownload.js" th:src="@{/vendor/jquery.fileDownload.js}"></script>
<script src="../../static/vendor/jquery.fixtableheader.js" th:src="@{/vendor/jquery.fixtableheader.js}"></script>
<script src="../../static/vendor/echarts.min.js" th:src="@{/vendor/echarts.min.js}"></script>
<script src="../../static/js/report/themes/content/chart.js"
th:src="@{'/js/report/themes/content/chart.js?v='+${version}}"></script>
<!--<script src="../../static/js/report/themes/content/chart.js"-->
<!--th:src="@{'/js/report/themes/content/chart.js?v='+${version}}"></script>-->
<script src="../../static/js/report/themes/content/table.js"
th:src="@{'/js/report/themes/content/table.js?v='+${version}}"></script>
<script src="../../static/js/report/display.js" th:src="@{'/js/report/display.js?v='+${version}}"></script>
Expand All @@ -23,7 +23,7 @@
<div region="center" style="border-top-width: 0">
<div id="report-main-tabs" class="easyui-tabs" border="false" fit="true">
<div title="表格" data-options="iconCls:'icon-table'"></div>
<div title="图表" data-options="iconCls:'icon-chart4'"></div>
<!--<div title="图表" data-options="iconCls:'icon-chart4'"></div>-->
<input id="report-main-uid" type="hidden" name="uid" th:value="${report.uid}"/>
</div>
</div>
Expand Down

0 comments on commit 01b0230

Please sign in to comment.