cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create Three Column with different dates and same data

GSG
Participant
0 Likes
524

Hello All,

I am trying to create a Crystal Report with the three consecutive days. I was able to create two different columns but was not able to create the third one. The second Challenge I have to have a different date with each section. The attached screenshots are from Crystal Report (Export XLS). Please advise. I am using SAP Crystal Reports 2016. I would appreciate the help. Thanks

View Entire Topic
DellSC
Active Contributor
0 Likes

You're not going to do this as columns. I can think of two ways to do this using subreports:

Method 1

- Group on the Day 1 date and create a second group header section for Day 1

- Pull the data for Day 1 into the main report, using the bottom group header and the details sections.

- Create a subreport for Day 2 using the same format as the data for Day 1. Be sure to suppress any unused sections. Place the subreport in the top group header and make it only as wide as it needs to be.

- Create another subreport for Day 3 like you did for Day 2. Place this next to the Day 2 subreport in the top group header section.

- Go to the Section Expert for the top group header section and turn on "Underlay Following"

You'll have to play with the positioning of the subreports to get everything to line up, but this will give you the appearance you're looking for.

Method 2

This is similar to method 1, but you'll also create a subreport for Day 1. You'll need to have a small query in the main report that pulls at least one record of data. I usually use a Command that selects just the current date and then group on that field when I'm working on a report like this. Suppress the details in the main report. Line up the subreports in the group header.

These are probably the easiest ways to get a display that you're looking for. However, they will probably export to Excel cleanly because Crystal's Excel export does not handle subreports well. They'll look fine when they export to PDF though.


If you need to be able to export to Excel, you can look at using a cross-tab with the dates across the top to display your data. This will export to Excel well. Another option would be to use a Command (SQL Select statement) that pivots the data for you so that you have separate columns for day 1, day 2, and day 3.

-Dell

GSG
Participant
0 Likes

Thank you Dell for the reply, much appreciated your help.

GG