|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, November 12, 2009 11:20 AM
Points: 1,
Visits: 10
|
|
Hi, Thank for this article. It was very helpful for understanding adding assemblies to reporting services. However, I have run into a problem. Everything worked like charm, in a report, I changed background-color of to the value I got from the the assembly created..etc until I tried to connect to a database and get the value from there. And the reporting services just displays #Error
The function that's connect to database is working fine. The reason is b/c I created Windows App that calls this function actually receives value from DB by calling this function.
The problem happens only when I call this from Reporting Services report. I'm thinking it's some kind of security issue? I hard-coded connection string to db in the function. basically, I used the exact same code as you posted in this article. I just changed values of connection string.
I appreciate any help or any response.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 5:01 AM
Points: 2,303,
Visits: 1,100
|
|
Hi chikako wakishima,
have you done the things I told , add the SQLClientpermission and codegroup. You have to do all of these to get the assambly running on RS.
Regards
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 2:46 PM
Points: 2,561,
Visits: 18,910
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 05, 2013 7:08 AM
Points: 116,
Visits: 329
|
|
Does anyone know of a good way to avoid hard-coding the database connection string? MyConnection = New SqlConnection("server=localhost;uid=USERNAME;pwd=PASSWORD;database=RSStyles")
It would be preferable to make use of an existing shared database connection, or have this database connection information stored in a config file, since it could well be the case that the connection string is different in dev and production.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, January 11, 2011 8:27 AM
Points: 1,
Visits: 7
|
|
A blog post I just wrote about how to set up the DLL to use an external XML file:
http://thinkdevcode.blogspot.com/
It goes over all of the security settings you need to get it to work. Comment on it if you have any problems/questions.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:13 PM
Points: 191,
Visits: 565
|
|
| Is anyone experiencing slow export to excel performance using this? Exporting to csv is very fast, but it can take minutes to export to excel.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:39 AM
Points: 1,
Visits: 36
|
|
Thanks a lot for tis code. I pretty much used as is, apart from one issue - This was the fact that the the database was hit too many times. for example for a matrix of substantial cells the database will be hit everytime a cell needs to be formatted.
To overcome that I used a a shared list of reportStyles that could be used between instances of the datadrivenstyle library. See below (following 2 lines are key - Private Shared reportStyles As List(Of ReportStyle) & If reportStyles Is Nothing Then):
Imports System.Data Imports System.Data.SqlClient Imports System.Security
Public Class DataDrivenStyleLibrary
'Declare shared item that can be shared between instances Private Shared reportStyles As List(Of ReportStyle)
Public Shared Function dbStyle(ByVal ReportSection As String, ByVal StyleType As String) As String
Dim sStyle As String sStyle = "" 'Check to see if reportstyles list exists already created and if it does not then create it If reportStyles Is Nothing Then reportStyles = New List(Of ReportStyle)
' Set up the command and connection objects Dim MyConnection As SqlConnection MyConnection = New SqlConnection("Data Source=IMGSERVER17; Initial Catalog=ReportServer; Integrated Security=SSPI;") Dim cmd As New SqlCommand cmd.Connection = MyConnection cmd.Connection.Open() cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "pr_GetStyle" ' Read the data, and populate report style list Dim ddlValues As SqlDataReader ddlValues = cmd.ExecuteReader() While ddlValues.Read Dim rStyle = New ReportStyle() rStyle.ReportSection = ddlValues.GetString(0) rStyle.StyleType = ddlValues.GetString(1) rStyle.StyleDefinition = ddlValues.GetString(2) reportStyles.Add(rStyle) End While 'Close any open connections cmd.Connection.Close() ' return the selected value to the calling proceure End If
'Loop up particular style from object For Each rs In reportStyles If rs.ReportSection = ReportSection And rs.StyleType = StyleType Then sStyle = rs.StyleDefinition Exit For End If
Next Return sStyle
End Function End Class
Friend Class ReportStyle
Private sType As String Private rSection As String Private sDefinition As String
Public Property StyleType() As String Get Return sType End Get Set(ByVal value As String) sType = value End Set End Property
Public Property ReportSection() As String Get Return rSection End Get Set(ByVal value As String) rSection = value End Set End Property
Public Property StyleDefinition() As String Get Return sDefinition End Get Set(ByVal value As String) sDefinition = value End Set End Property End Class
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 10:26 AM
Points: 81,
Visits: 857
|
|
Very nice! Thank you for suggesting this. It resolves the core weakness of the technique.
Regards,
Adam
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, June 20, 2012 12:10 PM
Points: 1,
Visits: 28
|
|
Hi, I've been trying to get this to work for days but I keep getting the permissions error that you all talked about. I've added all the suggested code (modified the rssrvpolicy.config file, updated the DynamicStyleLibrary and gave it "Full Trust"). Nothing works. Still get this error:
Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Can anyone help?
Thanks, Beth
P.S. I am NOT a developer. I know nothing about assemblies, but have had a developer look at this with me...we're both stumped.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 9:44 AM
Points: 1,
Visits: 33
|
|
Unfortunately, I am encountering the same problem...
It seems my namespace is not declared, despite setting up the Assembly Reference as instructed.
|
|
|
|