Create the DLL
- [https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCoQFjAA&url=http%3A//go.microsoft.com/?linkid=7729280&ei=kPeqU6roHtDgsASR7YGoCA&usg=AFQjCNGiitNJ-d11Tj28gSXiRagdju4fcQ&sig2=WH9JhYuw7C5fcP7kO76RFA&bvm=bv.69620078,d.cWc Download VS2008 ](Visual Basic Version) or pick up the installer launcher from S:\Accela\Custom Report Items. Install it. In Windows 7 and later it seems to create a shortcut at the top rather than in the folder area on the start menu so look there.
- The project source for this (probably just use the one we have since you will not need to set up permissions for it in Reporting Services as it is already there) is in the location mentioned above. Extract and open.
- If you are starting from scratch you will need to do three things to get the dll to work with windows and reporting services
- Sign it from the Project properties tab labeled signing
- Assert any special privledges you might be using such as system.net or system.data ( IE.
Dim myWebPermission As New WebPermission(PermissionState.Unrestricted)
myWebPermission.Demand() - You need to set up AllowPartiallyTrustedCallers on the DLL. (I can't find this in the code but I know I put it there ?)
- If you are starting from scratch you will need to do three things to get the dll to work with windows and reporting services
- Create a new shared public function and build your DLL.
Export to the Report Server
- Copy the DLL to the report server somewhere such as the desktop.
- If you have neccessary .net framework installed. Ex ; .Net 4.0 or .Net 3.5, then you can just copy Gacutil.exe from any of the machine and to the new machine.
1) Open CMD as adminstrator in new server.
2) Traverse to the folder where you copied the Gacutil.exe. For eg - C:\program files.(in my case).
3) Type the below in the cmd prompt and install.
[file system location]\gacutil.exe /I [file system location]\dllname
- Copy the DLL to the Report Server Folders (3 places) at something like
- C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies
- C:\Program Files\Microsoft SQL Server\MSRS10_50.SQLEXPRESS\Reporting Services\ReportServer\bin
- C:\Program Files\Microsoft SQL Server\MSRS10_50.SQLEXPRESS\Reporting Services\ReportManager\Bin
Edit the Report Server Configuration Files
- The files are at
- C:\Program Files\Microsoft SQL Server\MSRS10_50.SQLEXPRESS\Reporting Services\ReportServer\rssrvpolicy.config
- C:\Program Files\Microsoft SQL Server\MSRS10_50.SQLEXPRESS\Reporting Services\ReportManager\rsmgrpolicy.config
- C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSPreviewPolicy.config
- First edit the RSPreviewPolicy.config (on the machine you are testing on, not necessarily the report server. Wherever your Visual Studio is installed upon which you are doing the testing from development. I believe the DLL needs to be gacutil'd to both systems (report server and development machine) but maybe not) to test changes in developement before changing the config files on the actual server. Add something along the lines of what's below to the end of the file, changing the dll name to yours. It should be at the bottom of all codegroup sections and there should be two extra </codegroup> remarks below your section as it is a submember of other codegroups.
<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="COSReportingDLL" Description="COSReportingDLL. "> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\COSReportingDLL.dll" /> </CodeGroup> </CodeGroup> </CodeGroup> </PolicyLevel> - In the section such as below (if it doesn't exist, add under the first codegroup item towards the upper center of the file) set FullTrust in the Permission Name
<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Report_Expressions_Default_Permissions" Description="This code group grants default permissions for code in report expressions and Code element. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100512C8E872E28569E733BCB123794DAB55111A0570B3B3D4DE3794153DEA5EFB7C3FEA9F2D8236CFF320C4FD0EAD5F677880BF6C181F296C751C5F6E65B04D3834C02F792FEE0FE452915D44AFE74A0C27E0D8E4B8D04EC52A8E281E01FF47E7D694E6C7275A09AFCBFD8CC82705A06B20FD6EF61EBBA6873E29C8C0F2CAEDDA2" /> </CodeGroup></ - Supposedly there is a way to do this with caspol and adding your own security groups and then adding the dll with full permissions to that security group and then adding that security group to the report server configuration files but I couldn't get it to work. If need be, start with caspol and see where it takes you.
Test in Development Environment
- Open Visual Studio for reporting and open your report.
- Import the custom DLL by right clicking outside the report body and click 'Report Properties'.
- Under 'References' on the left and then 'add or remove assemblies' browse to your custom dll. I pulled it from private assemblies but I don't think the report server cares where it is since it is in trusted assemblies pool and is always pulled from the system?
- Go back to your report and use the custom assembly by calling the full name (IE: =COSReportingDLL.GetImage.GetImageFromWebToByteArray(Fields!Expr1.Value))
THE END
No comments:
Post a Comment