找回密码
 立即注册

QQ登录

只需一步,快速开始

浅梦在枫叶间

注册会员

1

主题

3

帖子

10

积分

注册会员

积分
10
  • 30

    金币

  • 1

    主题

  • 3

    帖子

最新发帖
浅梦在枫叶间
注册会员   /  发表于:2023-5-11 19:24  /   查看:1263  /  回复:6
本帖最后由 JoestarXu 于 2023-5-15 11:33 编辑

image.png319737548.png 初始时 该单元格有时间下拉框, 调用 workbook.fromJson(stream); 然后 workbook.toJson(); 之后,该单元格时间下拉框丢失了 image.png601589049.png

6 个回复

倒序浏览
JoestarXu
超级版主   /  发表于:2023-5-12 10:41:17
沙发
你好,能否提供一下您的demo这边帮您调查一下。
回复 使用道具 举报
浅梦在枫叶间
注册会员   /  发表于:2023-5-12 10:54:53
板凳
JoestarXu 发表于 2023-5-12 10:41
你好,能否提供一下您的demo这边帮您调查一下。

您是需要这个表样的ssjson 还是 相关的代码
回复 使用道具 举报
JoestarXu
超级版主   /  发表于:2023-5-12 11:08:09
地板
您提供的信息越多,我们就能越早帮您解决,所以能够都提供的话就最好。
回复 使用道具 举报
浅梦在枫叶间
注册会员   /  发表于:2023-5-12 13:14:12
5#
本帖最后由 浅梦在枫叶间 于 2023-5-12 13:23 编辑
JoestarXu 发表于 2023-5-12 11:08
您提供的信息越多,我们就能越早帮您解决,所以能够都提供的话就最好。
  1. package com.admin.test;/**
  2. * 描述:
  3. *
  4. * @author admin
  5. * @date 2023/5/12 11:17
  6. */

  7. import com.grapecity.documents.excel.Workbook;
  8. import java.io.ByteArrayInputStream;
  9. import java.io.File;
  10. import java.io.FileInputStream;
  11. import java.io.FileReader;
  12. import java.io.FileWriter;
  13. import java.io.IOException;
  14. import java.io.InputStreamReader;
  15. import java.io.Reader;
  16. import java.util.Locale;
  17. import org.junit.Test;

  18. /**
  19. * @author wangdezhi
  20. * @data
  21. */
  22. public class TimeScopeTest {

  23.     @Test
  24.     public void test() throws Exception {

  25.         String ssJson = readJsonFile("D:\\chrome\\download\\c.ssjson");

  26.         ByteArrayInputStream stream = new ByteArrayInputStream(ssJson.getBytes());
  27.         Workbook workbook = new Workbook();
  28.         Workbook.SetLicenseKey(
  29.                 "your_key");
  30.         workbook.setCulture(Locale.CHINESE);
  31.         workbook.fromJson(stream);
  32.         writeJsonFile("D:\\chrome\\download\\b.ssjson", workbook.toJson());

  33.     }

  34.     public void writeJsonFile(String fileName, String json) {
  35.         try {
  36.             FileWriter writer = new FileWriter(fileName);
  37.             writer.write(json);

  38.             writer.close();
  39.         } catch (IOException ignore) {

  40.         }
  41.     }

  42.     public String readJsonFile(String fileName) throws IOException {
  43.         String jsonStr = "";
  44.         try {
  45.             File jsonFile = new File(fileName);
  46.             FileReader fileReader = new FileReader(jsonFile);
  47.             Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
  48.             int ch = 0;
  49.             StringBuffer sb = new StringBuffer();
  50.             while ((ch = reader.read()) != -1) {
  51.                 sb.append((char) ch);
  52.             }
  53.             fileReader.close();
  54.             reader.close();
  55.             jsonStr = sb.toString();
  56.             return jsonStr;
  57.         } catch (IOException e) {
  58.             return null;
  59.         }
  60.     }

  61. }
复制代码

c.zip

148.59 KB, 下载次数: 57

回复 使用道具 举报
JoestarXu
超级版主   /  发表于:2023-5-12 18:19:40
6#
问题已重现,这边调研一下,等问题有进展我再回复您,帖子先做保留处理。
回复 使用道具 举报
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-6-1 09:32:53
7#
您好,该Bug已在GCExcel 6.1.1版本修复。
SpreadJS 17.0.8 | GcExcel 7.1.1 已发布~
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部