Did you ever had to outline information on a report? For example, the user asks you to move this field a little to the left or right, or can that textbox be a little bigger because sometimes it’s just not big enough? Or can you also add this information into that textbox, but don’t change the outlining with the other rows because that would “mix-up” the borders? And ofcourse, this has to be acomplished in a complex document report containing a lot of information in a table with groupings, expressions, and so on.
When facing that situation, the following might be nice to know: When you add a table into another table you can run into the following error message: “Data Regions within table/matrix cells are ignored.“
This will happen in the following situation:
In table1 there’s a Detail, Header and Footer level. Because of ‘requirements’ you have to add an extra field in the first column. You don’t want to use an expression to concatenate two fields in one textbox, you want to have two textboxes because you need to format them separately. In RDLC 2008 this would be very simply acomplished by using a Placeholder, but in NAV 2009 we use RDLC 2005 and the Placeholder doesn’t exist yet 🙂
A solution might be to add a table2 in the textbox. A table can be added into another table, but not on Detail level. It’s only allowed on a Header, Footer or Group level. So, as shown in the above screenshot, you add a grouping and into that grouping you add a tabe. From the table you add, you then remove the Detail and Footer level, so only a Header level, with two textboxes remain. Now you can format each of these textboxes as you please.
The problem is not when you run the report, that runs without any issue. The problem is when you run the report and export to Excel. The nested table scenario is not supported in the Excel rendering extention, and you will see this message in Excel:
What is the solution?
Ofcourse, as is usually the case in RDLC, there are several possible solutions. You might want to choose to add extra columns in the table and merge cells to obtain a similar result, as shown in the next screenshot:
Merging cells can be done by selecting two cells, right click and in the contextmenu that opens, selecting “Merge cells“. Of course, to be able to do that, you first need to add an extra column and then merge all required cells, except those in the Group Header level, as in the above screenshot. Although this works, it can be a problem when in the future you want to delete or move column A or B, because that is not allowed when they contain merged cells.
Another workaround is to work with our friend the Rectangle.
- Drag a Rectangle from the toolbox onto the Body of your report.
- Insert two textboxes into the Rectangle.
- Resize the Rectangle.
- Cut and paste the Rectangle into the Table.
And voila, same result, but it exports to excel and no merging of cells…