views:

14

answers:

1

I am using visual studio 2010 coding with VB. I have reportviewer control with a chart on the report. How do you programmatically change an axis group expression for a chart in an rdlc report. For instance i have the group expression: MonthName(Month(=Fields!receiveddate.Value)) .

How can I change this to: Week(=Fields!receiveddate.Value) at runtime via code?

Thanks in advance!

A: 

You could try using and iif or logic in your expression?

=iif(Parameters!something.Value = "Weeks", Week(Fields!receiveddate.Value), iif(Parameters!something.Value = "Months", MonthName(Fields!receiveddate.Value), Nothing))

Off the top of my head, might not work but you need to describe the scenario a little bit more.

Else you would have to write some xml processing code to alter the rdl/rdlc's source. Which is nasty.

Phil

related questions