cancel
Showing results for 
Search instead for 
Did you mean: 

JRC使用ByteArray打印图片无法打印

0 Kudos

使用12.2.229.4422版本的java runtime。

使用13.0.24.2970版本的crystal report for vs做的RPT。

通过以下方式导出pdf。图片没有显示。

            CrystalPrintDataDTO printDataDTO = new CrystalPrintDataDTO();
            File file = new File("/home/apphome/test.jpg");
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            BufferedImage bi = ImageIO.read(file);
            ImageIO.write(bi, "jpg", baos);
            printDataDTO.H1 = new ByteArray(baos.toByteArray());
            ......
            String tableAlias =
                    reportClientDoc.getDatabaseController().getDatabase().getTables().getTable(0).getAlias();
            reportClientDoc.getDatabaseController().setDataSource(
                    printDataCollection, CrystalPrintDataDTO.class, tableAlias, tableAlias);
<br>

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

And what does loading a JPG into a bytearray have to do with CR?

Can you paste in your original post in english?

Answers (2)

Answers (2)

0 Kudos

Check this KBA - Check KBA 3204578 for a Windows 11 specific OLE image issue and workaround.

0 Kudos
0 Kudos

Hi, thanks for your advice, and i have upgrade CR for VS to SP32,but problem remain.