Wednesday, March 28, 2012
Is it possible to localize Report Manager using satellite assembly
I'm trying to localize Report Manager (Reporting Services 2005) by
implementing my own Finnish version of the resources in
ReportingServicesWebUserInterface.dll assembly.
I have the satellite assembly in the following folder:
C:\Program Files\Microsoft SQL Server\MSSQL.6\Reporting
Services\ReportManager\Bin\fi
I used the Assembly Linker tool (al) to create the assembly and used the
ReportingServicesWebUserInterface.dll in the base directory as the template.
I tried delay signing the assembly using my own key. Then I used the Strong
Name
Utility (sn) to add the assembly to skip verification list.
For some reason my satellite assembly is not loaded when I set my web
browser language to Finnish. If I set it to German it works ok. I have very
little .NET experience by I suspect that is due to the fact that the
sattelite assembly should be signed with the same key as the base assembly?
So is it possible to implement your own language version of the
ReportingServicesWebUserInterface.dll satellite assembly to use it to
localize report manager?
If it is possible is there any document that describes the process and the
related security issues?
If it's not possible then please tell me so that I can make a decision about
developing a new report portal web application. We would like to use the
Report Manager if we only could localize it.
I tried emailing the Gold Certified Partner support address, but got no
answer. Any assitance will be greatly appreciated.
Thank you,
Juho Salo> I tried emailing the Gold Certified Partner support address, but got no
> answer.
Scractch that. They actually called me instead of emailing, but my phone was
not on, stupid I know. I will post the answer here when I get it.
Juho|||I have received a very decisive answer from Microsoft.
Quote:
"You have asked if it is possible to implement your own language version of
the ReportingServicesWebUserInterface.dll satellite assembly to use it to
localize report manager. Unfortunately, this is NOT possible. The Report
Manager resource assemblies MUST be signed with a Microsoft key."
So if anyone else is wondering, if you need to localize Report Manager
easily it's not possible (unless ofcourse you live in one of those
priviledged countries that are provided with localization for it).
I'm off to writing my own report portal application then.|||I actually came up with a solution that is a bit of a hack but will do nicely
and let's me use the Report Manager. Just add the code below to all of the
aspx pages under the Report Manager\Pages folder
<script language=cs runat=server src= "Dictionary.cs"/>
<script language="C#" runat="server">
void Page_LoadComplete(object sender, EventArgs e) {
TranslateControls(Page);
}
private void TranslateControls(Control c)
{
Type t = c.GetType();
System.Reflection.PropertyInfo p = t.GetProperty("Text");
string s;
if (p != null) {
s = (string) p.GetValue(c, null);
if (s!= null ) {
if (s.Length > 0 ) {
if (p.CanWrite)
{
p.SetValue(c, Dictionary.Translate((string) p.GetValue(c, null)), null);
}
}
}
}
foreach (Control child in c.Controls)
{
TranslateControls(child);
}
}
</script>
Then just create some sort of implementation for the Dictionary class in the
Dictionary.cs file. The code above is not the final version but it works.
Comments are welcome.
Wednesday, March 21, 2012
Is it possible to create a UDF from a .NET 2.0 assembly that uses dllimport to call unmanaged co
I have been reading up on everything I can find on this subject and I am not clear if this is allowed within the SQL Server 2005 CLR. My function calls work within a Windows form project, but don't run when invoked from a SQL function. I don't get any errors or warnings when creating the assembly and functions within SQL Server, but when running via a select statement, the spid just hangs and I have to stop & restart the service to kill the process. I have been investigating the security settings for this assembly, but I think I have that covered via the RunTime Security Policy settings in the .NET Framework 2.0 Configuration tool.
Any insights, knowledge, or thoughts would be greatly appreciated.
Barry
Hi Barry,
Calling into a CLR function which in turn p-invokes into unmanaged code should work without issues, although we would usually recommend against this if you can avoid it, as it would require the assembly being registered as UNSAFE.
What is the unmanaged code doing? Is it possible to have a look at your SQL function?
Thanks!
-Mat
sqlIs it possible to create a DATASET through an Assembly?
Attempt: I tried to create a DataSet through an Assembly and have that assembly imbedded in the report. This way, I can just call code from the assembly (containing one dataset) and reference it to data from the dataset from the report.
Problem: I think it has something to do with permissions, since this method works only on 'preview' report but does not work when it is actually published.
All permissions for the assembly is set to full in both the reporting server and the report designer
<pre>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Database_Connector"
Description="Code group for connecting to databases">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\DatabaseConnector.dll"
/>
</CodeGroup>
</pre>I think you're right. I would post a question on
www.sqlreportingservices.net as Peter is the SME for CAS.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"John D." <John D.@.discussions.microsoft.com> wrote in message
news:F7939480-C490-410D-A9CE-6D8E1A865613@.microsoft.com...
> Problem: Trying to combine two datasets onto a single table for
x-referencing purposes. One dataset comes from a SQL Server and the other
comes from a File System processing unit. The File System dataset makes it
so that OpenRowSet can not be used.
> Attempt: I tried to create a DataSet through an Assembly and have that
assembly imbedded in the report. This way, I can just call code from the
assembly (containing one dataset) and reference it to data from the dataset
from the report.
> Problem: I think it has something to do with permissions, since this
method works only on 'preview' report but does not work when it is actually
published.
> All permissions for the assembly is set to full in both the reporting
server and the report designer
> <pre>
> <CodeGroup
> class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="Database_Connector"
> Description="Code group for connecting to databases">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\DatabaseConnector.dll"
> />
> </CodeGroup>
> </pre>
>|||Sounds like your assembly has a reference to some other assembly that
also needs to be granted FullTrust.
"William \(Bill\) Vaughn" <billvaRemoveThis@.nwlink.com> wrote in message news:<uUIFq64bEHA.4092@.TK2MSFTNGP11.phx.gbl>...
> I think you're right. I would post a question on
> www.sqlreportingservices.net as Peter is the SME for CAS.
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> __________________________________
> "John D." <John D.@.discussions.microsoft.com> wrote in message
> news:F7939480-C490-410D-A9CE-6D8E1A865613@.microsoft.com...
> > Problem: Trying to combine two datasets onto a single table for
> x-referencing purposes. One dataset comes from a SQL Server and the other
> comes from a File System processing unit. The File System dataset makes it
> so that OpenRowSet can not be used.
> >
> > Attempt: I tried to create a DataSet through an Assembly and have that
> assembly imbedded in the report. This way, I can just call code from the
> assembly (containing one dataset) and reference it to data from the dataset
> from the report.
> >
> > Problem: I think it has something to do with permissions, since this
> method works only on 'preview' report but does not work when it is actually
> published.
> >
> > All permissions for the assembly is set to full in both the reporting
> server and the report designer
> >
> > <pre>
> > <CodeGroup
> > class="UnionCodeGroup"
> > version="1"
> > PermissionSetName="FullTrust"
> > Name="Database_Connector"
> > Description="Code group for connecting to databases">
> >
> > <IMembershipCondition class="UrlMembershipCondition"
> > version="1"
> > Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\DatabaseConnector.dll"
> > />
> > </CodeGroup>
> > </pre>
> >|||Did you assert the necessary permissions in your code? What permission error
are you receiving? You should debug your code and find out what exact
permissions are required. Probably FileIOPermission and SqlPermission.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"John D." <John D.@.discussions.microsoft.com> wrote in message
news:F7939480-C490-410D-A9CE-6D8E1A865613@.microsoft.com...
> Problem: Trying to combine two datasets onto a single table for
x-referencing purposes. One dataset comes from a SQL Server and the other
comes from a File System processing unit. The File System dataset makes it
so that OpenRowSet can not be used.
> Attempt: I tried to create a DataSet through an Assembly and have that
assembly imbedded in the report. This way, I can just call code from the
assembly (containing one dataset) and reference it to data from the dataset
from the report.
> Problem: I think it has something to do with permissions, since this
method works only on 'preview' report but does not work when it is actually
published.
> All permissions for the assembly is set to full in both the reporting
server and the report designer
> <pre>
> <CodeGroup
> class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="Database_Connector"
> Description="Code group for connecting to databases">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\DatabaseConnector.dll"
> />
> </CodeGroup>
> </pre>
>
Monday, February 20, 2012
Is assembly code replaceable?
I'm watching a webcast on CLR functions/procs and have a question:
If I create an assembly for my database using some .dll, is that .dll now locked by SQL Server?
I'm concerned of a situation where developer says the assembly code is bad. Developer presents new version of .dll .
- Will I get "Access denied, file is in use" when I try to replace the .dll ? Even if the assembly is used in a derived table column?
Thanks.
The file is not present on the file system. The assemblies is loaded into the database so it has to be placed here. The only thing that could possible cause problems is that you can′t drop an assembly which is used by depended procedures / functions etc.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
In addition, if you would like to deploy a newer version of a dll you previously registered with the server (using create assembly statement), you can have a look at alter assembly statement.
-Mat
|||Good, I like that the file is no longer needed once uploaded into the database.
The ALTER ASSEMBLY statement looks promising, but is there anything that could hold an assembly-level lock because it's in use, preventing one from updating it?
Is there any sort of testing on dependents before being able to alter an assembly? For instance, I change an assembly method signature from one to two inputs, but database function expects to use one and only one. Another example, I remove a class that corresponded to a database type.
|||Extensive work has been made in ALTER ASSEMBLY to make sure that it doesn't break any dependencies, including Function/Procedure/Triggers entry-point, UDTs, computed column definitions, persisted CLR expressions, or any schema-bound database code in general, so you should not have any issues there.
The ALTER ASSEMBLY statement will take an exclusive lock on your assembly, and so it will have to wait until the current users of this assembly are done. This is not very different than when you modify other database objects.
Hope this helps!