In part I – we’ve discussed how to create the report + how to get it working on a local box. The real fun starts when it comes to deployment.
Here is the summary of challenges I faced:
1. When I deployed the solution to a Windows Server 2003 box I got the error below
An error occurred during local report processing. The definition of the report 'Main Report' is invalid.
An unexpected error occurred while compiling expressions.
Native compiler return value: ‘[BC2001] file 'C:\WINDOWS\TEMP\32gyhjpr.0.vb' could not be found’.
I had no clue from where the file name is coming. I found a reply here on this issue:
So – assigned proper permissions to Temp directory as specified in the URL above.
2. The other issue was – if I have both versions of ReportViewer assemblies installed (8.0 & 9.0). One looks for “rdlc” and other looks for “rdl” extension. Even if I explicitly mention the correct version number, the public key token is same for both the dlls in GAC– so I was getting the conflict always. To avoid this, I copied the dlls in my lib folder and marked as “CopyLocal” = true. This ensures on the server we will no be dependent on the installed version of these dlls. Following dlls were required for the ReportViewer to run successfully on a Win2003 box: