bengbengbalabalabeng commented on issue #773:
URL: https://github.com/apache/fesod/issues/773#issuecomment-3719037087

   Below is a minimal reproducible example for reading the 
[questionTemplate.xlsx](https://github.com/user-attachments/files/24462479/questionTemplate.xlsx)
 file you provided.
   
   Environment:
   
   - Java version: 17
   - FastExcel: 1.3.0
   
   <details>
   <summary>View full code</summary>
   
   Model
   
   ```java
   @EqualsAndHashCode
   @Data
   public class QuestionExcel {
   
       @ExcelProperty(value = "题目", index = 0)
       private String question;
   
       @ExcelProperty(value = "类型", index = 1)
       private String type;
   
       @ExcelProperty(value = "难易度", index = 2)
       private String difficulty;
   
       @ExcelProperty(value = "选项A(正确)", index = 3)
       private String optionA;
   
       @ExcelProperty(value = "选项B(错误)", index = 4)
       private String optionB;
   
       @ExcelProperty(value = "选项D", index = 5)
       private String optionD;
   
       @ExcelProperty(value = "选项C", index = 6)
       private String optionC;
   
       @ExcelProperty(value = "选项E", index = 7)
       private String optionE;
   
       @ExcelProperty(value = "选项F", index = 8)
       private String optionF;
   
       @ExcelProperty(value = "选项G", index = 9)
       private String optionG;
   
       @ExcelProperty(value = "选项H", index = 10)
       private String optionH;
   
       @ExcelProperty(value = "选项I", index = 11)
       private String optionI;
   
       @ExcelProperty(value = "选项J", index = 12)
       private String optionJ;
   
       @ExcelProperty(value = "选项K", index = 13)
       private String optionK;
   
       @ExcelProperty(value = "选项L", index = 14)
       private String optionL;
   
       @ExcelProperty(value = "选项M", index = 15)
       private String optionM;
   
       @ExcelProperty(value = "选项N", index = 16)
       private String optionN;
   
       @ExcelProperty(value = "选项O", index = 17)
       private String optionO;
   
       @ExcelProperty(value = "选项P", index = 18)
       private String optionP;
   
       @ExcelProperty(value = "选项Q", index = 19)
       private String optionQ;
   
       @ExcelProperty(value = "选项R", index = 20)
       private String optionR;
   
       @ExcelProperty(value = "选项S", index = 21)
       private String optionS;
   
       @ExcelProperty(value = "选项T", index = 22)
       private String optionT;
   
       @ExcelProperty(value = "解析", index = 23)
       private String parse;
   
       @ExcelProperty(value = "正确答案", index = 24)
       private String answer;
   
       @ExcelProperty(value = "分数", index = 25)
       private String score;
   }
   ```
   
   Demo
   
   ```java
   class Issues773Demo {
   
       private static final String QA_TEMPLATE = "questionTemplate.xlsx";
   
       public static void main(String[] args) {
           FastExcelUploadDataListener listener = new 
FastExcelUploadDataListener();
   
           FastExcel.read(QA_TEMPLATE, QuestionExcel.class, listener)
                   .ignoreEmptyRow(false)
                   .sheet()
                   .doRead();
           List<QuestionExcel> list = listener.getList();
   
           System.out.println("In Row-5, OptionC should contain an embedded 
image formula string: " + list.get(3).getOptionC());
           System.out.println("In Row-5, OptionE should be null (floating 
image): " + list.get(3).getOptionE());
           System.out.println("In Row-7, OptionE should be null (floating 
image): " + list.get(5).getOptionA());
           System.out.println("In Row-8, OptionA should contain an embedded 
image formula string: " + list.get(6).getOptionA());
           System.out.println("In Row-8, OptionD should be null (floating 
image): " + list.get(6).getOptionD());
           System.out.println("In Row-11, OptionA should be null (floating 
image): " + list.get(9).getOptionA());
           System.out.println("In Row-26, OptionA should contain an embedded 
image formula string: " + list.get(24).getOptionA());
           System.out.println("In Row-26, OptionD should contain an embedded 
image formula string: " + list.get(24).getOptionD());
       }
   
       private static class FastExcelUploadDataListener extends 
AnalysisEventListener<QuestionExcel> {
           private final List<QuestionExcel> list = new ArrayList<>();
   
           @Override
           public void invoke(QuestionExcel data, AnalysisContext context) {
               list.add(data);
           }
   
           @Override
           public void doAfterAllAnalysed(AnalysisContext context) {}
   
           public List<QuestionExcel> getList() {
               return list;
           }
       }
   
   }
   ```
   
   </details>
   
   
   
   Output:
   
   <img width="1137" height="214" alt="Image" 
src="https://github.com/user-attachments/assets/432f5a7b-3d3b-4cff-9c38-26b3ad97d11f";
 />
   
   - Embedded images are read as formula strings.
   - Floating images result in NULL.
   
   In this minimal example, the issue “all image fields are null” cannot be 
reproduced.
   
   > 我打断点查看并没有看见如(=DISPIMG("ID_*****", 1))这样或其他的字符串公式,对应的字段上的值是null


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to