VelocityReport getPDFReport

Hi

When creating a PDF with the VelocityReport plugin, I notice, that the template is not rendered correctly when created from within the developer. Any idea, what could be the problem?

When deployed (WAR file, same plugin though, same template), the PDF is correct and displays the diagram and resolves variables ($!diagramTitle).

When created from within the developer, a text variable is resolved but the internal CSS is displayed as text and the diagram is missing. I checked the plugin properties on admin page, used localhost, 127.0.0.1 and IP address. Nothing helped. What could be the reason?

Thanks for any help and regards
Birgit

You say the diagram is missing… perhaps all you need in developer is to add the eastwood.war to your /application_server/server/webapps?

Have you setup your velocityreport.serverURL and velocity.eastwoodURL in servoy-admin to http://localhost:[yourport]/ and http://localhost:[yourport]/eastwood/ respectively?

Hi Patrick

Thank you for the reply.

I double checked the eastwood.war. It is installed under server/webapps.

And the properties are set as follows. What do we miss?

Thank you and regards
Birgit

Hi Birgit,

This looks correct if the port you are using in developer is 8184.

I would need to know more:

  • What version of Servoy? Of Java? OS?

  • You said the CSS is “displayed as text”. What do you mean? How do you embed the CSS? Directly inline in the template with a tag? As a href? With an #include or #parse directive?

  • The diagram is missing: How is it resolved in the html produced by the Velocity filling? - one thing that often helps is to debug the result of plugins.VelocityReport.renderTemplate(template, context) and output this to a file to check what the html that will be used to produce the PDF looks like once evaluated by Velocity, with the variables filled.

Let me know more, so that I can help.

Hi Patrick

Thank you for your help.

  • Port in developer is 8184.
  • Versions:
    • Servoy 2024.3.4.3947_LTS
    • Java 1.8.0_401
    • macOS Sonoma 14.7.3
  • See the attached PDF to see, what is meant with “CSS displayed as text”.
  • The generated diagram of type net.stuff.servoy.plugin.velocityreport.charts.ChartWrapper has the following string representation and can be embedded in an html file and will be displayed correctly:
    <img src="http://localhost:8184/eastwood/chart?chbh=r&amp;cht=bvg&amp;chxt=y,x&amp;chs=1000x480&amp;chd=t%3A53.0%7C21.0%7C20.0%7C8.0%7C5.0%7C6.0%7C15.0%7C6.0%7C34.0%7C217.0%7C284.0%7C102.0&amp;chxl=0%3A%7C0%7C284%7C1%3A%7CF%7CF-GN%7CF-KI%7CFM-G%7CFM-K%7CFM-N%7CFM-P%7CFM-S%7CF-SP%7CM%7CN%7CS&amp;chco=6B8E8E,B58A60,8FA382,B97A7A,A89ABF,A08373,C5A0B1,9D9D9D,A9B16D,6FA7B5,805D5D,D1B76A&amp;chdl=F%3A+53%7CF-GN%3A+21%7CF-KI%3A+20%7CFM-G%3A+8%7CFM-K%3A+5%7CFM-N%3A+6%7CFM-P%3A+15%7CFM-S%3A+6%7CF-SP%3A+34%7CM%3A+217%7CN%3A+284%7CS%3A+102&amp;chds=0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0,0.0,284.0&amp;ewr=1" border="0" class="chart" width="1000" height="480"></img>
  • I also attach the template (as image, since I do not find a file opload).

Best regards
Birgit