Showing posts with label successfully. Show all posts
Showing posts with label successfully. Show all posts

Wednesday, March 21, 2012

Error when file is saved to PDF

I am calling a procedure that will save a file to PDF. It runs successfully. When I go to look at the PDF, I get a message, "Acrobat reader could not open 'Doc.pdf' because it is either not a support file or because the file has been damaged."

This is how I'm calling the procedure:

SaveFile(Dts.Variables("varSSRS_URL").Value.ToString() + "?/TestReports/MyReport&rs:Command=Render&rs:Format=PDF", "C:\" + "MyReport.pdf")

Ifaber,

Is this a SSIS ralated issue? If so, please provide more details about the error, which task, etc...

|||I'm with Rafael. I cannot find a SaveFile function when searching in an SSIS script component.|||

Yes, this is a SSIS issue. I put this script in a Script Task.

See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1173906&SiteID=1&PageID=1 for reference. I have jumped through a lot of errors, and this is my last problem.

|||

ifaber wrote:

Yes, this is a SSIS issue. I put this script in a Script Task.

See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1173906&SiteID=1&PageID=1 for reference. I have jumped through a lot of errors, and this is my last problem.

In that case, you're going to have to provide your script for us to look at. The link you provided doesn't serve as a valid foundation for your question.

My question though, is where is the PDF data stream? You can't create a PDF file by merely adding a .pdf extension. The data going into SaveFile needs to be a PDF binary stream, I would think.|||

I don't know anything about a PDF data stream. I read somewhere else on the net that 'rs:Command=Render&rs:Format=PDF' would work.

This is the sample that I got and used:

//Sample call
SaveFile(Dts.Variables("varSSRS_URL").Value.ToString() + "?%2fYOUR_SSRS_FOLDER%2fYOUR_REPORT_NAME&rs:Command=Render&rs:Format=PDF", outpath + "FILENAME.pdf")

//Note that you can replace "EXCEL" by "CSV" or "PDF" or any other supported export format

//The get & save file method
Protected Sub SaveFile(ByVal url As String, ByVal localpath As String)
Dim loRequest As System.Net.HttpWebRequest
Dim loResponse As System.Net.HttpWebResponse
Dim loResponseStream As System.IO.Stream
Dim loFileStream As New System.IO.FileStream(localpath, System.IO.FileMode.Create, System.IO.FileAccess.Write)
Dim laBytes(256) As Byte
Dim liCount As Integer = 1

Try
loRequest = CType(System.Net.WebRequest.Create(url), System.Net.HttpWebRequest)
loRequest.Credentials = New System.Net.NetworkCredential(Dts.Variables("varSSRS_LOGIN").Value.ToString(), Dts.Variables("varSSRS_PASSWORD").Value.ToString(), Dts.Variables("varSSRS_DOMAIN").Value.ToString())
loRequest.Timeout = 1000 * 60 * 15 'timeout 15 minutes
loRequest.Method = "GET"
loResponse = CType(loRequest.GetResponse, System.Net.HttpWebResponse)
loResponseStream = loResponse.GetResponseStream
Do While liCount > 0
liCount = loResponseStream.Read(laBytes, 0, 256)
loFileStream.Write(laBytes, 0, liCount)
Loop
loFileStream.Flush()
loFileStream.Close()
Catch ex As Exception

End Try

End Sub

|||Unless you're having issues with the variables, this looks like it's an SSRS issue....

I think the thread already going in the SSRS forum would be more beneficial.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1199641&SiteID=1|||I had issues with the variables because I had a typo. Now it just won't create the PDF.|||

ifaber wrote:

I had issues with the variables because I had a typo. Now it just won't create the PDF.

Yep, then we might want to look at moving this back to the SSRS forum for starters. The code you are building isn't specific to SSIS (though you might be using SSIS variables) so we are likely not going to be able to help you any further.|||Ok...thanks|||

ifaber wrote:

Ok...thanks

Moved to the SSRS Forum to see if anyone over here has any ideas for this custom code.

ifaber is trying to build a PDF file using a reporting services call. The user is trying to perform this in an SSIS task, but the code the user has built isn't SSIS specific.

Thanks,
Phil Brammer
SSIS Moderator

Error when file is saved to PDF

I am calling a procedure that will save a file to PDF. It runs successfully. When I go to look at the PDF, I get a message, "Acrobat reader could not open 'Doc.pdf' because it is either not a support file or because the file has been damaged."

This is how I'm calling the procedure:

SaveFile(Dts.Variables("varSSRS_URL").Value.ToString() + "?/TestReports/MyReport&rs:Command=Render&rs:Format=PDF", "C:\" + "MyReport.pdf")

Ifaber,

Is this a SSIS ralated issue? If so, please provide more details about the error, which task, etc...

|||I'm with Rafael. I cannot find a SaveFile function when searching in an SSIS script component.|||

Yes, this is a SSIS issue. I put this script in a Script Task.

See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1173906&SiteID=1&PageID=1 for reference. I have jumped through a lot of errors, and this is my last problem.

|||

ifaber wrote:

Yes, this is a SSIS issue. I put this script in a Script Task.

See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1173906&SiteID=1&PageID=1 for reference. I have jumped through a lot of errors, and this is my last problem.

In that case, you're going to have to provide your script for us to look at. The link you provided doesn't serve as a valid foundation for your question.

My question though, is where is the PDF data stream? You can't create a PDF file by merely adding a .pdf extension. The data going into SaveFile needs to be a PDF binary stream, I would think.|||

I don't know anything about a PDF data stream. I read somewhere else on the net that 'rs:Command=Render&rs:Format=PDF' would work.

This is the sample that I got and used:

//Sample call
SaveFile(Dts.Variables("varSSRS_URL").Value.ToString() + "?%2fYOUR_SSRS_FOLDER%2fYOUR_REPORT_NAME&rs:Command=Render&rs:Format=PDF", outpath + "FILENAME.pdf")

//Note that you can replace "EXCEL" by "CSV" or "PDF" or any other supported export format

//The get & save file method
Protected Sub SaveFile(ByVal url As String, ByVal localpath As String)
Dim loRequest As System.Net.HttpWebRequest
Dim loResponse As System.Net.HttpWebResponse
Dim loResponseStream As System.IO.Stream
Dim loFileStream As New System.IO.FileStream(localpath, System.IO.FileMode.Create, System.IO.FileAccess.Write)
Dim laBytes(256) As Byte
Dim liCount As Integer = 1

Try
loRequest = CType(System.Net.WebRequest.Create(url), System.Net.HttpWebRequest)
loRequest.Credentials = New System.Net.NetworkCredential(Dts.Variables("varSSRS_LOGIN").Value.ToString(), Dts.Variables("varSSRS_PASSWORD").Value.ToString(), Dts.Variables("varSSRS_DOMAIN").Value.ToString())
loRequest.Timeout = 1000 * 60 * 15 'timeout 15 minutes
loRequest.Method = "GET"
loResponse = CType(loRequest.GetResponse, System.Net.HttpWebResponse)
loResponseStream = loResponse.GetResponseStream
Do While liCount > 0
liCount = loResponseStream.Read(laBytes, 0, 256)
loFileStream.Write(laBytes, 0, liCount)
Loop
loFileStream.Flush()
loFileStream.Close()
Catch ex As Exception

End Try

End Sub

|||Unless you're having issues with the variables, this looks like it's an SSRS issue....

I think the thread already going in the SSRS forum would be more beneficial.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1199641&SiteID=1|||I had issues with the variables because I had a typo. Now it just won't create the PDF.|||

ifaber wrote:

I had issues with the variables because I had a typo. Now it just won't create the PDF.

Yep, then we might want to look at moving this back to the SSRS forum for starters. The code you are building isn't specific to SSIS (though you might be using SSIS variables) so we are likely not going to be able to help you any further.|||Ok...thanks|||

ifaber wrote:

Ok...thanks

Moved to the SSRS Forum to see if anyone over here has any ideas for this custom code.

ifaber is trying to build a PDF file using a reporting services call. The user is trying to perform this in an SSIS task, but the code the user has built isn't SSIS specific.

Thanks,
Phil Brammer
SSIS Moderator

Monday, March 19, 2012

Error when creating schedule in Report Manager

Hello,

Scenario:

I am trying to set up a shared schedule in report manager after successfully deploying the reports to my server. I have set up the linked reports and AD permissions, however when I want to either set up a shared schedule, or an individual schedule I encounter the error below.

System details:

Microsoft SQL Server 2005 - 9.00.2050.00 (Intel X86) Feb 13 2007 23:02:48 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

Report Manager Error:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) The specified @.category_id ('100') does not exist.

The error log does not contain any infor regarding this error, and I've searched for this error extensively in Google as well as microsoft.com, however can't seem to find a resolution for it.

I have also tried to create the schedule in SQL Server Management Studio. The complete error message is as follows:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) (Report Services SOAP Proxy Source)

