views:

281

answers:

1

I have a Dundas chart being used in a SSRS Report with some custom code in the PostInitilize Event that looks something like this:

foreach(CustomLabel curLabel in chartObj.ChartAreas[0].AxisY.CustomLabels)
{
    curLabel.GridTick = GridTick.None;
    curLabel.Text = Convert.ToString(Convert.ToInt32(curLabel.Text) - 10);
}

Its takes each axis label and reduces the value by 10.

This works great on my machine, it even works fine on the production server in report viewer. But when this report is run as a subscription, the code fails to run. The report generates just fine but the axis labels are unchanged.

How could this be happening? What is different about running a report as a subscription?

+1  A: 

After much searching, I have discovered the solution to this.

The problem is the version of Dundas on my development machine was slightly newer to the one in production (2.2 v 2.1). This causes the code assembly not to be trusted I guess. (but only when running unattended?)

The obvious solution is to upgrade the server, or downgrade my development machine so the version numbers to match. I couldn't touch the installation on the server, and downgrading my own machine would take to long and be annoying. But there is another solution.

Find a machine with the correct version of dundas installed, open the report in Visual Studio, open the code, make a superficial (like adding a blank line, or a comment) then compile the code. This report will now contain the 'correct' assembly. Deploy this to the server, and everything should work.

Nathan Reed