to the SSRS server?
I see ways to get the reports in other formats (html, pdf, etc.), but not a way to get the report in a format that can later be opened with the ReportViewer component.
Thank you in advance for any help!
I see ways to get the reports in other formats (html, pdf, etc.), but not a way to get the report in a format that can later be opened with the ReportViewer component.
Thank you in advance for any help!
I see ways to get the reports in other formats (html, pdf, etc.), but not a way to get the report in a format that can later be opened with the ReportViewer component.
Thank you in advance for any help!
Server Software:
SQL Server 2000 (all sp's up to date)
SSRS 2000 (all sp's up to date)
We have an error when a report subscription is sent via email.
Our report definitions reference a key in the web.config file so that we can have a single location to reference our department's name in all reports. Our department name changes frequently as our company is bought and sold and it is difficult to manually update 700+ reports.
In report designer we have a text field with the following value expression:
=System.Configuration.ConfigurationSettings.appSettings("Department").ToString()
Our web.config looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
....extra settings truncated for brevity...
<appSettings>
<add key="Department" value="Report created by: Corporate Reporting and Analysis" />
</appSettings>
</configuration>
The reports work perfectly in every aspect accept when they are schedules to be emailed. When the email recipient receives the email (not matter what format, mhtl, pdf, etc...) the department string value is replaced with: #Error
Is this a bug with the report schedule and deilvery component? ..or is there a permission problem when accessing: System.Configuration.ConfigurationSettings.appSettings("Department").ToString() ?
Any help would be greatly appreciated.
Thank you ![]()
Well, I believe I solved the issue:
The report scheduling service is located in another folder:
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\ReportingServicesService.exe
...and its configuration file is called:
ReportingServicesService.exe.config
All we had to do was modify this config file to match our web.config appSettings and "Presto!" it worked.
<configuration>
....extra settings truncated for brevity...
<appSettings>
<add key="Department" value="Report created by: Corporate Reporting and Analysis" />
</appSettings>
</configuration>
Also, remember to restart the "ReportServer" service after updating the ReportingServicesService.exe.config file in order to immediately reset the changes.
![]()
Hi dear reader
I made an application that uses a Sql Server 2005 Express DataBase.
In the database I made a application role.
When the user logs into my application I run this procedure:
If Not sqlConnectionCR Is Nothing Then
If Not sqlConnectionCR.State = ConnectionState.Open Then
sqlConnectionCR.Open()
SqlConnection.ClearAllPools()
ConsultasSqlCommand = New SqlCommand
ConsultasSqlCommand.CommandType = CommandType.Text
ConsultasSqlCommand.CommandText = "sp_setapprole 'appRole', 'drowssap"
ConsultasSqlCommand.Connection = sqlConnectionCR
ConsultasSqlCommand.ExecuteNonQuery()
End If
Else....
I understand that this procedure connects to my sqlserver database as my application role
Ok, so far no problems in reading and manipulating data.
The problem comes with the reports in my application. For example: I have a reportviewer with a serverreport but when I try to show the report gives an error about permissions and grant access....
I think that is because the Server Report uses the user account (domain/user) to read the database. No user (besides admin) has access permissions in the database (only admin and application role).
So, my cuestion is: How can I tell Report Server to use the application role to display reports?
Thank you for your time and help.
Giber
Your report application should also set the application role, which should have access to the database.
Thanks
Laurentiu
I develop my Server Reports in SQL Server Business Intelligence (VS2005)
I can't seem to find where or how to tell BI how to connect to the DB using the application role.
To connect im using just: "Data Source=localhost\SQLEXPRESS;Initial Catalog=ConsultasSql" in the data view seccion of the report (rdl) designer.
Greetings
|||I am not familiar with Server Reports or SQL Server Business Intelligence, but hopefully explaining how application roles work may be useful.
Application roles or approles are database-scoped principals that require no permissions (other than being able to access the database where they are defined) to be set as the execution context at run time, but require the knowledge of a password. Approles can only be set at ad-hoc level, this means that the call to sp_setapprole cannot be part of a stored procedure body or within a user defined transaction. More detailed information is available on BOL: Sp_setapprole http://msdn2.microsoft.com/en-us/library/ms188908.aspx
If the Server Reports definition allow you to define ad-hoc statements, it may be possible to call sp_setapprole as the first statement. I would recommend asking for information on how to customize these reports in the SQL Server Integration Services forum (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1).
An alternative could be to use the new impersonated mechanism (EXECUTE AS) or digital signatures in a stored procedure or user defined function to retrieve the data from the database without granting permissions beyond executing the SP. You can find more information on this topic in BOL, a good starting point is Context switching: http://msdn2.microsoft.com/en-us/library/ms188268.aspx
-Raul Garcia
SDE/T
SQL Server Engine
|||Im putting this thread under SQL Reporting Services Forum.
Also Im going to check that Execute As clause.
Tnx a lot
Giber
Hi dear reader
I made an application that uses a Sql Server 2005 Express DataBase.
In the database I made a application role.
When the user logs into my application I run this procedure:
If Not sqlConnectionCR Is Nothing Then
If Not sqlConnectionCR.State = ConnectionState.Open Then
sqlConnectionCR.Open()
SqlConnection.ClearAllPools()
ConsultasSqlCommand = New SqlCommand
ConsultasSqlCommand.CommandType = CommandType.Text
ConsultasSqlCommand.CommandText = "sp_setapprole 'appRole', 'drowssap"
ConsultasSqlCommand.Connection = sqlConnectionCR
ConsultasSqlCommand.ExecuteNonQuery()
End If
Else....
I understand that this procedure connects to my sqlserver database as my application role
Ok, so far no problems in reading and manipulating data.
The problem comes with the reports in my application. For example: I have a reportviewer with a serverreport but when I try to show the report gives an error about permissions and grant access....
I think that is because the Server Report uses the user computer account (domain/user) to read the database. No user (besides admin and application role) has access permissions in the database.
So, my cuestion is: How can I tell Report Server to connect to the DB using the application role in the DB?
Thank you for your time and help.
Giber
I don't see how you could do this. You could try experimenting by placing the call to sp_setapprole within the query window just before the select to see if it would execute the query in the correct context. I'm not sure whether RS reuses connections to execute multiple dataset queries so you may need to put this in every query. Like I said, never tried it, so you'll need to experiment.|||All my reports use stored procedures to populate the DataSet.
I put Execute As in the stored procedure to impersonate the user:
ALTER PROCEDURE [dbo].[usp_Cheque]
@.CRS nvarchar(50)
EXECUTE AS 'dbo'
AS
BEGIN
DECLARE @.Temp AS nvarchar(50)
SET NOCOUNT ON;
CREATE TABLE #Temp(CRS BigInt)
WHILE LEN(@.CRS) > 0
IF CHARINDEX(',',@.CRS) = 0
BEGIN
SET @.Temp = @.CRS
INSERT INTO #Temp VALUES(@.Temp)
SET @.CRS = ''
END
ELSE
BEGIN
SET @.Temp = LEFT(@.CRS,CHARINDEX(',',@.CRS)-1)
INSERT INTO #Temp VALUES(@.Temp)
SET @.CRS = RIGHT(@.CRS,LEN(@.CRS)-LEN(@.Temp)-1)
END
END
SELECT
Nombre,
NomCheque,
NumCR,
FechaCR,
Importe
FROM
CatProveedores INNER JOIN ContraRecibos
ON CatProveedores.CveProveedor = ContraRecibos.CveProveedor
WHERE
NumCR IN (SELECT CRS FROM #Temp)
But Im still getting that EXECUTE PERMISSION denied on usp_Cheques .....dbo' Error when trying to display the report
I have to give users Domain\Administrator Windows Role so they view the reports and then change their users back to Domain\Users when reporting is done...
|||Let me try to explain it again (my english is not so good)
When a user try to log in the database (throught my application), the application run a setapprole. So the user is not the one connecting directly to the database, if fact, no user can connect to the database (only domain\administrators). Is the application role (that as all privileges) the one that give access to tables, sp, view, etc...
How can I do so in Reporting Services? RS tries to enter the database as the computer user, but as I said before, no computer user can enter the database, I need to tell RS that when trying to connect to the database, run the set approle command.
How do I do that?
Thank's for your attention.
Giber
|||Hi Giber,
What are the credentials you are using for your datasource for stored procedures?
If you use sa or some admin role for data source credentials, the report should be able to run the stored procedure in the database. You can try running the report(preview) in local mode.
Also, if you are trying to control access for your reports, you can create different roles and groups and assign groups to these roles in SQL Server 2005 Reporting services. Or you can control the access for each report by giving appropriate permissions directly to that particular user or group. You will have to manuaaly ensure that the groups you make for Reporting Services match with the ones in SQl Server database.
Hope this will solve your problem.
Regards
Good Morning..
We're having a heck of a good time trying to implement our first CDE project in SSRS 2005.
In our SDE class library we have included an App.Config file where we want to store configuration settings..
Trouble is that when we view the configuration settings or connection string settings in debug mode, they're not being read for some reason..
Here's our app.config file:
-
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="eventLogName" value="FocusDPEEventLog" />
</appSettings>
<connectionStrings>
<add name="PassConnString" connectionString="Data Source=SOMEDATASOURSE;Persist Security Info=True;User ID=SOMEUSERNAME;Password=SOMEPASSWORD;Unicode=True"
providerName="System.Data.OracleClient" />
</connectionStrings>
</configuration>
-
Here's what our Immediate window Debugger is tellin' us about our configuration settings:
-
ConfigurationManager.AppSettings
{System.Configuration.KeyValueInternalCollection}
[System.Configuration.KeyValueInternalCollection]: {System.Configuration.KeyValueInternalCollection}
base {System.Collections.Specialized.NameObjectCollectionBase}: {System.Configuration.KeyValueInternalCollection}
AllKeys: {Dimensions:[0]}<-incorrect should be 1
ConfigurationManager.ConnectionStrings
Count = 1 <-ok, is one, but the wrong 1, see 3 lines down...
base {System.Configuration.ConfigurationElementCollection}: Count = 1
ConfigurationManager.ConnectionStrings[0]
{data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true}<--Should be PassConnString
base {System.Configuration.ConfigurationElement}: {data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true}
ConnectionString: "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
Name: "LocalSqlServer"
ProviderName: "System.Data.SqlClient"
Now notice the stuff in bold...I have NO IDEA where this gosh-danged thing is reading, but it doesn't seem like it's the app.config file in our class library...
thanks..
Doug
Hi
I am facing the same problem. I dont know where to set the custom configuration settings. I am pretty sure it will have to be somewhere in Report Server Config files, but where?
Regarding the stuff in bold you are seeing is coming from the base asp.net machine settings.
Good Morning..
We're having a heck of a good time trying to implement our first CDE project in SSRS 2005.
In our SDE class library we have included an App.Config file where we want to store configuration settings..
Trouble is that when we view the configuration settings or connection string settings in debug mode, they're not being read for some reason..
Here's our app.config file:
-
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="eventLogName" value="FocusDPEEventLog" />
</appSettings>
<connectionStrings>
<add name="PassConnString" connectionString="Data Source=SOMEDATASOURSE;Persist Security Info=True;User ID=SOMEUSERNAME;Password=SOMEPASSWORD;Unicode=True"
providerName="System.Data.OracleClient" />
</connectionStrings>
</configuration>
-
Here's what our Immediate window Debugger is tellin' us about our configuration settings:
-
ConfigurationManager.AppSettings
{System.Configuration.KeyValueInternalCollection}
[System.Configuration.KeyValueInternalCollection]: {System.Configuration.KeyValueInternalCollection}
base {System.Collections.Specialized.NameObjectCollectionBase}: {System.Configuration.KeyValueInternalCollection}
AllKeys: {Dimensions:[0]}<-incorrect should be 1
ConfigurationManager.ConnectionStrings
Count = 1 <-ok, is one, but the wrong 1, see 3 lines down...
base {System.Configuration.ConfigurationElementCollection}: Count = 1
ConfigurationManager.ConnectionStrings[0]
{data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true}<--Should be PassConnString
base {System.Configuration.ConfigurationElement}: {data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true}
ConnectionString: "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
Name: "LocalSqlServer"
ProviderName: "System.Data.SqlClient"
Now notice the stuff in bold...I have NO IDEA where this gosh-danged thing is reading, but it doesn't seem like it's the app.config file in our class library...
thanks..
Doug
Hi
I am facing the same problem. I dont know where to set the custom configuration settings. I am pretty sure it will have to be somewhere in Report Server Config files, but where?
Regarding the stuff in bold you are seeing is coming from the base asp.net machine settings.
Thanks
The PI Sytem does indeed support OLEDB and ODBC access. For more info, please contact OSIsoft Technical Support at techsupport@.osisoft.com for assistance. Reference the system number of the PI Server which you are inquiring on behalf of when you send in your question.
Thanks, Steve Nye, OSIsoft Technical Support
Thanks
The PI Sytem does indeed support OLEDB and ODBC access. For more info, please contact OSIsoft Technical Support at techsupport@.osisoft.com for assistance. Reference the system number of the PI Server which you are inquiring on behalf of when you send in your question.
Thanks, Steve Nye, OSIsoft Technical Support
sql server tools,sql server