Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need default columns in CrossTab Post Reply Post New Topic
Author Message
ViBaldi
Newbie
Newbie
Avatar

Joined: 31 Jan 2008
Location: Canada
Online Status: Offline
Posts: 2
Quote ViBaldi Replybullet Topic: Need default columns in CrossTab
     Posted: 31 Jan 2008 at 4:37pm

Just wondering if anyone has any ideas, as I have run out...

 

I have a summary report that queries an SQL view and contains a CrossTab. The selection criteria is filtered by 4 selectable parameter fields:

1) Region    2) Type of Job     3) Start Date    4) End Date
 
With the exception of the dates, the user can select one or many from the dynamic parameter fields. The Report is Grouped initially by Region. In my CrossTab, the rows are the selected Job Type and the columns are grouped by the Month of the Job. The summarized field in the CrossTab is a Distinct Count of the JobID's. So basically, I want a monthly summary of Job Types, where the user can select the Job Types and date range for any particular Region.
 
My dilemma is that my Cross Tab will not include Months, if there was no activity in those months. I want it to still print the Months, regardless of whether there were no jobs, but show a count of zero. Note that if there were different Job Types during the Month, it will appear with a zero in the column for the correct Job Type, but if that month had none of the selected Job Types, the Month is skipped altogether. Somehow, I would like to have the CrossTab leave all selected Months within the Start and End Dates in the columns, but with zero's as the Distinct Count, instead of skipping those Months.
 
Any ideas will be greatly appreciated. Please note that I am fairly proficient with Crystal Reports XI, and have tried everything I know, but I am relatively inexperienced with CrossTabs.
IP IP Logged
gmal
Newbie
Newbie
Avatar

Joined: 14 Feb 2008
Location: United States
Online Status: Offline
Posts: 1
Quote gmal Replybullet Posted: 14 Feb 2008 at 8:01am
I believe it can be done by linking a fixed "calendar" table with the requisite columns needed, and forcing the join to always all rows from that table. That seems to work when I tested it, I will say it didnt work against a production sql server. perhaps I will move teh join to avierw and see how that works, but its worth trying.
IP IP Logged
ViBaldi
Newbie
Newbie
Avatar

Joined: 31 Jan 2008
Location: Canada
Online Status: Offline
Posts: 2
Quote ViBaldi Replybullet Posted: 14 Feb 2008 at 4:24pm
Thanks. We actually have succeded in creating a table that lists every month with every job type for about 10 years (...doubt that we will need this report after a few years...). We did a Cross Join on this table with our Region Table, and made this all one big Sub Query in our View. We were then able to Left Outer Join this Sub Query to our original query, and it works perfectly! What a lot of work, though!
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