views:

26

answers:

1

Problem

It looks like MS have removed support for nested Business Objects in their Report Viewer 2010 companant. We would like to upgrade our web app to make use of the new features, but need to maintain backwards compat for loads of legacy reports.

Caveats

1: We cant put anything in the GAC as we are on a hosted shared web server.
2: We are in VB so dont seem to be able to use Aliases (i think a c# feature), so we cannot add the references in VS at all or we get a namespace conflict or reference already exists error.
3: The report web componant dll is itself dependant on two other dlls that are also new (e.g. common.dll and processing.dll)
4: The report compnant has to run in the main app domain at the moment (using ExecuteReportInCurrentAppDomain) as when it accesses the business objects, they check security roles etc and this did not seem to work if the report viewer ran in a different app domain. This can probably be worked around.

Approach so far

Use activator.createinstance or similar reflection method and put the new dlls in a sub folder of the bin directory. I have heard that this still will not work as the web comonannt not be able to find the other dlls (common and processing) that it is dependant on.

Possible other ideas

Create a new C# project that manages the choice.

Any ideas? Thanks in advance.

+1  A: 

In case anyone is interested.
1) I created a C# project
2) I renamed one of the dll's i needed and referenced them both 3) I changed the Alias property of the references in VS to reportViewer2005 or reportViewer2008 respectively.
4) I created an IReportViewer interface that my legacy application uses to interact when it wants to generate a report.
5) I used extern alias ReportViewer2010Alias; and extern alias ReportViewer2008Alias; in two new class files in the C# project, one for 2010, one for 2008 and implemented the interface IReportViewer
6) Then just wired up the different methods and events inside

I then just referenced the c# project from my VB app. I can now use both classes and they seem to work reliably on our dev system. Fingers crossed for the production server test.

James Wood
This dosent in practice. My local machine was still getting the assemblies from the GAC. Live server throws an error as the assembly was renamed. Now working on a vb only solution that embeds the dlls as resources and loads them at runtime.
James Wood