Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 如何正确地将图像插入带有URL的BIRT报告中?_Eclipse_Image_Url_Report_Birt - Fatal编程技术网

Eclipse 如何正确地将图像插入带有URL的BIRT报告中?

Eclipse 如何正确地将图像插入带有URL的BIRT报告中?,eclipse,image,url,report,birt,Eclipse,Image,Url,Report,Birt,我使用Eclipse中的URL将一个来自web的图像插入到BIRT报告中,但它不起作用。它在布局屏幕上显示一个红色的X,如果我选择Run/View Report/As PDF,它会显示“此报告项的资源不可访问” 这里有什么问题?我在谷歌上搜索了几个小时,但什么也没找到 提前感谢您的帮助 尝试从web添加可通过浏览器访问的图像。这样,您就可以确保通过URI访问图像时不会出现问题 例如,添加此URL http://hajduk.hr/sadrzaj/slike-za-vijesti/640x320/

我使用Eclipse中的URL将一个来自web的图像插入到BIRT报告中,但它不起作用。它在布局屏幕上显示一个红色的X,如果我选择Run/View Report/As PDF,它会显示“此报告项的资源不可访问”

这里有什么问题?我在谷歌上搜索了几个小时,但什么也没找到


提前感谢您的帮助

尝试从web添加可通过浏览器访问的图像。这样,您就可以确保通过URI访问图像时不会出现问题

例如,添加此URL

http://hajduk.hr/sadrzaj/slike-za-vijesti/640x320/2010-06-08-jerkovic.jpg
您可以在报告中看到图像:

将图像作为嵌入图像包含在报告文件中的其他方法。在这个片段上

您可以查看如何将图像添加到报告文件中。完成后,将显示小红色图标的图像元素与嵌入的图像绑定。通过双击报告上的图像元素并从弹出的对话框中选择嵌入图像来执行此操作

从第二个代码片段中,您可以看到,您可以包含来自共享资源的图像,如果您有更多具有相同图像的报告,这会很方便。例如,客户的徽标、公司徽标等

Using Dynamic Images in Birt Report


对不起,我误解了你的问题,我会在短时间内编辑我的答案谢谢你的回答。我照你的建议做了,但还是没有成功。我能够显示在本地主机服务器上生成的图像,但不能显示来自web的图像。事实证明,代理设置是错误的。再次感谢邻居:)
Steps:

1) Create class

class BirtReport {
   public byte[] imageLogo;
}

2) Convert your image into bytes

public byte[] readImagesBytes(String url) {
     byte[] imageBytes = new byte[5024];
     try {
            // Apachae IOUtils
            imageBytes = IOUtils.toByteArray(new URL(url));
     } catch (IOException e) {
            imageBytes = new byte[0];
     }

     return imageBytes;
}

BirtReport birtReport = new BirtReport();
birtReport.imageLogo = readImagesBytes("http://www.underconsideration.com/brandnew/archives/google_2015_logo_detail.png");


3) In the Birt Report create Data Set

   BirtReportData with Blog type of imageLogo


Create the Data Set with imageLogo of Blog Data Type in Birt Report. Convert the image into bytes from server side. 
I have solved "The resource of this report item is not reachable" error