Hi,
Thanks for the file, I could see what is happening now. I am afraid that I don't have a simple solution, but let's start by the beginning:
When you have a range (2 underscores) the full row is moved down. So if you have a merged cell in the original template (marked in green):
And you insert full rows, you will get this after the report runs:
Up to here, everything is as expected. But if you "break" the report into 2 ranges, as in the following image (blue and orange ranges):
then when the first range runs, the merged cell will be broken, as it is the only way to insert some cells (as opposed to a full row):
When the orange range runs later, the green cell at the right will move down, but the merged cell will still be broken:
There is no really a way around this: the only solution would be if the reports run in a different way. But as they run today, that is inserting ranges of cells, you will break the merged cell. Excel does the same, when I was inserting the range of cells for the screenshots, it showed this dialog:
Something similar happens with the print area too (which I guess was your original problem). When the first range runs, the print area can't grow because only half of the print area should grow (the half where you are inserting the range). When the second range runs it happens again, the print area can't grow either. While when you inserted full rows, the print area moved down with the inserted cells.
Now, for the solutions: As said, there is no simple one, but there are workarounds.
1)The simplest is as you did in this case, don't have a print area, and don't have a merged cell below the ranges inserted which uses more columns than the range inserted. But well, this is kind of a no-solution, and I don't think it applies in your case. In others, it might be worth doing it.
2)The second option would imply going back to a single full row range, which I guess is the best solution in this case. You could use a <#dbvalue> tag to get the values of range b into range a, or you could define a TJoinedVirtualDataTable object which would use both lists and return them as a single object.
I think creating the TJoinedVirtualDataTable object is the best in this case, but right now I have to go and I won't be able to show you an example until later today. When I come back I will send you your example modified to use a TJoinedVirtualDataTable.
Ps: Would it be ok if I post the modified example here as it doesn't seem to have private data, or do you prefer that I send it to you by email?