jquery - jquery 数据表 - csv 导出列显示空值
问题描述
我必须将包含 33 列的数据库表中的一些值导出到 CSV 文件中。我使用了数据表。
我必须将(33 列)的所有值显示为一列(必需格式)。我将所有值连接成一个字符串并将其显示到一个数据表列。我必须保留其他列,否则数据表功能不起作用。但在导出 CSV 文件后,空白列显示为null
. 我想null
用空白替换。我应该怎么办?
我的 Java 结束代码
String sql = "select outletcode,remfname,remitt_id_details,dob,traninfomal.nationality as nationality,address1,remitt_tel,traninfomal.occupation as occupation,"
+ "rememployername,bofullname,remiter_type,boidnumber,bodob,bonationality,boaddress,benename,BENE_IDENTIFICATION_NO,tranno,traninfomal.entereddatetime,"
+ "transtatus,REMAMOUNTDEST,RATEVALUE,REMAMOUNTSOURCE,commission,traninfomal.purpose as purpose,sourceincome,beneaccountno,remrel,TRANTOTALPAY from traninfomal, agrani_membersmal \n" +
" where remid = member_id and traninfomal.entereddatetime between '"+userdate+"' and '"+userdate1+"' and transtatus in ('2' ,'3') ";
trandataind = jdbcTemplate.query(sql,new BeanPropertyRowMapper<XXX>(XXX.class));
<div class="container" style="padding: 10px 10px;">
<h1>Export Data into CSV,EXCEL,PDF & PRINT</h1>
<table id="listing" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>1</th>
<th>2</th>
<th>3Customer Name</th>
<th>4Customer ID</th>
<th>5Date of Birth</th>
<th>6Nationality</th>
<th>7Address</th>
<th>8Contact Number</th>
<th>9Occupation</th>
<th>10Name of employer</th>
<th>11BO Name</th>
<th>12Type of Customer</th>
<th>13BO ID</th>
<th>14BO Date of Birth</th>
<th>15BO Nationality</th>
<th>16BO Address</th>
<th>17Receiver name</th>
<th>18Receiver id</th>
<th>19Receipt no</th>
<th>20Transaction Date & Time</th>
<th>21tran status</th>
<th>22E channel</th>
<th>23 IP </th>
<th>24 BDT Net Amount</th>
<th>25 Foreign Currency Amount</th>
<th>26 Rate </th>
<th>27remamountsrc</th>
<th>28 Charges</th>
<th>29 Purpose</th>
<th>30 source of fund</th>
<th>31 destination country</th>
<th>32 bank account</th>
<th>33 bank account</th>
</tr>
</thead>
</table>
var metadata;
metadata = "16328|" + outletcode + "|" + remfname + "|" + remitt_id_details + "|" + dob + "|" + nationality + "|" + remaddress1 + "|" + remitt_tel + "|" + occupation + "|" + rememployername + "|" + bofname + "|" + remiter_type + "|" + boid + "|" + bodob + "|" + bonationality + "|" + boaddress + "|" + benename + "|" + BENE_IDENTIFICATION_NO + "|" + tranno + "|" + entereddatetime + "|" + transtatus + "|" + "" + "|" + "" + "|BDT|" + remamountdest + "|" + ratevalue + "|" + remamountsource + "|" + commission + "|" + purpose + "|" + sourceincome + "|BD|" + beneaccountno + "|" + remrel;
arrayReturn.push([metadata]);
inittable(arrayReturn);
解决方案
推荐阅读
- java - 从@WebServlet urlPattern 中删除起始“/”会导致所有 servlet 出现 404
- laravel - Laravel HasManyThrough 与关系
- python - 如何更改 sklearn 高斯过程回归使用的优化函数中的 max_iter?
- php - 循环遍历多维数组,拆分并将结果写入文件
- python - Python 多元线性回归无法绘图
- node.js - Materialze CSS 模态未显示在 node.js 中
- r - 在 Shiny 反应式表达式中访问环境哈希时出错。错误消息:获取错误:第一个参数无效
- javascript - 将数组从控制器传递到 Ajax
- function - 致命错误:未捕获的错误:在 null 上调用成员函数 get()
- ruby-on-rails - has_many的Rails嵌套形式:通过关联