Format subreports in crystal reports

1.6k Views Asked by At

I am exporting a crystal report to pdf document. I have a detail section that contains two sub reports side by side. When I view the pdf, I see that the boxes in which the sub reports data is shown has different heights in-spite of setting both the boxes to same height. Also the height of detail section in both the sub reports is also same.

2

There are 2 best solutions below

0
On

height of sub report defers as when report is previewed data will be added vertically so size of the sub report is increased, I dont see any wrong with the report behaviour.

If this is not your issue then provide more info about what data you are displaying in both sub reports.

2
On

The vertical size of the subreport object in the main report doesn't really matter, as the subreport will grow as large as it needs to in order to fit (This is not the case for the horizontal dimension).

So, in order to have two side-by-side subreports that are exactly the same size, you need to meet two conditions:

  1. The size of the subreports themselves need to be exactly the same size. This includes all visible subreport sections.

  2. The same number of records should be in each subreport. If one subreport has 1 record and the other has 5 records, obviously those two subreports will ultimately be different sizes.

The easiest way to prevent this is to just not place them side-by-side. If you don't want to do that, then you can try to increase each subreport's size such that they already accommodate the maximum 5 records and therefore won't need to ever grow in size. If those things don't work, you can add placeholder sections to each subreport and conditionally suppress them depending on the number of records in each subreport. For example, each subreport has 5 sections and for each additional record that is to appear, you suppress one of those sections.