Additional information:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) (ReportingServicesLibrary)

The specified @.category_id ('100') does not exist. () (.Net SqlClient Data Provider)

Please could you send me any further info about how to solve this problem and resolve the error.

Thank you

Sune de Vos

Hi,
It looks like you did not have permission to setup category on database server in msdb.
try this:
use msdb

set IDENTITY_INSERT syscategories ON
insert into syscategories(category_id,category_class,category_type,name) values(100,1,1,'Report Server')
set IDENTITY_INSERT syscategories OFF

you need to be sysadmin to run this.
It seems to work after that - did not test how it will behave later, so be careful.
Best Regards

Wednesday, March 7, 2012

Error using neural network mining model viewer

I've successfully created and processed a very simple neural network mining model (defined against a cube). However, when I go to the model viewer in BI studio, it displays the following error:

"Execution of the managed stored procedure GetAttributeScores failed with the following error: Exception has been thrown by the target of an invocation.Input string was not in a correct format.."

Any ideas about what's going wrong? This is with SQL Server 2005 SP1.

Hello,

Some issues with the neural network viewer were fixed for Service Pack 2. You can download the latest technology preview (CTP2) for SP2 from here http://www.microsoft.com/downloads/details.aspx?FamilyID=7A9AD90F-7F95-4369-A206-E84053D63FD3&displaylang=en

