Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports11: Crosstab Functionality Question 1

Status
Not open for further replies.

Izzy2009

IS-IT--Management
Dec 16, 2008
6
US
I am trying to write a report to display fields by year as a budget projection report. Something similar to this:

Code:
              year1   year2   year3 
name
  building1   <$$$>   <$$$>   <$$$>
  building2   <$$$>   <$$$>   <$$$>
  building3   <$$$>   <$$$>   <$$$>
name
  building1   <$$$>   <$$$>   <$$$>


I'm pulling this information out of a database with all their respective fields and have set it up using the crosstab feature. My complication arises because I want to take numbers from past years (items deferred for example) and bring them to year1, in addition to numbers associated with year 1.

Since I don't know how to have both future numbers as well as select fields into one column in the same crosstab, I've created two reports, one with foreword projections and one that lists deferred numbers for several past years, but now would like to combine the two.

Any ideas would be extremely helpful! Regards
 
Depending on your Crystal version, you should be able to use a formula field. Deferred records would be listed as for the current year, and the Crosstab would group them as such.

It always helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Ah, my apologies. I am using Crystal Reports 11.

I understand in the Crosstab function how to insert the data so it is displayed by year (something like under the Column section: Year, Summarized Fields: Cost. What I don't understand is how to bring a back-catalog of costs and throw them into the current year column and have future costs in as well.
 
More or less, in a multi-columned crosstab, how could I combine two of those columns into one and maintain the rest of the columns.

Say my first post's code block is where I am and this is where I am trying to go:

Code:
              year1&2   year3   
name
  building1   <$$$>     <$$$>   
  building2   <$$$>     <$$$>   
  building3   <$$$>     <$$$>   
name
  building1   <$$$>     <$$$>

TIA


~ Using Windows XP & Crystal Reports 11 ~
 
I don't know what your "year1" column means, but let's say year1 is 2007 or earlier, year2 is 2008, and year3 is 2009. Then create a formula like this to use as your column field:

if year({table.date}) <= 2007 then "Year1" else
if year({table.date}) = 2008 then "Year2" else
if year({table.date}) = 2009 then "Year3"

-LB
 
year1/2/3/etc were just hypothetical years, I figured I would keep it in general terms.

Anywho, I ended up doing something similar in changing the date if it was in the past:

Code:
IF {EQUIPMENT.ASSESSMENT_DATE} < CurrentDate
THEN
ToText(CurrentDate,"yyyy")
ELSE
ToText({EQUIPMENT.ASSESSMENT_DATE},"yyyy")

Many thanks for the helpful postings

~ Using Windows XP & Crystal Reports 11 ~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top