Print Page | Close Window

CR v10: subreport data not lining up

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7721
Printed Date: 31 Mar 2025 at 12:23am


Topic: CR v10: subreport data not lining up
Posted By: huddy33
Subject: CR v10: subreport data not lining up
Date Posted: 17 Sep 2009 at 12:48pm
I have a main report showing five fields and a subreport pulling data in from another table.  The subreport is not lining up with the other fields (in the row) and also is very large, making the report five times as long as it should be.  The actual subreport field is the same size as the other fields.  How can I fix this?  Thanks!



Replies:
Posted By: hilfy
Date Posted: 17 Sep 2009 at 3:54pm
So, if I understand you correctly, you're using a subreport to get one or more fields of data to include in a row with other data in the main report.  Correct?
 
If you haven't already done so, try this:
 
1.  Suppress all sections in the subreport except the one that contains your data.
 
2.  In your main report, get the height of the existing fields in the same line (on one - right-click and select "Size and Position").  Make all of the fields in the subreport the same height as the main report.
 
3.  Put the subreport fields at the very top of the section they're in (Y = 0 in the Size and Position screen).
 
4.  Move the bottom border of the section they're in up until it won't move up any more - it will stop at the bottom of the fields.
 
5.  On your main report, make your subreport just a little bit taller than the main report data on the same line.  Make it only as wide as the data it's showing.
 
6.  Place the sub report so that it's top is at most a 10th of an inch above the other fields in your main report.  You'll have to play with the position to get the data to line up.
 
Note: Be aware that if your users want to export to Excel, using a subreport this way may or may not export cleanly.  There may not be anything you can do about this other than finding a way to get your data without the subreport.
 
Note2:  Subreports are slow - it's not recommended to use them on details lines in the main report unless you have a very small set of data because they completely re-query the database every time they have to run to get the data you want.
 
Good luck!
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: huddy33
Date Posted: 18 Sep 2009 at 5:03am
Thanks, Dell.  I got the fields to line up, but now it is doing something crazy to the row height.  I've set the subreport field to the same height as the rest of the fields (as you suggested), but now the rows are nearly 2" each, when they are set to be .25".  Any ideas?


Posted By: hilfy
Date Posted: 18 Sep 2009 at 6:23am
Is every section in the subreport suppressed except the one where you have data?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: huddy33
Date Posted: 18 Sep 2009 at 7:08am
Originally posted by hilfy

Is every section in the subreport suppressed except the one where you have data?
 
-Dell


Yes.



Print Page | Close Window