If this is not an option, or it does not solve the problem with your model, could you provide a few details about the mining models? (columns, their content type , data type).

thanks

|||Going to the SP2 beta a bit problematic for us right now. Any idea when it's suppose to RTM?

I've been playing around with different variations of the mining structure - mostly super-simple structures (I'm just dipping my toes in the DM waters here). The results seem to vary. For example, a two attribute structure - a text key column and a double continuous Predict column results in the error

"Internal error: An unexpected exception occured.
Execution of the managed stored procedure GetAttributeScores failed with the following error: Exception has been thrown by the target of an invocation.Object reference not set to an instance of an object.."

I then added a nested table as an input (a text key column), and after that get a different error:

"Execution of the managed stored procedure GetAttributeScores failed with the following error: Exception has been thrown by the target of an invocation.Input string was not in a correct format.."

Processing the model and doing prediction queries seems to work OK, but the Mining Model Viewer is just completely broken.|||SP2 is scheduled for release in Q1 '07. If this becomes a blocking issue for you, please contact support (start at support.microsoft.com)

Error using Copy Database Wizard in SSMS - SQL 2000 to SQL 2005

I have successfully used the Copy Database wizard in the past to copy from
SQL 2000 to SQL 2005 - both on my machine.
But now I always get an error at the Finsih step saying: "No description
found"
This occurs on the 3rd step of the process - Create Package.
I have tried changing all the options but always get the same error.
Les
lmcphee (lmcphee@.discussions.microsoft.com) writes:
> I have successfully used the Copy Database wizard in the past to copy from
> SQL 2000 to SQL 2005 - both on my machine.
> But now I always get an error at the Finsih step saying: "No description
> found"
> This occurs on the 3rd step of the process - Create Package.
> I have tried changing all the options but always get the same error.
Have you looked in the event log, which is where CDW logs by default.
(And it logs on the receiving server, not necessarily the one you
initiated the process from.) You can also redirect logging to a text
file.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx