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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chart Default X Axis

Status
Not open for further replies.

gav12345

Programmer
Dec 4, 2003
198
GB
Hi,

We're using Crystal Reports 2011 and SQL Server 2005.

I have a chart in which I'm trying to display all accounts opened per month, over the last year (rolling date - currently 13th June this year to 13th June last year).

Even if no accounts were opened in a given month, I still want to display that month name on the X Axis, but with a count of 0.

What I currently have is a formula called 'ChartMonth' on the X axis and a formula called 'ChartMattersOpened' on the Y axis. Chart Month has the code:
Code:
dim sHoldMonth as number
if {HBM_MATTER.OPEN_DATE} >= dateserial(Year(currentdate)-1, Month(currentdate), 1) then
     sHoldMonth = month({HBM_MATTER.OPEN_DATE})
else 
    sHoldMonth = 0
End if

If sHoldMonth > 0.00 then
    Select Case sHoldMonth
        Case 1.00
            Formula = "1   Jan"
        Case 2.00
            Formula = "2   Feb"
        Case 3.00
            Formula = "3   Mar"
        Case 4.00
            Formula = "4   Apr"
        Case 5.00
            Formula = "5   May"
        Case 6.00
            Formula = "6   Jun"
        Case 7.00
            Formula = "7   Jul"
        Case 8.00
            Formula = "8   Aug"
        Case 9.00
            Formula = "9   Sep"
        Case 10.00
            Formula = "91   Oct"
        Case 11.00
            Formula = "92   Nov"
        Case 12.00
            Formula = "93   Dec"
    End Select
End if

and ChartMattersOpened (which used a 'distinct count' summary in the chart options) has the code
Code:
if {HBM_MATTER.OPEN_DATE} > dateserial(Year(currentdate)-1, Month(currentdate), 1) and {HBM_MATTER.MATTER_CODE} <> "" and not isnull({HBM_MATTER.MATTER_CODE}) then
   formula = tonumber({HBM_MATTER.MATTER_CODE})
else
   formula = 0
end if

Unfortunately as it stands this 1.) Only displays the months that have accounts opened; 2.) Displays an unlabelled month (with a count of 1) at the leftmost side of the X Axis.

Can anyone tell me how I can display all months on the report, even those with no opened accounts, and remove the unlabelled month?

Thanks in advance, Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top