cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Grid Layout of DataSet Information within a Group

Former Member
0 Kudos

I am trying to create a section in Crystal Reports that will produce the layout in the image Below:

The reports DataBase is a DataSet that is passed to the report from my C# application and for purposes of this example, there are two tables; "Consistent" that contains the one row for each 'Prescribed Medication' and 'Comment' and linked to a 2nd table "CResults" which contains one row for each 'Expected Metabolite', 'Amount', 'Cut-Off' and 'Interpretation'. Note there may be one or more rows in the "Consistent" table and one or rows in its related "CResults" table.

By using two Groups (one for the "Consistent" table that contains the header text and a 2nd group that contains fields for 'Medication', 'Expected Metabolite', 'Amount', 'Cut-Off', 'Interpretation' and 'Comment'.

In the 2nd Group I have come close to reproducing this format by using "lines".  The vertical lines to the left and right of Medication Field and Comment field are set to "Extend to Bottom of section when Printing" and a horizontal line under the Medication Field and Comment Field set to "Move to bottom of section".  Each of the "CResults" field are "boxed". One Horizontal line covers from the Metabolite to the Interpretation to form the bottom of each cell for the 4 parameters.

The issue I run into is the the last Horizontal line (under Medication and Comment) do not line up with line under the 4 parameters (it is a line width too low).   I have tried this with both using the Horizontal Linn under the 4 parameters as well as using a Bottom Border for each of the four fields with the same issue.

I also understand that this may not even be the correct approach and I am open to trying other approaches.  Also as the DataSet is produced by my C# Application I can control the Schema and it can be changed is required.

Any help here would be greatly appreciated

Neal Flora

Accepted Solutions (0)

Answers (2)

Answers (2)

DellSC
Active Contributor
0 Kudos

A cross-tab might be helpful, but it will not give you exactly what you're looking for because of the way that it formats the rows.

Try this:

Instead of using boxes, use a line for under the 4 center columns.  However, create a second section for that group (right-click, Insert Section Below) and put the horizontal line there instead of just below the text.

Go to the Section Expert for that new section and click on the formula button to the right of the Suppress checkbox.  DO NOT check the Suppress checkbox!  Enter something like this following in the Formula Editor:

OnLastRecord or {medication field} <> next {medication field}

This will suppress that bottom line for the last record in the medication group, which will prevent the double-line.

-Dell

Former Member
0 Kudos

Could not make that solution work for me.

Thanks for the suggestion.

I have a different approach but still can't get it to work.  I suspect it is due to my lack of knowledge.

Former Member
0 Kudos

Hi Neal, using Cross Tabs might help you in solving your problem.