I am just beginning to use the velocity report plugin, in ver 5.2.4, what am doing wrong in the code below ?
function onAction() {
html = plugins.VelocityReport.renderTemplate("inventory.xhtml",getReportContext(),300);
application.output(html);
var viewer = plugins.VelocityReport.previewReport("inventory.xhtml",getReportContext());
}
I can see the html in the console now problems, but am I meant to see a preview window showing the report ? ,like “jasper reports” jrviewer ??, as nothing seems to happen.
There’s nothing wrong with what you are doing as far as I can see…
But I don’t know what getReportContext() does, and if the inventory.xhtml is found or not…
Also, is it smart or web client? And are you sure that the window is not showing underneath the main form window.
function getReportContext() {
// the context object will hold everything we want to output in our report:
var context = new Object();
var vQuery = 'Select \
inventory.part_type, \
Sum(inventory.stock_on_shelf) As qtyShlfSUM, \
Sum(inventory.value_on_shelf) As valueShlfSUM, \
Sum(inventory.sum_stock_com) As qtyComSUM,\
Sum(inventory.value_commited) As valueComSUM, \
Sum(inventory.stock_on_hand) As qtyHandSUM, \
Sum(inventory.value_on_hand) As valueHandSUM, \
Sum(inventory.sum_stock_ord) As qtyOrdSUM, \
Sum(inventory.value_on_order) As valueOrdSUM \
From \
inventory \
Group By \
inventory.part_type with rollup '
// we can put datasets:
context.dataset = databaseManager.getDataSetByQuery(
"austube_server",
vQuery,
null,
-1
)
context.previewBounds = {x: -1, y: -1, w: 600, h: 720};
return context;
}
I can see the rendered report in a html_area on a form using the first part of the method as below, so would it be safe to assume that the report is being found ?
html = plugins.VelocityReport.renderTemplate("inventory.xhtml",getReportContext(),300);
Don’t know what’s happening with you guys…
Just tried with Windows 7 (64-bit) - Java 1.6.0_23 on a brand new Servoy 5.2.4 install and it worked fine here.
Maybe there is a jar incompatibility? That’s the only thing I can imagine right now…
Could you tell me what you have in /application_server/plugins/velocityreport/ folder? I have updated the velocity jars so maybe you have 2 version there, and maybe you have some jar clash with some other plugins???
This is how it appears for me with the sample solution (no tricks!):
[attachment=0]velocityEditor.png[/attachment]
Just tried again with a clean install. No luck. I noticed however that some tables in use by the sample code are not created (like country_types), because no form or whatever is based on them. Maybe that is part of the problem? Anyway, isn’t it strange that the html is created? Also, the PDF in the webclient is created, but not in the smart client. Isn’t there any log file created by the plugin that I can look at?
Found it! The problem is two libraries I ship with the XML plugin. It seems that velocity uses some XML libraries server side and is not happy with mine that probably load first. Will investigate further…
could you tell me what lib and what version?
This problem of jar hell is something that we need to find a solution for…
People are using more and more plugins and beans and this is getting more and more of a problem.
Personally, I really think there should be some kind of central repository, just like maven does.
Probably Servoy could host a central of library (that they would sign) and we could then link to it using extensions in our jnlp?
What do you think?
And what does Servoy thinks about it?
Sounds like a good idea to me!
We are using plugins of different suppliers and as they add up the chance we will end up having this kind of conflicts is getting bigger.
So yes please investigate what can be possible.
I’m sure Paul can talk R&D getting it into v6
Is there something I can do in the mean time to make this work ?, I currently do not use your xml plugin so can it be removed or is it needed as part of the following beans/plugins I do use ?
ptalbot:
This problem of jar hell is something that we need to find a solution for…
People are using more and more plugins and beans and this is getting more and more of a problem.
Personally, I really think there should be some kind of central repository, just like maven does.
Probably Servoy could host a central of library (that they would sign) and we could then link to it using extensions in our jnlp?
Servoy: Is this a feature request?
To do what Patrick suggests is even more significant since Servoy is now Open Source, and Servoy (the company) and the its ecosystem are encouraging plugin’s development. (e.g. ServoyForge)