# Dataset in table view

**URL:** <https://forum.servoy.com/t/dataset-in-table-view/9952>\
**Category:** Classic Servoy\
**Created:** [December 1, 2008, 12:00pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952 "2008-12-01T12:00:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://forum.servoy.com/u/aruna)\
**Post date:** [December 1, 2008, 12:00pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/1 "2008-12-01T12:00:54Z")

</div>

Hi,

I use a query to fetch certain data into a dataset. I need to display the dataset columns in a table view. Is there anyway of doing this?  
I also need to show additional fields based on the form table alongside the dataset fields. Is this also possible?

Thank you  
Regards,  
Aruna

---

<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:** [December 1, 2008, 12:05pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/2 "2008-12-01T12:05:36Z")

</div>

Hi Aruna,

To display the data you can use a InMemDataGrid bean for this. Another way would be to use HTML inside a HTML\_AREA field.  
And for extra data you can add extra columns to the dataset and fill them. See the JSDataSet node under the Database Manager node.

Hope this helps.

---

<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:** [December 1, 2008, 12:19pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/3 "2008-12-01T12:19:18Z")

</div>

You can also have a look at our [Table-Bean](http://www.servoy-plugins.de). It is made just for that and gives you way more display options than the inMemDataGrid.

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [December 1, 2008, 12:47pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/4 "2008-12-01T12:47:24Z")

</div>

> aruna:  
> Hi,
> 
> I use a query to fetch certain data into a dataset. I need to display the dataset columns in a table view. Is there anyway of doing this?  
> I also need to show additional fields based on the form table alongside the dataset fields. Is this also possible?
> 
> Thank you  
> Regards,  
> Aruna

In Servoy 4.1 you can also base forms on datasets which would address your question.

---

<div class="post-metadata">

**Author:** ![Yeroc](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yeroc](https://forum.servoy.com/u/Yeroc)\
**Post date:** [December 1, 2008, 5:11pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/5 "2008-12-01T17:11:20Z")

</div>

Jan,

Can you elaborate on how this is done? When looking at the property panel for a form under v4.1.0 I don’t see a way of setting a dataset as a property of the form.

Thanks,  
Corey

---

<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:** [December 1, 2008, 5:40pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/6 "2008-12-01T17:40:32Z")

</div>

Corey,

See the thread on Servoy 4.1 beta 5 where this feature was first introduced.  
Note that some of the constants have been renamed in a later release.

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

You should also be able to create a relation based on the data source from the data set to another regular table.

Rob

---

<div class="post-metadata">

**Author:** ![Yeroc](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yeroc](https://forum.servoy.com/u/Yeroc)\
**Post date:** [December 2, 2008, 5:00pm UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/7 "2008-12-02T17:00:42Z")

</div>

Thanks for the information Rob.

Is there going to be a more 4GL-like way of doing this in the future for cases where you want to be build a form based on a complex query spanning multiple tables etc. but still be able to use the GUI form builder? Ideally, I’d like to have the ability to tie a form to an arbitrary (select) query instead of a table in certain cases and have Servoy introspect the query and let me drag and drop the fields on the form.

Note that I still appreciate the flexibility that Solution Model gives but it’s cumbersome going back to the Swing-like model of UI programming for cases where that’s over-kill.

Thanks,  
Corey

---

<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:** [December 9, 2008, 8:40am UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/8 "2008-12-09T08:40:22Z")

</div>

Corey,

Servoy will need a table (or a view) to build a form on to be able to perform updates or inserts.  
Suppose for example when a form would be build on sql ‘select tab1.f1, tab2.f2 from tab1, tab2 where …’ how would a new record be inserted? or an update?  
You can build a form on an updatable view though, the insert/update will be handled by the database in that case.

You can base a form on an arbitrary query though using controler.loadRecords(sql) but this query is only used to find the PKs, the other columns are retrieved from the base table.

Rob

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 9, 2008, 9:29am UTC](https://forum.servoy.com/t/dataset-in-table-view/9952/9 "2008-12-09T09:29:33Z")

</div>

In 4.1.1 you can build your form in the designer. Just create it the way you want (use a dummy table or something)

then the only thing you need to do when you want to use that form with a dataset is alter the forms datasource and the fields data providers to match the datasource.

problem is that you cant do that in 4.1 yet because of a missing new datasource property on a solution model form object.
