This lesson is part of the Reporting in Ignition course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off
Take topic challenge

Description

This lesson introduces Table Groups: an object that contains multiple instances of a Table Component. They're ideal when a report must show data from multiple data sources in a single object.

Video recorded using: Ignition 8.0

Transcript

(open in window)

[00:00] In this lesson we'll talk about table groups. So we can see that I have a report. I'm in the Data tab here. And I have two data sources. One called Numbers, with a bunch of numbers, one called Letters with a bunch of letters. If we head over to the design tab here, we can see that I have a table that's currently showing off our numbers and when I go to Preview it works just fine, so it just goes through all of our numbers. Great. Now when I head back to the design tab, I now want to do something in the key browser here under Data Sources, with this Letters data source. I want to show that on the page here. So I could just drag Letters onto the page, and create a separate table for that. But let's try something different. I'm going to delete this, and how about instead once we're done showing all of the data from our Numbers data source, let's then have this one table transition to our Letters data source. That's when you would use a table group. To make a table group, you simply select your table, and if you look in the Property Inspector on the Configure Table tab there's a Make Table Group button which you may need to resize this panel to see. Now when I press this button you'll notice the hierarchy in the project browser and the actual table changes just a little bit. I'll press the button here. You can see that there's now an icon on the table as well as in the project browser here. Our table is now nested under a new object. And of course the Property Inspector is showing us some new information. So a table group is a container for multiple tables. Let's add a new table into the group. Under the Configure Table Group tab here there's a plus button, which when I press it, gives me two options. For right now I'm going to create a peer table, which will appear right below my Numbers table. And notice that depending on which one of these two tables I have selected, the table on the page changes from my Numbers table to some new table. Now I need to assign this new table. It's showing that object's data source. Now I'm going to scroll down here in the property inspector and there's this little key setting down below. So the way the assignment works is I can drag my Letters data source to this key field here, which will then assign it. So if I scroll back up here I can switch back to Numbers, and now I can go to Letters. Let's go ahead and add some information to the columns here, so I'll drag my letter column from the Letters data source into the table, and if I go to preview, you can see that we go through all of our numbers. Once we run out of numbers, we then transition to the new Letters table, and then start showing all the letters. Now say I wanted to make a change to one of those tables. Maybe I wanted to add a header to the Letters table. So I can go back to the design tab here and I can click on the Table Group. Then I need to pick which of my tables I want to make some changes to. So in this case I'm going to select the Letters table. Now I could either dig into the project browser and find the table or start clicking on individual columns or pieces here. So I could double click on the body, which will select the table, of the Letters table, maybe add a header and then maybe type something in here. So this could be my Letter header. When I switch over to preview, we can see that it's going through all the data, shows the header, goes through the rest of the data, and if it runs out of room you can see that it ran out of one letter there, it'll work like a normal table and reprint on the next page. Now if I head back to design here, and I select my table group, so we created Letters as a peer table meaning it is a peer to the previous table so these two are peers to each other. So we'll finish with Numbers and then we'll show Letters. There are some buttons on the right hand side so you can reposition these, so if I wanted to start with the Letters table first, Now when I was adding a table you can see that there was something called a child table. Now I'm not going to add a new one. Instead I can make Letters a child by selecting Letters and then pressing the right arrow. So the right arrow indents Letters under Numbers which means that the Letters table is a child to the Numbers table. Being a child table means that for every row of, in this case, the Numbers table, we're going to reprint the entirety of the Letters table. So if I go to Preview, you can see that we get one number. We then get the entirety of our Letters table. We then get another number back from the Numbers table, and then back to our Letters, and we basically repeat that until we're out of data from the Numbers table. Now this isn't too useful, obviously. I'm simply repeating the exact same letters over and over again. However if you remember the video about nested queries, which I'll head over to this nested query report, up in the key browser under Data Sources I have a root query and then a nested query named child query. Child tables work great with this sort of structure here. So you could create, inside of a table group, a table for your root query, then add a child table to the table group that shows off child query which is exactly what I've done over here. So if I need to select the table group I can simply click on the little icon here, you can see that root query is my first table and then child query is assigned to a child table. So when I go to preview here, we see that I have one row from the first table, and then some number of rows from the child table. We then go back to the next row on our first table. We then show another instance of our child table but with slightly different data this time. And then we repeat that process until we finish showing all of our rows. So hopefully this gives you a good idea about what a table group is. Again peer tables are great if you wanted a single component on the page to show data from multiple data sources. Child tables are great if you're working with a nested query.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.