# Query result in portal

**URL:** <https://forum.servoy.com/t/query-result-in-portal/10543>\
**Category:** Classic Servoy\
**Created:** [April 17, 2009, 7:47am UTC](https://forum.servoy.com/t/query-result-in-portal/10543 "2009-04-17T07:47:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [April 17, 2009, 7:47am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/1 "2009-04-17T07:47:03Z")

</div>

Hi,

Is there a possibilty to put the result of a query in a tableview or portal.

I have a query with GROUP BY part and SUM-fields and I want to show the result in a tableview or portal.  
What I do now is that I make a HTML-table and fill this HTML-table with the query result.

But if there is a way to link a dataset to a portal or form (tableview), then it would save me lot of programming.

Because as far as I can see forms must be linked to a dataprovider, and that is not what I want here.

Basicly I want to show the result of a query in a grid.

Does Servoy has such possibily or is there a plugin/bean that can handle that?

Martin

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [April 17, 2009, 8:00am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/2 "2009-04-17T08:00:52Z")

</div>

Martin,

The dataset.createDataSource() method in Servoy 4.1 provides this functionality.  
You can create a form in the solution model with the data source uri returned, just search the forum for a few examples.

Rob

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [April 17, 2009, 8:04am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/3 "2009-04-17T08:04:13Z")

</div>

I was actually searching for the post Jan Aleman did with an example of this feature to reply to this post.  
Here it is:

[viewtopic.php?f=1&t=11505#p57322](http://forum.servoy.com/viewtopic.php?f=1&t=11505#p57322)

---

<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:** [April 17, 2009, 8:11am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/4 "2009-04-17T08:11:51Z")

</div>

but in 3.5.x…

Is it a possibility to use the InMemDataGrid bean?

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [April 17, 2009, 8:15am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/5 "2009-04-17T08:15:26Z")

</div>

> rgansevles:  
> Martin,
> 
> The dataset.createDataSource() method in Servoy 4.1 provides this functionality.  
> You can create a form in the solution model with the data source uri returned, just search the forum for a few examples.
> 
> Rob

> ROCLASI:  
> I was actually searching for the post Jan Aleman did with an example of this feature to reply to this post.  
> Here it is:
> 
> [http://forum.servoy.com/viewtopic.php?f … 505#p57322](http://forum.servoy.com/viewtopic.php?f=1&t=11505#p57322)

Thanks Rob, Robert,

Good to see that it can work like this. Unfortunately I need the functionaliteit in 3.5, so this way of creating grids will be for later when migration to 4.1.x is done.

Martin

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [April 17, 2009, 8:16am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/6 "2009-04-17T08:16:41Z")

</div>

> mboegem:  
> but in 3.5.x…
> 
> Is it a possibility to use the InMemDataGrid bean?

Hi Marc,

I’ve seen this bean, but when I looked at the methods and properties I didn’t see a way to link a dataset to this bean

Martin

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [April 17, 2009, 8:20am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/7 "2009-04-17T08:20:19Z")

</div>

> martinh:
> 
> > mboegem:  
> > but in 3.5.x…
> > 
> > Is it a possibility to use the InMemDataGrid bean?
> 
> Hi Marc,
> 
> I’ve seen this bean, but when I looked at the methods and properties I didn’t see a way to link a dataset to this bean
> 
> Martin

In 3.5.x you can use the InMemDataGrid bean but remember that it will not work in WebClient.  
As for how to use it. The beans takes the Swing TableModel object.  
You can use the getAsTableModel() function on a dataset to get this object.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [April 17, 2009, 8:32am UTC](https://forum.servoy.com/t/query-result-in-portal/10543/8 "2009-04-17T08:32:05Z")

</div>

> ROCLASI:  
> In 3.5.x you can use the InMemDataGrid bean but remember that it will not work in WebClient.  
> As for how to use it. The beans takes the Swing TableModel object.  
> You can use the getAsTableModel() function on a dataset to get this object.
> 
> Hope this helps.

Good points Robert,

It need to work in webclient also. So that limits the possibilities.  
I tried also dataset.getAsHTML(), but then it is not formatted like I would like it to see (some columns need to be right aligned; 2 decimal digits, no borders)  
So for the moment I’ll create the HTML myself.

When I’m migrated to 4.1.x then I’ll use example that was given in a previous posting. It looks like that I can do all I want.

Martin
