Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Forcing crosstab to show entire date range Post Reply Post New Topic
Author Message
LoneTraveler
Newbie
Newbie


Joined: 03 Aug 2012
Location: Canada
Online Status: Offline
Posts: 2
Quote LoneTraveler Replybullet Topic: Forcing crosstab to show entire date range
     Posted: 12 Oct 2012 at 8:05am
Hi,
 
I'm trying to make a report that will show for all employees : the amount spent by month, by airline, for the entire time frame contained in the table. So I decided to first make a group based on the employee's name then I made a crosstab in which the row represent the airlines and the column represent the date of the flight (formatted to be show by month). The summarized fields are the sums of the flight costs.
 
The problem is that not every employee took a flight every month with each airline in the time span covered by the field representing the date when the flight was taken. So I end up with certain crosstabs that don't have the same length and the last column showing the totals doesn't line up for each employee.
 
Looking at the options listed in the 'Crosstab expert->Customize' section I'm getting the impression that the program thinks that it is actively showing empty rows and columns because the options named 'Suppres empty rows/columns' are unchecked.
 
My Boss wants the reports to show every month of every year (covered by the date field) the total cost for each airline for each employee. If it is 0$ then is would show 0$. Right now its showing 0$ only if another airline is showing a cost.
 
Any suggestions are welcome
 
Thank you for your time
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Oct 2012 at 12:00pm
well, my standard answer to anything where the data is complex or missing is to use a stored procedure.  Then you can 'query' your data and add an entry for anydata that is missing.
 
You would add the record of $0 for the employee for the month for the airline. This way, every column of data will have a value (not a null) and will then display on the report.
 
I know that many don't know/can't use stored procs in their reports for various reasons.  In this case, you might be able to get around your limitations by creating a Command Object that selects for all employee/airline/month combination a $0 value. Then you can link your real data tables ot the command object and so fill in the missing values.
 
I don't guarantee that this will work, I have the gut feeling that it will work, but never having done this myself (I use the stored procedure method)...
well it's worth a try.
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum