# Velocity Report Question

**URL:** <https://forum.servoy.com/t/velocity-report-question/13527>\
**Category:** Classic Servoy\
**Created:** [February 5, 2011, 5:40am UTC](https://forum.servoy.com/t/velocity-report-question/13527 "2011-02-05T05:40:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wvitpr](https://avatars.discourse-cdn.com/v4/letter/w/e0b2c6/32.png) [@wvitpr](https://forum.servoy.com/u/wvitpr)\
**Post date:** [February 5, 2011, 5:40am UTC](https://forum.servoy.com/t/velocity-report-question/13527/1 "2011-02-05T05:40:07Z")

</div>

Hi,

I am just beginning to use the velocity report plugin, in ver 5.2.4, what am doing wrong in the code below ?

```auto
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.

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [February 5, 2011, 8:21am UTC](https://forum.servoy.com/t/velocity-report-question/13527/2 "2011-02-05T08:21:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wvitpr](https://avatars.discourse-cdn.com/v4/letter/w/e0b2c6/32.png) [@wvitpr](https://forum.servoy.com/u/wvitpr)\
**Post date:** [February 5, 2011, 8:57am UTC](https://forum.servoy.com/t/velocity-report-question/13527/3 "2011-02-05T08:57:58Z")

</div>

Hi Patrick,

getReportContext() // method used to get dataset

```auto
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 ?

```auto
html = plugins.VelocityReport.renderTemplate("inventory.xhtml",getReportContext(),300);

```

---

<div class="post-metadata">

**Author:** ![wvitpr](https://avatars.discourse-cdn.com/v4/letter/w/e0b2c6/32.png) [@wvitpr](https://forum.servoy.com/u/wvitpr)\
**Post date:** [February 5, 2011, 9:17am UTC](https://forum.servoy.com/t/velocity-report-question/13527/4 "2011-02-05T09:17:06Z")

</div>

Hi Patrick,

Just to add, I can see the report in web client nicely… but not in smart client ? using developer that is ?,

Also noticed that both the ‘Test viewer’, and ‘Test PDF’ button in the sample solution do nothing??.

Thanks

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [February 5, 2011, 10:09am UTC](https://forum.servoy.com/t/velocity-report-question/13527/5 "2011-02-05T10:09:48Z")

</div>

What version of Servoy do you use? What version of OS/Java?  
Do you have an error somewhere in your servoy\_log.txt?

I just tried ‘Test Viewer’ and ‘Test PDF’ and they both work fine here in Smart client.  
Even tried with Servoy 6 actually ![;)]( "Wink")

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [February 5, 2011, 10:26am UTC](https://forum.servoy.com/t/velocity-report-question/13527/6 "2011-02-05T10:26:17Z")

</div>

I am having the same problem. What works is

1. PDF in the webclient
2. HTML output in either web or smart client

What does not work is

1. Viewer in any client
2. PDF in the smart client

I get no error anywhere. I am just using the sample solution and have installed everything properly as far as I can see.

The code “breaks” at viewer = plugins…preview

The debugger just stops there, but no error is thrown.

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [February 5, 2011, 10:37am UTC](https://forum.servoy.com/t/velocity-report-question/13527/7 "2011-02-05T10:37:41Z")

</div>

What version of the plugin?  
What Servoy/OS/Java version?

---

<div class="post-metadata">

**Author:** ![wvitpr](https://avatars.discourse-cdn.com/v4/letter/w/e0b2c6/32.png) [@wvitpr](https://forum.servoy.com/u/wvitpr)\
**Post date:** [February 5, 2011, 10:45am UTC](https://forum.servoy.com/t/velocity-report-question/13527/8 "2011-02-05T10:45:18Z")

</div>

Hi Patrick,

Version Info.

Servoy 5.2.4  
Java - Version 6 Update 23 (Build 1.6.0\_23-b05)  
Windows 7

Plugin version  
VelocityReport-v1.3.15 (downloaded the complete zip package from servoyforge.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [February 5, 2011, 11:02am UTC](https://forum.servoy.com/t/velocity-report-question/13527/9 "2011-02-05T11:02:43Z")

</div>

Same here.

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [February 5, 2011, 12:46pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/10 "2011-02-05T12:46:10Z")

</div>

I will have a look when I’m back from Servoy World.  
Will keep you posted.

---

<div class="post-metadata">

**Author:** ![wvitpr](https://avatars.discourse-cdn.com/v4/letter/w/e0b2c6/32.png) [@wvitpr](https://forum.servoy.com/u/wvitpr)\
**Post date:** [February 5, 2011, 1:15pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/11 "2011-02-05T13:15:07Z")

</div>

Ok, thanks Patrick much appreciated ![:D]( "Very Happy")

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [February 5, 2011, 1:38pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/12 "2011-02-05T13:38:31Z")

</div>

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]

 ![velocityEditor.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/0/0f03fac0db752e6cfd96ea9112ae66bdc94b69d5.png)

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [February 5, 2011, 5:07pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/13 "2011-02-05T17:07:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [February 5, 2011, 5:35pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/14 "2011-02-05T17:35:29Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [February 5, 2011, 7:57pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/15 "2011-02-05T19:57:47Z")

</div>

Hi Patrick,

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?

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [February 5, 2011, 8:03pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/16 "2011-02-05T20:03:41Z")

</div>

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 ![:-)]( "Smile")

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [February 5, 2011, 8:46pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/17 "2011-02-05T20:46:32Z")

</div>

+1

---

<div class="post-metadata">

**Author:** ![wvitpr](https://avatars.discourse-cdn.com/v4/letter/w/e0b2c6/32.png) [@wvitpr](https://forum.servoy.com/u/wvitpr)\
**Post date:** [February 5, 2011, 11:39pm UTC](https://forum.servoy.com/t/velocity-report-question/13527/18 "2011-02-05T23:39:50Z")

</div>

Patrick R,

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 ?

Tablebean  
Dialog-pro  
Dateutils

Thanks

---

<div class="post-metadata">

**Author:** ![ngervasi](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@ngervasi](https://forum.servoy.com/u/ngervasi)\
**Post date:** [February 6, 2011, 12:42am UTC](https://forum.servoy.com/t/velocity-report-question/13527/19 "2011-02-06T00:42:28Z")

</div>

> ptalbot:  
> Probably Servoy could host a central of library (that they would sign) and we could then link to it using extensions in our jnlp?

I second this, KISS is always the best approach.

---

<div class="post-metadata">

**Author:** ![jcarlos](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jcarlos](https://forum.servoy.com/u/jcarlos)\
**Post date:** [February 6, 2011, 5:45am UTC](https://forum.servoy.com/t/velocity-report-question/13527/20 "2011-02-06T05:45:15Z")

</div>

> 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)

JC

[Next page](https://forum.servoy.com/t/velocity-report-question/13527.md?page=2)
