1

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.

user2585299
  • 873
  • 2
  • 19
  • 41

2 Answers2

1

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.

Siva
  • 9,043
  • 12
  • 40
  • 63
1

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.

Ryan
  • 7,212
  • 1
  • 17
  • 30
  • I know that the maximum no of records that can appear in both the sub reports will be always 5 but each sub report can vary in the number of records that it displays. The varying heights of the sub report boxes does not look good when I print the pdf. Is there a way to avoid that ? – user2585299 Jan 24 '14 at 16:52
  • I solved the problem by always inserting the required amount of records (in my case it was 5) in the collection that was bound to the sub report. I had to add a dummy property in the .NET class to hold a sequence number. I added five rows with sequence 1-5 and later depending on how many records were returned from database, I set the other properties. – user2585299 Jan 25 '14 at 00:03