Как я могу отобразить содержание сайта в моем JasperReport - PullRequest
0 голосов
/ 27 января 2020

Я пытаюсь показать содержимое со страницы c в моем JasperReport. (например, example.com) Я не очень хорошо разбираюсь с Java и пробовал много разных способов, которые я нашел, когда гуглил проблему, и мой текущий компонент выглядит так:

<componentElement>
    <reportElement x="0" y="0" width="555" height="100" uuid="e7a90334-4743-440a-a7ad-bfb496cac4df"/>
    <hc:html xmlns:hc="http://jasperreports.sourceforge.net/htmlcomponent" xsi:schemaLocation="http://jasperreports.sourceforge.net/htmlcomponent http://jasperreports.sourceforge.net/xsd/htmlcomponent.xsd" scaleType="RetainShape" horizontalAlign="Left" verticalAlign="Middle">
        <hc:htmlContentExpression><![CDATA[new java.util.Scanner(new java.io.BufferedReader(new java.io.InputStreamReader(new java.net.URL("htts://example.com").openConnection())))]]></hc:htmlContentExpression>
    </hc:html>
</componentElement>

Но я получаю следующую ошибку:

Error during report execution net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: new java.util.Scanner(new java.io.BufferedReader(new java.io.InputStreamReader(new java.net.URL("https://example.com").openConnection())))

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...