java - 如何在 CSV jasper-reports 6.5 中将逗号切换为分号
问题描述
我通过 jasper-reports 导出 CSV 文件。它工作正常,但我想将逗号切换为分号。我找到了一些解决方案,但已被弃用。我在 SimpleCsvReportConfiguration 中寻找一种没有快乐结局的方法。有人可以帮忙吗?
JRCsvExporter exporter = new JRCsvExporter();
exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrints));
exporter.setExporterOutput(new SimpleWriterExporterOutput(response.getOutputStream()));
SimpleCsvReportConfiguration configuration = new SimpleCsvReportConfiguration();
exporter.exportReport();
解决方案
您应该将其添加到您的 .jrxml 文件中:
<property name="net.sf.jasperreports.export.csv.field.delimiter" value=";"/>
推荐阅读
- html - 使用时 Ng-hide 不起作用标签在一起
- php - 我创建的数据库中的结果不会出现在 wordpress 中。
- scala - 无法解析 Spark 中的符号 sqlcontext
- c - SIGCHLD 在父进程中导致 EOF
- swift - 如何在 Swift 中使用 strstr 在字符串中搜索字符串?
- xamarin.forms - Xamarin Forms Android 导航栏向下移动
- python - 特定条件下的最短路径问题
- c++ - QOpenGLWidget 多进程视频渲染性能
- oracle - 在 SQL Developer 中保存工作表
- html - Angular 和 Typescript 发送帖子请求