Write SSRS 2012 output to a folder in pdf format - sql

I have a task to run an SSRS report and export it to a folder in c drive. For the effort I tried to come up with below. I am running the statement below on the server where SSRS is installed. I want to be able to run this both on management studio as well as a job. Data driven subscriptions are not allowed for some internal reasons. So I had use XP_CMDshell.
I got the PrintPdfreport.exe from another team that is already using this functionality.
Exec master..XP_CMDSHELL 'C:\PrintPdfReport.exe "http://ServerName/Reportserver?/CIP Reporting/CIP Dashboard&rs:Command=Render&rs:Format=PDF" c:\Reports\DailyCIPDashBoard_20181029091327.pdf'
I am getting the access/authentication 403 error below. I am not sure how I can resolve this.
Output With Error below
Unhandled Exception: System.Net.WebException: The remote server
returned an error: (403) Forbidden.
at System.Net.HttpWebRequest.GetResponse()
at PrintPdfReport.Program.Main(String[] args) NULL

Assign the SQL Server service to run under an AD account (Domain\serviceaccount). Once you have that then add the account to reporting services with Browser access.
And grant that account read/write access to your target folder as well.

Related

SQL Server Integration Services 2016 error, cannot bulk load XML file

My SSIS package fails on "Execute SQL Talk" which executes a stored procedure trying to load XML file. I get the following error:
[Execute SQL Task] Error: Executing the query "exec [dbo].[AccuplacerXMLProcessing] ?" failed with the following error: "Cannot bulk load. The file "J:\Accuplacer\000753-001\16209412.xml" does not exist.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
However, when I execute the same stored procedure in SSMS when connected as the same user it succeeds.
Both SQL Server Agent job and execution via SSMS were done by the same Windows domain user. This user has bulkadmin role on the server.
File is located on the server where the job is running.
There should not be any issues accessing the file. I've spent all day staring at this and cannot figure it out.
J:\Accuplacer\000753-001\16209412.xml" does not exist
Either the file is not there or the user does not have access to it on some level.
I noticed that the file name in your error is different than in your screen shot.

SSIS: Unable to Read from Excel file from a UNC path when deployed to server

I appear to be unable to get my deployed SSIS package to read from a 1997-2003 Excel file.
I get stuck with the following 2 errors:
SSIS Error Code DTS_E_OLEDBERROR, Error code: 0x80004005 An OLE DB
record is available. Source Microsoft JET Database Engine, database
engine cannot open the file, it is already opened exclusively by
another user, or you need permission to view its data.
DTS_E_CANNOTAQUIRECONNECTIONFROMCONNECTIONMANAGER with Error code 0xC0202009
The package itself works with no issues when using SQL data tools on the server logged in as the service account only when deployed to server I see this issue.
To make this issue even more confusing I have setup and tried the following:
Runtime is set to 32 bit on the debugging menu on SQL data tools as well as the job configuration is set to use 32 bit runtime
I am able to UNC to the folder/file when logged in as the SQL service account
Any Ideas?
Thanks,
M
I figured it out in the end. Turns out I missed a step with the permissions.
Yes the Service account had permissions to the folder but I failed to add read permissions to the file itself.
Thanks for all comments/suggestions.
M

Issue with SSIS package executing procedure that reads from a file share

I have an SSIS Package that runs via a SQL job on a SSIS server (Server A) that executes a stored procedure on the database server (server B). This stored procedure does a Bulk insert from a file share that is located on the SSIS Server (Server A). However, every time that the stored procedure runs it fails with the follow error:
Execute Membership Process:Error: Executing the query "exec storedprocname ?, ?" failed with the following error: "Cannot bulk load because the file "\ServerA\TestLoads\Membership\Processing\filename.csv" could not be opened. Operating system error code 5(Access is denied.).". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
I am pretty positive that the issue is related to permissions. If I store the files on the database server (Server B) then it processes. Or if I run the proc manually, it will work.
When I execute the job on Server A it executes as the service account for that server. That account has full access to Server A and Server B (Admin in SQL and on the server). I believe what is happening is the credentials get passed the first time, but they are not continued once the stored proc runs. I ran wireshark on Server A (SSIS Server) so that I could see what was access the share and try to get some more information. What I found was that there was no account information being passed, it was just blank.
I went through a lot of steps just to try to see if could get that work such as granting everyone access to the share, enabling the guest account, allowing anonymous users, etc. Not stuff I would want to do, but trying to narrow down the issue. None of those worked.
I tried modify the stored proc to use WITH EXECUTE AS OWNER. Still did not work, but got a different error. Also tried a variety of other accounts to execute as and got the same error each time.
Execute Membership Process:Error: Executing the query "exec [storedprocname] ?, ?" failed with the following error: "Could not obtain information about Windows NT group/user '', error code 0x5.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Tried a variety of solutions that I found online to get this to work and nothing so far has done it.
I understand that is not an ideal solution. I was under the impression that the developers where using SSIS to load the file initially and then using SQL for the rest of the process which would have worked. But because SQL has to touch the file system it keeps failing. And at this stage, there is not the option of rewriting this. Additionally, this process will work if we move the files to the database server (Server B), but that eliminates a large need for us in having the SSIS server in the first place which was to get files being processed off of the database server
Any ideas on if there is a way to get the current solution to work? Basically, what I think I am needing is to run the SSIS package and for a way to pass credentials via the stored proc to the file share during that process.
We are using Windows Server 2012 R2 on both servers and SQL Server 2012 sp3 Developer edition.
Thanks for the help!
I've had this issue before, and I still don't fully understand Kerberos authentication, but that fixed it for me. It's something to do with "double-hop" of authentication i.e. creds going from SSIS, through SQL Server, to a network Server.
Try setting up Kerberos Authentication for SQL Server. There are detailed step-by-step instructions with screenshots here => Setup Kerberos Authentication for SQL Server
I understand this is like a "link-only" answer, but I don't want to copy-paste & plagiarize the author's original works i.e. blog post, hence the link.

Reporting Services Error: rsServerConfigurationError

The company I work for has locally a MS Server 2005, with SQL server 2005. The problem that they are facing is that although they can log in to their platform and do most of the things they want (like importing data into the database, editing etc.) they get the message below when they are trying to get a report:
Reporting Services Error: The Report Server has encountered a configuration error; more details in the log files (rsServerConfigurationError)
In the log file I can't find any error or any change. What should I do?

Error when trying to create subscriptions in reporting services

I am trying to set up reporting emailing SQL Server 2005 Reporting Services. When I click to save a subscription I recieve the following error:
An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help The SELECT permission was denied on the object 'sysservers', database 'mssqlsystemresource', schema 'sys'.
I was under the impression Reporting Services uses the role RSExecRole which is created during installation. Isn't mssqlsystemresources something that is not supposed to, and not easily touched?
This is most because the user doesn't have permissions setup correctly. Can you check if RSEXECROLE doesn't have any DENY permissions and has correct permissions on the reportserver db.
http://www.sqlservercentral.com/blogs/brian_kelley/archive/2007/11/6/3195.aspx
Based on the code in the above url, RSEXECROLE should have 323 rows on SQL Server 2005 SP3. Yours should match that.
Let me know what you find.