本帖最后由 Clark.Pan 于 2023-12-13 09:59 编辑
产品:Spreadjs
版本:6.2.1
问题编号:SJS-21512
最新进展:计划将于V7.0.1版本进行修复
LastReview:2023-12-13
问题:ssjson转为sjs后格式错乱,新增行次出现线条边框
复现步骤:
将附件ssjson通过如下代码转换为sjs,其中有新增行次操作
- <div style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9.0pt;"><pre><div class="blockcode"><blockquote>public void test(@RequestParam("file") MultipartFile file, HttpServletResponse response) throws Exception {
- ByteArrayInputStream stream = new ByteArrayInputStream(file.getBytes());
- Workbook workbook = new Workbook();
- Workbook.SetLicenseKey("test");
- workbook.setCulture(Locale.CHINESE);
- workbook.fromJson(stream);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- workbook.save(baos, SaveFileFormat.Sjs);
- byte[] reportDataSjs = baos.toByteArray();
- ByteArrayInputStream bais = new ByteArrayInputStream(reportDataSjs);
- Workbook workbookSjs = new Workbook();
- Workbook.SetLicenseKey("test");
- workbookSjs.setCulture(Locale.CHINESE);
- workbookSjs.open(bais, OpenFileFormat.Sjs);
- IWorksheet worksheet = workbookSjs.getWorksheets().get(0);
- IRange addedCell = worksheet.getRange(7, 1);
- addedCell.getEntireRow().insert();
- worksheet.getRange(7, 1).getEntireRow().setTag("test");
- byte[] toSjs = GcExcelHelper.toSjs(workbookSjs);
- response.reset();
- response.setContentType("application/octet-stream");
- response.setCharacterEncoding("utf-8");
- ServletOutputStream outputStream = response.getOutputStream();
- FileCopyUtils.copy(toSjs, outputStream);
- }
复制代码 sjs版本实在是bug超多,请主动排查并积极修复
|
|