• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 931
  • Last Modified:

SQL Reporting Services - Graph

I have a graph which displays data for the last year, however, as I return so many days worth of data, the bottom of the graph looks corrupt.

How can I get RS to decrease the frequency at which it prints the date?

date-range.png
0
egxis
Asked:
egxis
  • 2
1 Solution
 
catherinelouiseCommented:
Hello,

You could define an expression which only displays every other label.  For example, if you edit the group in the Chart Properties data tab, you can put this expression into the label field:
=iif(RowNumber(Nothing) Mod 2, Fields!Date.Value,"").

You could also make the font a little smaller.  On the X Axis tab, click the style properties icon next to Format Code - you can edit font size there.

Cat
0
 
egxisAuthor Commented:
It's looking better, but my issue is that if the user selects a larger date range [e.g. 36 months]?

How can i force only 12 dates from the date range to print, using a similar expression?
0
 
catherinelouiseCommented:
Here's all I can come up with right now:
use nested IFs in the label statement which will depend on the date range.  something like:

=IIF(DateDiff("m",max(Fields!date.Value, "Dataset"),min(Fields!date.Value, "Dataset")) >= 36,(iif(RowNumber(Nothing) Mod 3,Fields!date.Value, " ")), IIF(DateDiff("m",max(Fields!date.Value, "Dataset"),min(Fields!date.Value, "Dataset")) >= 24,(iif(RowNumber(Nothing) Mod 2,Fields!date.Value, " ")),Fields!date.Value) )
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now