Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

Wednesday, March 7, 2012

Custom Destination Adapter

Hi All,

I have built a custom flat file destination adapter but it appears that the code is not working. When I debug the process I notice that the ProcessInput section is called multiple times. The first time it looks like everything is working, then it call it again and there is no inpout from the DTSInput90.

Why would it do this?

Thanks

Mike

Data moves down the pipeline in buffers. It is not one stream, or individual rows. Obviously buffers have a limited capacity, so you will get multiple buffers depending on the number of rows. The rows per buffer depends on the size of the row essentially.

So ProcessInput gets called once per buffer. This is why you cache buffer information in PreExecute, so that you get re-use. Querying the information can be quite expensive which is why it is cached to start with.

I'm not sure what you mean by "there is no inpout from the DTSInput90", can you explain?

|||Basically what I am saying is that the second time through there is no data. So if you want to capture all the data from the buffer and write it all out in a file how would you do that?|||

That doesn't sound particularly useful, but maybe how it works. Not sure I've ever stepped through to that degree. It should not cause you any problems however, but are you getting all the data you expect? Is there actually a problem?

|||

I figured it out. The detination component takes the input stream and creates a ZIP file with some delimiter that I have defined. I needed to create a global variable for the string and keep appending until then buffers were complete and then run through the ZIP code.

Thanks

Custom Destination Adapter

Hi All,

I have built a custom flat file destination adapter but it appears that the code is not working. When I debug the process I notice that the ProcessInput section is called multiple times. The first time it looks like everything is working, then it call it again and there is no inpout from the DTSInput90.

Why would it do this?

Thanks

Mike

Data moves down the pipeline in buffers. It is not one stream, or individual rows. Obviously buffers have a limited capacity, so you will get multiple buffers depending on the number of rows. The rows per buffer depends on the size of the row essentially.

So ProcessInput gets called once per buffer. This is why you cache buffer information in PreExecute, so that you get re-use. Querying the information can be quite expensive which is why it is cached to start with.

I'm not sure what you mean by "there is no inpout from the DTSInput90", can you explain?

|||Basically what I am saying is that the second time through there is no data. So if you want to capture all the data from the buffer and write it all out in a file how would you do that?|||

That doesn't sound particularly useful, but maybe how it works. Not sure I've ever stepped through to that degree. It should not cause you any problems however, but are you getting all the data you expect? Is there actually a problem?

|||

I figured it out. The detination component takes the input stream and creates a ZIP file with some delimiter that I have defined. I needed to create a global variable for the string and keep appending until then buffers were complete and then run through the ZIP code.

Thanks

Friday, February 24, 2012

Custom Code Error

I'm receiving an #ERROR where I've call a function created in the custom code section. The reports works fine in development debug mode, only errors after deploying to SSRS. Note the custom code contain code that access the database using the SYSTEMS.DATA.SQLCLIENT namespace classes. Is there a security access problem in SSRS reports server?I had the same problem..
I've created a custom assembly for that..

Imports System.Data.OracleClient
Imports System.IO

'Important to get it work within a report
<Assembly: System.Security.AllowPartiallyTrustedCallers()>

Public Class DB

'Write do Database
Public Shared Function writeBack(ByVal FehlerID As Integer) As String
Dim perm As New OraclePermission(Security.Permissions.PermissionState.Unrestricted)
perm.Assert()

Dim conn As New OracleConnection
conn.ConnectionString = "Data Source=DB;Unicode=True;user=scott;password=tiger;"
conn.Open()
Dim oracleCommand1 As New System.Data.OracleClient.OracleCommand
oracleCommand1.Connection = conn
oracleCommand1.CommandText = "update ben_mailversand set gesendet=1 where fehlerid=" & FehlerID
oracleCommand1.ExecuteScalar()
conn.Close()
writeBack = oracleCommand1.CommandText
End Function
End Class

Thats not exactly brilliant but I found no other way..

in rspolicy.conf you have to set this assembly to fulltrust..
|||

There is a reason why you will need to assert FullTrust permissions in the OracleClient case: If you read the MSDN documentation for the OraclePermission class and the SqlClientPermission class and compare them, you will notice the following statement:
"This class [i.e. OraclePermission] is intended for future use when the .NET
Framework Data Provider for Oracle is enabled for partial trust scenarios.
The provider currently requires FullTrust permission."
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoracleclientoraclepermissionclasstopic.asp

Note: The managed provider for SQL Server is enabled for partial trust scenarios, therefore it
is sufficient (and advisable) to just assert the SqlClientPermission when using it in custom assemblies.

-- Robert

|||

Thanks for your post, it led me in the right direction. I struggled for awhile but I've finally gotten it to work.

These are the items that took me awhile to figure out:

1. Placement of custom assemby on ReportsServer:

Must be placed in this directory "prior" to deploying report.

C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

2. rssrpolicy.config FullTrust entry:

There are two way to enter this for signed or unsigned assemblies, you need to enter the correct method.

Thanks again,

Mike