Question Crystal Reports - Setting the details section for a fixed amount of records

Tom

Well-known member
Joined
Aug 23, 2005
Messages
746
Programming Experience
5-10
I’m looking for an efficient way to implement a fixed size / amount of records in the details section of a Crystal Report. For instance the details section size should always match the size of exactly 6 records. The problem is when less then 6 records are returned from a query. I dont need to suppress any additional records, my query will keep it filtered to the limit.

The background of my report simulates a form that needs to be filled out. There is a specific fixed-boxed area where the details / item records appear. However the details section grows/shrinks depending on amount of records passed to the report causing the rest of the form template to be thrown out of position. I need this to stay to a fixed size, no matter if there are 1 to 6 records displayed.

I’ve used a few workarounds so far such as implementing a sub-report in the details section, padding additional blank records to make up the difference, passing each of the record as an individual parameter etc…. Each of these have produced the desired results but are slow & inefficient, I’m hoping to find a better/faster way. Speed of creating & sending these reports directly to a printer is priority.
 
Last edited:
Any suggestions on a fast/efficient way of padding this details section so it would always equal the size of 6 records?
 
I resolved this issue. For some unknown reason I'm currently not seeing the post edit buttons available to update the thread and mark it as resolved.

As to the issue, I added an additional report footer underneath the details section to match the overall height I need for the details section. For example, footer has a height of 1,200 (no objects in it) and details section has a height of 200 (per each record). In my vb coding I added a single line of code to subtract the height from the amount of records * 200 from the footer.

VB.NET:
Dim rpt As New rptTest

[B]rpt.Section4.Height -= (ds.tblDetails.Count * 200)[/B]
rpt.SetDataSource(ds)
rpt.PrintToPrinter(1, False, 0, 0)
 
Back
Top