Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Tuesday, March 27, 2012

Customized Delivery Extension

I am developing a customized delivery extension and I am trying to
write the stream renderedoutputfile[] to a file on the server. When I
write it to a file, the file is blank with a bunch of spaces in it. Do
I need to decode the Stream? Any help would be great.
Here is the code I am using.
This is inside the Delivery Method..
deviceInfo = String.Format(@."<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>","PDF");
// Render report
files = notification.Report.Render("PDF",deviceInfo);
BinaryReader br = new BinaryReader(m_files[0].Data);
byte[] byteData = new byte[(int)m_files[0].Data.Length];
int j = br.Read(byteData,0, (int)m_files[0].Data.Length);
FileStream fst = new FileStream(@."c:\temp\test.pdf", FileMode.Append,
FileAccess.Write);
BinaryWriter writer = new BinaryWriter(fst);
writer.Write(byteData,0,byteData.Length);
writer.Flush();
writer.Close();
What I am doing wrong? Code is in c#.Is it as simple as:
files = notification.Report.Render("PDF",deviceInfo);
=> note you're writing to local variable files
BinaryReader br = new BinaryReader(m_files[0].Data);
=> note you're reading from member variable m_files
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"jason" <obryan7@.hotmail.com> wrote in message
news:d16403e7.0407180926.620e1a79@.posting.google.com...
> I am developing a customized delivery extension and I am trying to
> write the stream renderedoutputfile[] to a file on the server. When I
> write it to a file, the file is blank with a bunch of spaces in it. Do
> I need to decode the Stream? Any help would be great.
> Here is the code I am using.
> This is inside the Delivery Method..
> deviceInfo =String.Format(@."<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>","
PDF");
> // Render report
> files = notification.Report.Render("PDF",deviceInfo);
> BinaryReader br = new BinaryReader(m_files[0].Data);
> byte[] byteData = new byte[(int)m_files[0].Data.Length];
> int j = br.Read(byteData,0, (int)m_files[0].Data.Length);
> FileStream fst = new FileStream(@."c:\temp\test.pdf", FileMode.Append,
> FileAccess.Write);
> BinaryWriter writer = new BinaryWriter(fst);
> writer.Write(byteData,0,byteData.Length);
> writer.Flush();
> writer.Close();
> What I am doing wrong? Code is in c#.

Sunday, March 25, 2012

Customer table and customer address table

I am trying to do a select query where I select the customer
information from the customer table and from the customer address file
only one address. If the address file for the customer has a
address_type= A and B and C I want C. If it has A and B I want B and if
it only has A I want A. Is this doable with a query
SELECT customers.acct_no, customers.company, customers.territory,
customers.telephone, customers.fax, customers.AP_contact,
customers.AP_telephone, customers.send_stmts, customers.tax_code,
customers.tax_code, customers.stmt_code, customers.date_added,
cust_addresses.address_type, cust_addresses.address_1,
cust_addresses.address_2, cust_addresses.city, cust_addresses.state,
cust_addresses.postal_code, cust_addresses.country,
cust_addresses.telephone
FROM customers LEFT JOIN cust_addresses ON customers.acct_no = cust_addresses.acct_no
WHERE (((customers.acct_no)>"000114"))
The above gives me all the addresses and I want only onehi you can use CASE statement
For Example:
SELECT customers.acct_no, customers.company, customers.territory,
customers.telephone, customers.fax, customers.AP_contact,
customers.AP_telephone, customers.send_stmts, customers.tax_code,
customers.tax_code, customers.stmt_code, customers.date_added,
'cust_addresses.address_1'= CASE
WHEN cust_addresses.address_type = A and B and C THEN C
WHEN cust_addresses.address_type= A and B THEN B
WHEN cust_addresses.address_type= A THEN A
END,
FROM customers LEFT JOIN cust_addresses ON customers.acct_no =cust_addresses.acct_no
WHERE (((customers.acct_no)>"000114"))
ORDER BY cust_addresses.address_type
GO
You can refer to books online
byesql

Tuesday, March 20, 2012

Custom Source extension & file permissions

I programmed a Source extension, that accesss a text file. In my code I have the following code to open a file:

protected override void reader(PipelineBuffer buffer)

{

TextReader reader = File.OpenText(_filename);

The komponnet works well. How do I grant permissions to access this text file? Because I got problems when I try to run my package using a task created in the SQL Server Agent.

This sounds like a how do I use windows file security question, not a SSIS issue at all. Simple, use Windows Explorer, and select the drive, folder or file and right-click to access the security tab. Is that really what you are asking?

Have you determined the security context (account) used by SQL Agent? You will of course need to do this to grant that account with the correct permissions.

This also seems unrelated to the component used.

|||

I coudn't access the resources. I used the following \\server\share

And it works!

Monday, March 19, 2012

Custom Role Provider Everthing working except roles??

Hello Everyone,

I am trying to use a custom role provider, the main purpose so that I don't have to use a database file. My web.config file is posted below. My problem is that I think I have followed all the steps to create a custom role provider using both articles on MSDN and some written by Scott Gu. After Modifying my web.config file I went to the asp.net configuration to test the connection. Users are created in the remote database but roles are being picked up and created in the App_Data folder. Can anyone give me a hint at what I am doing wrong? thanks in advance.

<?

xmlversion="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

appSettings/>

<

connectionStrings>

<

addname="MyConnectionString"connectionString="Data Source=10.10.10.10;Database=MyDataBase;Persist Security Info=True;User ID=user;Password=password"providerName="System.Data.SqlClient"/>

</

connectionStrings>

<

system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

<

roleManagerenabled="true"/>

<

membershipdefaultProvider="CustomSQLRoleManager">

<

providers>

<

clear/>

<

addname="CustomSQLRoleManager"type="System.Web.Security.SqlMembershipProvider"connectionStringName="MyConnectionString"applicationName="MyAppllicationName"minRequiredPasswordLength="6"minRequiredNonalphanumericCharacters="0"requiresQuestionAndAnswer="false"requiresUniqueEmail="true"/>

</

providers>

</

membership>

<

compilationdebug="true">

<

assemblies>

<

addassembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<

addassembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<

authenticationmode="Forms"/>

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

</

system.web>

</

configuration>

Ok. I figured out what I was missing and bolded the lines that I added to my web.config file

<?

xmlversion="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

appSettings/>

<

connectionStrings>

<

removename="LocalSqlServer"/>

<

addname="MyConnectionString"connectionString="Data Source=10.10.10.10;Database=MyDatabase;Persist Security Info=True;User ID=User;Password=password"providerName="System.Data.SqlClient"/>

</

connectionStrings>

<

system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

<

roleManagerenabled="true"defaultProvider="CustomSQLRoleManager">

<

providers>

<

clear />

<

addconnectionStringName="MyConnectionString"applicationName="MyApp"name="CustomSQLRoleManager"type="System.Web.Security.SQLRoleProvider" />

</

providers>

</

roleManager>

<

membershipdefaultProvider="SQLRoleManager">

<

providers>

<

clear/>

<

addname="SQLRoleManager"type="System.Web.Security.SqlMembershipProvider"connectionStringName="MyConnectionString"applicationName="MyApp"minRequiredPasswordLength="6"minRequiredNonalphanumericCharacters="0"requiresQuestionAndAnswer="false"requiresUniqueEmail="true"/>

</

providers>

</

membership>

<

compilationdebug="true">

<

assemblies>

<

addassembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<

addassembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<

authenticationmode="Forms"/>

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

</

system.web>

</

configuration>|||

Ok. I figured out what I was missing and bolded the lines that I added to my web.config file

<?

xmlversion="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

appSettings/>

<

connectionStrings>

<

removename="LocalSqlServer"/>

<

addname="MyConnectionString"connectionString="Data Source=10.10.10.10;Database=MyDatabase;Persist Security Info=True;User ID=User;Password=password"providerName="System.Data.SqlClient"/>

</

connectionStrings>

<

system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

<

roleManagerenabled="true"defaultProvider="CustomSQLRoleManager">

<

providers>

<

clear />

<

addconnectionStringName="MyConnectionString"applicationName="MyApp"name="CustomSQLRoleManager"type="System.Web.Security.SQLRoleProvider" />

</

providers>

</

roleManager>

<

membershipdefaultProvider="SQLRoleManager">

<

providers>

<

clear/>

<

addname="SQLRoleManager"type="System.Web.Security.SqlMembershipProvider"connectionStringName="MyConnectionString"applicationName="MyApp"minRequiredPasswordLength="6"minRequiredNonalphanumericCharacters="0"requiresQuestionAndAnswer="false"requiresUniqueEmail="true"/>

</

providers>

</

membership>

<

compilationdebug="true">

<

assemblies>

<

addassembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<

addassembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<

authenticationmode="Forms"/>

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

</

system.web>

</

configuration>

Custom Report Item

Hello.
I need to write a CRI which will update a attribute in the RDL file.
Can anyone point me in the right direction.
This is my view I
will have a textbox and a button on the CRI.
While building a report through BI , the report author adds CRI.
enter a value in the text box and click ok.
Then the text in the textbox needs to be added to the RDL file.
Thanks!!
RadhikaHello,
Does any one have ideas.
Thanks!!
"Radhika" wrote:
> Hello.
> I need to write a CRI which will update a attribute in the RDL file.
> Can anyone point me in the right direction.
> This is my view I
> will have a textbox and a button on the CRI.
> While building a report through BI , the report author adds CRI.
> enter a value in the text box and click ok.
> Then the text in the textbox needs to be added to the RDL file.
>
> Thanks!!
> Radhika

Sunday, March 11, 2012

Custom Render

I wonder if someone may be able to help. I have had a request to output a report from Reporting Services 2005 as a Pipe delimited file. I know it is possible to create custom renderers but I'm not sure how this is done. I've read http://msdn.microsoft.com/msdnmag/issues/05/02/CustomRenderers/ but I don't have much experience of VB.Net.

Any help would be much appreciated

Thanks

Adam

Hello, you can use the existing CSV renderer to export a pipe delimited file. You can use the FieldDelimiter DeviceInfo parameter to change the delimiter character:

http://msdn2.microsoft.com/en-us/library/ms155365.aspx

-Chris

Custom Object in SSIS

I wrote a C# class that has a couple of methods that can be called to grab data out of a flat file and import it to a DB. This class was written for a web applicaiton originally. (class has many complex business rules in it)

Now I would like to use this same class in a SSIS package.

Is it possible in a script task to create a new object with my class and use it's methods?

In the end all I want SSIS to do is create my object, call a method in that object and be done.

If I was doing this in DTS, I would have to create an .Net EXE that used my class but I'm hoping to avoid that in SSIS.

Frenchy

The simplest way would be to use the class as-is, and just reference it from a Script Task, which gives you a VB.Net environment to create your class and call your methods as required. You can also leverage connections and variables for a more integrated and dynamic approach if required. You will need to place your assembly in a defined folder to get the Add Reference to work on VSA, the script environment used by SSIS - http://msdn2.microsoft.com/en-us/library/ms136007.aspx|||

I also need the same. My code is in C# and that could not be converted in VB.NET. Did you find any way to invoke C# class ? Please let me know also If you find any solution.

Thanks,

Pooja

|||

Pooja B wrote:

I also need the same. My code is in C# and that could not be converted in VB.NET. Did you find any way to invoke C# class ? Please let me know also If you find any solution.

Thanks,

Pooja

Darren answered this question already (above). Is anythig not clear?

-Jamie

|||

Thanks Jamie. No its clear but I am totally new to SSIS so dont have that much understanding. Can you send me some sample code that is accessing already existing classes in Script task.

Thank you so much...

Pooja

|||If you follow the steps in Darren's post (adding a reference to the .dll that holds your custom code), then you just create a new instance of the object and begin using it - just like you would in any .NET code.|||

For adding a reference to required dlls we need to make them strongly typed. I made them strongly typed and added them to ../windows/microsoft.net/framework/2.0.., then I am able to run my code sucessfully but could not access these dlls in SSIS package. When I add these dlls in GAC then I could access the dlls in SSIS packages but then my application starts giving errors as it gould not refer some of the dlls because of making it strongly named. Can you please suggest what could be the problem. I am using microsoft enterprise libraries in my code.

Thanks,

Pooja

|||This is really a question for a different forum - you might try one of the groups under .NET Development.|||

PLEASE help us to help you-

What application gives these errors?

What are the errors?

An existing application that referenced non-strong named assemblies should keep working fine, assuming you have left the old assemblies in place. It would however make senses to updae your code to use the new strong named version so that all code, SSIS and other applictions, share the same common assemblies.

|||

Thanks for your reply. I am able to fix that problem. In my appplication as I strongly named the assemblies, it was not able to find that in GAC so i need to change that in my app.config file.

I am new to SSIS, Can you please tell me how to specify configuration settings for SSIS. Like my cofiguration settings are like this.

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<connectionStrings>

<add

name="abc_Dev"

providerName="System.Data.SqlClient"

connectionString="Data Source=;Initial Catalog=;User ID=; Password=" />

<add

name="abc_Prod"

providerName="System.Data.SqlClient"

connectionString="Data Source=;Initial Catalog=;User ID=; Password=;" />

</connectionStrings>

<dataConfiguration defaultDatabase="abc_Dev"/>

</configuration>

Thanks,

Pooja

|||Take a look at "Package Configurations" in SQL Server Books Online.|||

I have a similar scenario - EntLib and SSIS. I'm afraid I haven't found a way to use the same configuration file - both SSIS and EntLib have their own ideas about file format.

What I do is to manage the EntLib configuration files in the usual way (as in your code example above); and for the SSIS packages I use XML package configurations. You can find out more about these at http://msdn2.microsoft.com/en-us/library/ms141682.aspx.

|||

I specified the database configuration like this but how to specify the configsections for EntLib in XML configuration secion.

<DTSConfiguration>
<Configuration
ConfiguredType="Property"
Path="\Package.Connections[ConnectionName].Properties[ConnectionString]"
ValueType="String">
<ConfiguredValue>

Data Source=[Server Name];

User ID=[user name];

Initial Catalog=[database name];

</ConfiguredValue>
</Configuration>

</DTSConfiguration>

Can you please show me the dtsconfig xml file that you used in your application.

Thanks,

Pooja

|||

SSIS configurations and Enterprise Library configurations are clearly not the same, SSIS has no concept of .Net configurations. You will never be able to get SSIS to use Ent Lib config sections.

The best you can ever do is get .Net code hosted in SSIS to use Ent Lib config. This is not the same as making SSIS use Ent Lib or it's config, this is using .Net code. This is important if you have managed code, that uses Ent Lib functions. As covered above, to use external (external to SSIS I mean) assemblies, you need to ensure they are in the GAC, a challenge for first time Ent Lib builds.

For the configuration, think about how any .Net config works, the host process is responsible for loading it. So if you write an assembly which calls Microsoft.Practices.EnterpriseLibrary.ExceptionHandling stuff, and you want the exceptionHandling\exceptionPolicies config stuff to be available, then you need to add that to the config file for the calling application. If you use this assembly in a Script Task, and execute your package through DTExec, then you need to create a DTExec.config file, with suitable entries.

Other hosts of interest will be DtsDebugHost.exe , DtsHost.exe, DtExecUI.exe

|||

I have done in the same way. I added the assemblies in GAC that are using Enterprise libraries and then I am refering those dlls in my SSIS package.

Now you are saying that for configuration I need to create a DTExec.Config file. I am not able to understand how i should define my configuration setttings in this config file.

What I did is as my configuration file is like this

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<connectionStrings>

<add name="abc" providerName="System.Data.SqlClient" connectionString="Data Source=[Server Name];Initial Catalog=[Database Name];User ID=; password=" />

</connectionStrings>

<dataConfiguration defaultDatabase="abc"/>

</configuration>

So I created one Connection manager named "abc" for that package and then in package configuration I made the configuration settings like

<DTSConfiguration

<Configuration ConfiguredType="Property" Path="\Package.Connections[abc].Properties[ConnectionString]" ValueType="String">

<ConfiguredValue>Data Source=[server name];User ID=;Initial Catalog=[database name];</ConfiguredValue>

</Configuration>

</DTSConfiguration>

I have config file named app.config in which i have added only configuration settings for EnLib like this

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<dataConfiguration defaultDatabase="abc"/>

</configuration>

then I executed it through dtExec like this

EXEC xp_cmdshell 'dtexec /conf "C:\App.Config" /f "C:\Package1.dtsx"'

On executing this I get the exception in code. This exception is coming because it is not able to access the data layer. If I comment the code in which it is accessing database then it work ok.

Please help me. Problem is in configuration file only.

Thanks,

Pooja

Custom Object in SSIS

I wrote a C# class that has a couple of methods that can be called to grab data out of a flat file and import it to a DB. This class was written for a web applicaiton originally. (class has many complex business rules in it)

Now I would like to use this same class in a SSIS package.

Is it possible in a script task to create a new object with my class and use it's methods?

In the end all I want SSIS to do is create my object, call a method in that object and be done.

If I was doing this in DTS, I would have to create an .Net EXE that used my class but I'm hoping to avoid that in SSIS.

Frenchy

The simplest way would be to use the class as-is, and just reference it from a Script Task, which gives you a VB.Net environment to create your class and call your methods as required. You can also leverage connections and variables for a more integrated and dynamic approach if required. You will need to place your assembly in a defined folder to get the Add Reference to work on VSA, the script environment used by SSIS - http://msdn2.microsoft.com/en-us/library/ms136007.aspx|||

I also need the same. My code is in C# and that could not be converted in VB.NET. Did you find any way to invoke C# class ? Please let me know also If you find any solution.

Thanks,

Pooja

|||

Pooja B wrote:

I also need the same. My code is in C# and that could not be converted in VB.NET. Did you find any way to invoke C# class ? Please let me know also If you find any solution.

Thanks,

Pooja

Darren answered this question already (above). Is anythig not clear?

-Jamie

|||

Thanks Jamie. No its clear but I am totally new to SSIS so dont have that much understanding. Can you send me some sample code that is accessing already existing classes in Script task.

Thank you so much...

Pooja

|||If you follow the steps in Darren's post (adding a reference to the .dll that holds your custom code), then you just create a new instance of the object and begin using it - just like you would in any .NET code.|||

For adding a reference to required dlls we need to make them strongly typed. I made them strongly typed and added them to ../windows/microsoft.net/framework/2.0.., then I am able to run my code sucessfully but could not access these dlls in SSIS package. When I add these dlls in GAC then I could access the dlls in SSIS packages but then my application starts giving errors as it gould not refer some of the dlls because of making it strongly named. Can you please suggest what could be the problem. I am using microsoft enterprise libraries in my code.

Thanks,

Pooja

|||This is really a question for a different forum - you might try one of the groups under .NET Development.|||

PLEASE help us to help you-

What application gives these errors?

What are the errors?

An existing application that referenced non-strong named assemblies should keep working fine, assuming you have left the old assemblies in place. It would however make senses to updae your code to use the new strong named version so that all code, SSIS and other applictions, share the same common assemblies.

|||

Thanks for your reply. I am able to fix that problem. In my appplication as I strongly named the assemblies, it was not able to find that in GAC so i need to change that in my app.config file.

I am new to SSIS, Can you please tell me how to specify configuration settings for SSIS. Like my cofiguration settings are like this.

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<connectionStrings>

<add

name="abc_Dev"

providerName="System.Data.SqlClient"

connectionString="Data Source=;Initial Catalog=;User ID=; Password=" />

<add

name="abc_Prod"

providerName="System.Data.SqlClient"

connectionString="Data Source=;Initial Catalog=;User ID=; Password=;" />

</connectionStrings>

<dataConfiguration defaultDatabase="abc_Dev"/>

</configuration>

Thanks,

Pooja

|||Take a look at "Package Configurations" in SQL Server Books Online.|||

I have a similar scenario - EntLib and SSIS. I'm afraid I haven't found a way to use the same configuration file - both SSIS and EntLib have their own ideas about file format.

What I do is to manage the EntLib configuration files in the usual way (as in your code example above); and for the SSIS packages I use XML package configurations. You can find out more about these at http://msdn2.microsoft.com/en-us/library/ms141682.aspx.

|||

I specified the database configuration like this but how to specify the configsections for EntLib in XML configuration secion.

<DTSConfiguration>
<Configuration
ConfiguredType="Property"
Path="\Package.Connections[ConnectionName].Properties[ConnectionString]"
ValueType="String">
<ConfiguredValue>

Data Source=[Server Name];

User ID=[user name];

Initial Catalog=[database name];

</ConfiguredValue>
</Configuration>

</DTSConfiguration>

Can you please show me the dtsconfig xml file that you used in your application.

Thanks,

Pooja

|||

SSIS configurations and Enterprise Library configurations are clearly not the same, SSIS has no concept of .Net configurations. You will never be able to get SSIS to use Ent Lib config sections.

The best you can ever do is get .Net code hosted in SSIS to use Ent Lib config. This is not the same as making SSIS use Ent Lib or it's config, this is using .Net code. This is important if you have managed code, that uses Ent Lib functions. As covered above, to use external (external to SSIS I mean) assemblies, you need to ensure they are in the GAC, a challenge for first time Ent Lib builds.

For the configuration, think about how any .Net config works, the host process is responsible for loading it. So if you write an assembly which calls Microsoft.Practices.EnterpriseLibrary.ExceptionHandling stuff, and you want the exceptionHandling\exceptionPolicies config stuff to be available, then you need to add that to the config file for the calling application. If you use this assembly in a Script Task, and execute your package through DTExec, then you need to create a DTExec.config file, with suitable entries.

Other hosts of interest will be DtsDebugHost.exe , DtsHost.exe, DtExecUI.exe

|||

I have done in the same way. I added the assemblies in GAC that are using Enterprise libraries and then I am refering those dlls in my SSIS package.

Now you are saying that for configuration I need to create a DTExec.Config file. I am not able to understand how i should define my configuration setttings in this config file.

What I did is as my configuration file is like this

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<connectionStrings>

<add name="abc" providerName="System.Data.SqlClient" connectionString="Data Source=[Server Name];Initial Catalog=[Database Name];User ID=; password=" />

</connectionStrings>

<dataConfiguration defaultDatabase="abc"/>

</configuration>

So I created one Connection manager named "abc" for that package and then in package configuration I made the configuration settings like

<DTSConfiguration

<Configuration ConfiguredType="Property" Path="\Package.Connections[abc].Properties[ConnectionString]" ValueType="String">

<ConfiguredValue>Data Source=[server name];User ID=;Initial Catalog=[database name];</ConfiguredValue>

</Configuration>

</DTSConfiguration>

I have config file named app.config in which i have added only configuration settings for EnLib like this

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<dataConfiguration defaultDatabase="abc"/>

</configuration>

then I executed it through dtExec like this

EXEC xp_cmdshell 'dtexec /conf "C:\App.Config" /f "C:\Package1.dtsx"'

On executing this I get the exception in code. This exception is coming because it is not able to access the data layer. If I comment the code in which it is accessing database then it work ok.

Please help me. Problem is in configuration file only.

Thanks,

Pooja

Custom Object in SSIS

I wrote a C# class that has a couple of methods that can be called to grab data out of a flat file and import it to a DB. This class was written for a web applicaiton originally. (class has many complex business rules in it)

Now I would like to use this same class in a SSIS package.

Is it possible in a script task to create a new object with my class and use it's methods?

In the end all I want SSIS to do is create my object, call a method in that object and be done.

If I was doing this in DTS, I would have to create an .Net EXE that used my class but I'm hoping to avoid that in SSIS.

Frenchy

The simplest way would be to use the class as-is, and just reference it from a Script Task, which gives you a VB.Net environment to create your class and call your methods as required. You can also leverage connections and variables for a more integrated and dynamic approach if required. You will need to place your assembly in a defined folder to get the Add Reference to work on VSA, the script environment used by SSIS - http://msdn2.microsoft.com/en-us/library/ms136007.aspx|||

I also need the same. My code is in C# and that could not be converted in VB.NET. Did you find any way to invoke C# class ? Please let me know also If you find any solution.

Thanks,

Pooja

|||

Pooja B wrote:

I also need the same. My code is in C# and that could not be converted in VB.NET. Did you find any way to invoke C# class ? Please let me know also If you find any solution.

Thanks,

Pooja

Darren answered this question already (above). Is anythig not clear?

-Jamie

|||

Thanks Jamie. No its clear but I am totally new to SSIS so dont have that much understanding. Can you send me some sample code that is accessing already existing classes in Script task.

Thank you so much...

Pooja

|||If you follow the steps in Darren's post (adding a reference to the .dll that holds your custom code), then you just create a new instance of the object and begin using it - just like you would in any .NET code.|||

For adding a reference to required dlls we need to make them strongly typed. I made them strongly typed and added them to ../windows/microsoft.net/framework/2.0.., then I am able to run my code sucessfully but could not access these dlls in SSIS package. When I add these dlls in GAC then I could access the dlls in SSIS packages but then my application starts giving errors as it gould not refer some of the dlls because of making it strongly named. Can you please suggest what could be the problem. I am using microsoft enterprise libraries in my code.

Thanks,

Pooja

|||This is really a question for a different forum - you might try one of the groups under .NET Development.|||

PLEASE help us to help you-

What application gives these errors?

What are the errors?

An existing application that referenced non-strong named assemblies should keep working fine, assuming you have left the old assemblies in place. It would however make senses to updae your code to use the new strong named version so that all code, SSIS and other applictions, share the same common assemblies.

|||

Thanks for your reply. I am able to fix that problem. In my appplication as I strongly named the assemblies, it was not able to find that in GAC so i need to change that in my app.config file.

I am new to SSIS, Can you please tell me how to specify configuration settings for SSIS. Like my cofiguration settings are like this.

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<connectionStrings>

<add

name="abc_Dev"

providerName="System.Data.SqlClient"

connectionString="Data Source=;Initial Catalog=;User ID=; Password=" />

<add

name="abc_Prod"

providerName="System.Data.SqlClient"

connectionString="Data Source=;Initial Catalog=;User ID=; Password=;" />

</connectionStrings>

<dataConfiguration defaultDatabase="abc_Dev"/>

</configuration>

Thanks,

Pooja

|||Take a look at "Package Configurations" in SQL Server Books Online.|||

I have a similar scenario - EntLib and SSIS. I'm afraid I haven't found a way to use the same configuration file - both SSIS and EntLib have their own ideas about file format.

What I do is to manage the EntLib configuration files in the usual way (as in your code example above); and for the SSIS packages I use XML package configurations. You can find out more about these at http://msdn2.microsoft.com/en-us/library/ms141682.aspx.

|||

I specified the database configuration like this but how to specify the configsections for EntLib in XML configuration secion.

<DTSConfiguration>
<Configuration
ConfiguredType="Property"
Path="\Package.Connections[ConnectionName].Properties[ConnectionString]"
ValueType="String">
<ConfiguredValue>

Data Source=[Server Name];

User ID=[user name];

Initial Catalog=[database name];

</ConfiguredValue>
</Configuration>

</DTSConfiguration>

Can you please show me the dtsconfig xml file that you used in your application.

Thanks,

Pooja

|||

SSIS configurations and Enterprise Library configurations are clearly not the same, SSIS has no concept of .Net configurations. You will never be able to get SSIS to use Ent Lib config sections.

The best you can ever do is get .Net code hosted in SSIS to use Ent Lib config. This is not the same as making SSIS use Ent Lib or it's config, this is using .Net code. This is important if you have managed code, that uses Ent Lib functions. As covered above, to use external (external to SSIS I mean) assemblies, you need to ensure they are in the GAC, a challenge for first time Ent Lib builds.

For the configuration, think about how any .Net config works, the host process is responsible for loading it. So if you write an assembly which calls Microsoft.Practices.EnterpriseLibrary.ExceptionHandling stuff, and you want the exceptionHandling\exceptionPolicies config stuff to be available, then you need to add that to the config file for the calling application. If you use this assembly in a Script Task, and execute your package through DTExec, then you need to create a DTExec.config file, with suitable entries.

Other hosts of interest will be DtsDebugHost.exe , DtsHost.exe, DtExecUI.exe

|||

I have done in the same way. I added the assemblies in GAC that are using Enterprise libraries and then I am refering those dlls in my SSIS package.

Now you are saying that for configuration I need to create a DTExec.Config file. I am not able to understand how i should define my configuration setttings in this config file.

What I did is as my configuration file is like this

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<connectionStrings>

<add name="abc" providerName="System.Data.SqlClient" connectionString="Data Source=[Server Name];Initial Catalog=[Database Name];User ID=; password=" />

</connectionStrings>

<dataConfiguration defaultDatabase="abc"/>

</configuration>

So I created one Connection manager named "abc" for that package and then in package configuration I made the configuration settings like

<DTSConfiguration

<Configuration ConfiguredType="Property" Path="\Package.Connections[abc].Properties[ConnectionString]" ValueType="String">

<ConfiguredValue>Data Source=[server name];User ID=;Initial Catalog=[database name];</ConfiguredValue>

</Configuration>

</DTSConfiguration>

I have config file named app.config in which i have added only configuration settings for EnLib like this

<configuration>

<configSections>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, MSEntLib.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken=1791fdccf49453e7" />

</configSections>

<dataConfiguration defaultDatabase="abc"/>

</configuration>

then I executed it through dtExec like this

EXEC xp_cmdshell 'dtexec /conf "C:\App.Config" /f "C:\Package1.dtsx"'

On executing this I get the exception in code. This exception is coming because it is not able to access the data layer. If I comment the code in which it is accessing database then it work ok.

Please help me. Problem is in configuration file only.

Thanks,

Pooja

Thursday, March 8, 2012

Custom Join!

Hi All, I have a sample Flat File, need to get a custom record layout out of it

Sample FlatFile Input:

============

RecordA.....

RecordB.....

OwnerAB.....

RecordC.....

RecordD.....

OwnerCD.....

......

Custom Output:

============

OwnerAB RecordA ............RecordB.....

OwberCD RecordC ..........RecordD..............

............

TIA

How is this different from your "challenge question" posted earlier?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1767071&SiteID=1

Let's keep the topics together.

Custom Forms Authentication - fails every two or three hours after working fine.

I'm enclosing the pertinent log entries form the
ReportServer_DD_DD_DDDD_HH_MM_SS.log file.
Problem: I've written a custom forms auth extension that (naturally)
works fine in the test environment. In production, under about 25 - 20
users (80 - 150 report requests) per hour, everything works fine until
after about two or three hours, for some reason, the following errors
(below) appear in the log, and in the event log an error is thrown that
simply states:
"Report Server cannot load the forms extension."
Then, no can access the report manager becuase you get an error that
says a configuration file for report server was changed and it can't
acces report server (sorry, i don't have the exact message text). NO
CHANGE HAS BEEN MADE TO ANY CONFIG FILE!
All I then do is restart the reporting service and restart IIS, and
everything is just fine again for a few hours.
My client has to have this Single Sign on solution, and it works really
nice. But to have it go down every few hours on the production server
doesn't instill confidence.
The following two line from the report server logfile reference
something about trying to add a 'delete schedules' key. We don't allow
any subscriptions, nor do we have any custom schedules defined. We do
have Sql Agent running for data feeds and execution log stats on our db
server. I don't know where its getting 'delete schedules' from.
Any help would help...
btw we're running WIN2003 SP1, ENT RS SP1 on web server, WIN2003 SP1 on
database server.
here's the log file entries:
w3wp!extensionfactory!c70!05/10/2005-15:12:03:: e ERROR: Exception
caught instantiating report server extension:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --> System.ArgumentException: Item has
already been added. Key in dictionary: "DeleteSchedules" Key being
added: "DeleteSchedules"
at System.Collections.Hashtable.Insert(Object key, Object nvalue,
Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at
Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization.InitializeMaps()
at
Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization..ctor()
-- End of inner exception stack trace --
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags
bindingAttr, Binder binder, Object[] args, CultureInfo culture,
Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String
extensionName, String extensionType).
w3wp!extensionfactory!34c!05/10/2005-15:12:03:: e ERROR: Exception
caught instantiating report server extension:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --> System.Exception: Number of
catalog names don't match.
at
Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization.InitializeMaps()
at
Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization..ctor()
-- End of inner exception stack trace --
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags
bindingAttr, Binder binder, Object[] args, CultureInfo culture,
Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String
extensionName, String extensionType).
w3wp!library!34c!05/10/2005-15:12:03:: e ERROR: Throwing
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
The Report Server has encountered a configuration error; more details
in the log files, Could not load Authorization extension;
Info:
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
The Report Server has encountered a configuration error; more details
in the log files
w3wp!library!c70!05/10/2005-15:12:03:: e ERROR: Throwing
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
The Report Server has encountered a configuration error; more details
in the log files, Could not load Authorization extension;
Info:
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
The Report Server has encountered a configuration error; more details
in the log files
w3wp!processing!34c!05/10/2005-15:12:03:: e ERROR: An error has
occurred while retrieving datasources for a sub-report. Details: The
Report Server has encountered a configuration error; more details in
the log files
w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: An error has
occurred while retrieving datasources for a sub-report. Details: The
Report Server has encountered a configuration error; more details in
the log files
w3wp!processing!34c!05/10/2005-15:12:03:: e ERROR: Stack trace: at
Microsoft.ReportingServices.Library.Security.get_AuthorizationExtension()
at Microsoft.ReportingServices.Library.Security.CheckAccess(ItemType
catItemType, Byte[] secDesc, ReportOperation rptOper)
at
Microsoft.ReportingServices.Library.RSService.ProcessingGetDataSources(CatalogItemContext
reportContext, String subreportPath, CatalogItemContext&
subreportContext, GetReportChunk& getCompiledDefinition,
DataSourceInfoCollection& dataSources)
at
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.a(Report
A_0, DataSourceInfoCollection A_1, CatalogItemContext A_2,
SubReportDataSourcesCallback A_3, RuntimeDataSourceInfoCollection A_4,
Int32 A_5, Boolean A_6, ServerDataSourceSettings A_7)
w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: Stack trace: at
Microsoft.ReportingServices.Library.Security.get_AuthorizationExtension()
at Microsoft.ReportingServices.Library.Security.CheckAccess(ItemType
catItemType, Byte[] secDesc, ReportOperation rptOper)
at
Microsoft.ReportingServices.Library.RSService.ProcessingGetDataSources(CatalogItemContext
reportContext, String subreportPath, CatalogItemContext&
subreportContext, GetReportChunk& getCompiledDefinition,
DataSourceInfoCollection& dataSources)
at
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.a(Report
A_0, DataSourceInfoCollection A_1, CatalogItemContext A_2,
SubReportDataSourcesCallback A_3, RuntimeDataSourceInfoCollection A_4,
Int32 A_5, Boolean A_6, ServerDataSourceSettings A_7)
w3wp!library!c70!05/10/2005-15:12:03:: e ERROR: Throwing
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
The Report Server has encountered a configuration error; more details
in the log files, Could not load Authorization extension;
Info:
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
The Report Server has encountered a configuration error; more details
in the log files
w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: An error has
occurred while retrieving datasources for a sub-report. Details: The
Report Server has encountered a configuration error; more details in
the log files
w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: Stack trace: at
Microsoft.ReportingServices.Library.Security.get_AuthorizationExtension()
from here on everything comes up with the same error.Hi,
I am implementing a Single Sign on for my Web application and RS to fetch
the reports using URL. But when I try to access the report, RS shows the
logon screen, which I don't wan as user is already logged on to the web
application. Logon screen is shown only for first request.
Please let me know if I need to do some settings or add some infor in
Request/Response.
Thanks,
Mahesh
"jahles" wrote:
> I'm enclosing the pertinent log entries form the
> ReportServer_DD_DD_DDDD_HH_MM_SS.log file.
> Problem: I've written a custom forms auth extension that (naturally)
> works fine in the test environment. In production, under about 25 - 20
> users (80 - 150 report requests) per hour, everything works fine until
> after about two or three hours, for some reason, the following errors
> (below) appear in the log, and in the event log an error is thrown that
> simply states:
> "Report Server cannot load the forms extension."
> Then, no can access the report manager becuase you get an error that
> says a configuration file for report server was changed and it can't
> acces report server (sorry, i don't have the exact message text). NO
> CHANGE HAS BEEN MADE TO ANY CONFIG FILE!
> All I then do is restart the reporting service and restart IIS, and
> everything is just fine again for a few hours.
> My client has to have this Single Sign on solution, and it works really
> nice. But to have it go down every few hours on the production server
> doesn't instill confidence.
> The following two line from the report server logfile reference
> something about trying to add a 'delete schedules' key. We don't allow
> any subscriptions, nor do we have any custom schedules defined. We do
> have Sql Agent running for data feeds and execution log stats on our db
> server. I don't know where its getting 'delete schedules' from.
> Any help would help...
> btw we're running WIN2003 SP1, ENT RS SP1 on web server, WIN2003 SP1 on
> database server.
> here's the log file entries:
> w3wp!extensionfactory!c70!05/10/2005-15:12:03:: e ERROR: Exception
> caught instantiating report server extension:
> System.Reflection.TargetInvocationException: Exception has been thrown
> by the target of an invocation. --> System.ArgumentException: Item has
> already been added. Key in dictionary: "DeleteSchedules" Key being
> added: "DeleteSchedules"
> at System.Collections.Hashtable.Insert(Object key, Object nvalue,
> Boolean add)
> at System.Collections.Hashtable.Add(Object key, Object value)
> at
> Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization.InitializeMaps()
> at
> Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization..ctor()
> -- End of inner exception stack trace --
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
> Binder binder, Object[] args, CultureInfo culture, Object[]
> activationAttributes)
> at System.Activator.CreateInstance(Type type, BindingFlags
> bindingAttr, Binder binder, Object[] args, CultureInfo culture,
> Object[] activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName,
> Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
> args, CultureInfo culture, Object[] activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
> assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
> assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String
> extensionName, String extensionType).
> w3wp!extensionfactory!34c!05/10/2005-15:12:03:: e ERROR: Exception
> caught instantiating report server extension:
> System.Reflection.TargetInvocationException: Exception has been thrown
> by the target of an invocation. --> System.Exception: Number of
> catalog names don't match.
> at
> Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization.InitializeMaps()
> at
> Thrivent.FPM.ReportingServices.CustomSecurityExtension.Authorization..ctor()
> -- End of inner exception stack trace --
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
> Binder binder, Object[] args, CultureInfo culture, Object[]
> activationAttributes)
> at System.Activator.CreateInstance(Type type, BindingFlags
> bindingAttr, Binder binder, Object[] args, CultureInfo culture,
> Object[] activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName,
> Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
> args, CultureInfo culture, Object[] activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
> assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly
> assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String
> extensionName, String extensionType).
> w3wp!library!34c!05/10/2005-15:12:03:: e ERROR: Throwing
> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
> The Report Server has encountered a configuration error; more details
> in the log files, Could not load Authorization extension;
> Info:
> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
> The Report Server has encountered a configuration error; more details
> in the log files
> w3wp!library!c70!05/10/2005-15:12:03:: e ERROR: Throwing
> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
> The Report Server has encountered a configuration error; more details
> in the log files, Could not load Authorization extension;
> Info:
> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
> The Report Server has encountered a configuration error; more details
> in the log files
> w3wp!processing!34c!05/10/2005-15:12:03:: e ERROR: An error has
> occurred while retrieving datasources for a sub-report. Details: The
> Report Server has encountered a configuration error; more details in
> the log files
> w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: An error has
> occurred while retrieving datasources for a sub-report. Details: The
> Report Server has encountered a configuration error; more details in
> the log files
> w3wp!processing!34c!05/10/2005-15:12:03:: e ERROR: Stack trace: at
> Microsoft.ReportingServices.Library.Security.get_AuthorizationExtension()
> at Microsoft.ReportingServices.Library.Security.CheckAccess(ItemType
> catItemType, Byte[] secDesc, ReportOperation rptOper)
> at
> Microsoft.ReportingServices.Library.RSService.ProcessingGetDataSources(CatalogItemContext
> reportContext, String subreportPath, CatalogItemContext&
> subreportContext, GetReportChunk& getCompiledDefinition,
> DataSourceInfoCollection& dataSources)
> at
> Microsoft.ReportingServices.ReportProcessing.ReportProcessing.a(Report
> A_0, DataSourceInfoCollection A_1, CatalogItemContext A_2,
> SubReportDataSourcesCallback A_3, RuntimeDataSourceInfoCollection A_4,
> Int32 A_5, Boolean A_6, ServerDataSourceSettings A_7)
> w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: Stack trace: at
> Microsoft.ReportingServices.Library.Security.get_AuthorizationExtension()
> at Microsoft.ReportingServices.Library.Security.CheckAccess(ItemType
> catItemType, Byte[] secDesc, ReportOperation rptOper)
> at
> Microsoft.ReportingServices.Library.RSService.ProcessingGetDataSources(CatalogItemContext
> reportContext, String subreportPath, CatalogItemContext&
> subreportContext, GetReportChunk& getCompiledDefinition,
> DataSourceInfoCollection& dataSources)
> at
> Microsoft.ReportingServices.ReportProcessing.ReportProcessing.a(Report
> A_0, DataSourceInfoCollection A_1, CatalogItemContext A_2,
> SubReportDataSourcesCallback A_3, RuntimeDataSourceInfoCollection A_4,
> Int32 A_5, Boolean A_6, ServerDataSourceSettings A_7)
> w3wp!library!c70!05/10/2005-15:12:03:: e ERROR: Throwing
> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
> The Report Server has encountered a configuration error; more details
> in the log files, Could not load Authorization extension;
> Info:
> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException:
> The Report Server has encountered a configuration error; more details
> in the log files
> w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: An error has
> occurred while retrieving datasources for a sub-report. Details: The
> Report Server has encountered a configuration error; more details in
> the log files
> w3wp!processing!c70!05/10/2005-15:12:03:: e ERROR: Stack trace: at
> Microsoft.ReportingServices.Library.Security.get_AuthorizationExtension()
>
> from here on everything comes up with the same error.
>

custom flat file for log transactions

Hi,
I am new at reporting services and need help creating a flat file that
will contain transaction logs like userid, amount, date and a comment
line.
I do not want the full report history since that would take a lot of
space on the server.
Is there such a way to create a flat file with plain text
characters(maybe csv or just spaces...) with only the information I
want to provide and to the folder/file I specify?
Thanks.
BTW, this is also my first posting ever.If the data is already in a database table, you should be able to create a
dataset against it, pull the data (i.e., only the columns and rows you want)
into a report table, publish the report, and export it to CSV. Check BOL for
samples and walkthroughs:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSAMPLES/htm/rss_overview_v1_631v.asp?frame=true.
There's also a How To section in BOL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_4bhu.asp?frame=true.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"A Gutie" <fiututor@.yahoo.com> wrote in message
news:eca873f7.0408030527.27d8e376@.posting.google.com...
> Hi,
> I am new at reporting services and need help creating a flat file that
> will contain transaction logs like userid, amount, date and a comment
> line.
> I do not want the full report history since that would take a lot of
> space on the server.
> Is there such a way to create a flat file with plain text
> characters(maybe csv or just spaces...) with only the information I
> want to provide and to the folder/file I specify?
> Thanks.
> BTW, this is also my first posting ever.|||Hi Ravi,
This report does not use any tables but only textboxes that are
populated from different datasets. All is working fine.
EXCEPT: I need to create a text file(could be csv or just plain text
separated by blanks...) that will get appended information to it. It
will contain a few fields from the report. This process MUST be made
automatically without having the user click on the 'export' link. In
other words, like behind the scenes event when clicking on the 'view
report' button.
What I have done is to create a dataset that has an insert but this is
adding the fields to a table I created for testing. If I could just
make the 'insert' send the output to a text file instead of a table
will do all I need.
if you know how, please let me know. I have not had any luck sending
the output to a file from an insert - have not found any documentation
on it but just DTS code that will not suffice.
I apologize for not giving specific details.
Thanks again.
"Ravi Mumulla \(Microsoft\)" <ravimu@.online.microsoft.com> wrote in message news:<OqoCEoXeEHA.1644@.tk2msftngp13.phx.gbl>...
> If the data is already in a database table, you should be able to create a
> dataset against it, pull the data (i.e., only the columns and rows you want)
> into a report table, publish the report, and export it to CSV. Check BOL for
> samples and walkthroughs:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSAMPLES/htm/rss_overview_v1_631v.asp?frame=true.
> There's also a How To section in BOL:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_4bhu.asp?frame=true.
> --
> Ravi Mumulla (Microsoft)
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "A Gutie" <fiututor@.yahoo.com> wrote in message
> news:eca873f7.0408030527.27d8e376@.posting.google.com...
> > Hi,
> > I am new at reporting services and need help creating a flat file that
> > will contain transaction logs like userid, amount, date and a comment
> > line.
> > I do not want the full report history since that would take a lot of
> > space on the server.
> > Is there such a way to create a flat file with plain text
> > characters(maybe csv or just spaces...) with only the information I
> > want to provide and to the folder/file I specify?
> > Thanks.
> > BTW, this is also my first posting ever.|||Sounds like execution log will give you what you're looking for. Take a look
at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsadmin/htm/arp_rslogfiles_v1_88gy.asp?frame=true.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"A Gutie" <fiututor@.yahoo.com> wrote in message
news:eca873f7.0408040544.744a044@.posting.google.com...
> Hi Ravi,
> This report does not use any tables but only textboxes that are
> populated from different datasets. All is working fine.
> EXCEPT: I need to create a text file(could be csv or just plain text
> separated by blanks...) that will get appended information to it. It
> will contain a few fields from the report. This process MUST be made
> automatically without having the user click on the 'export' link. In
> other words, like behind the scenes event when clicking on the 'view
> report' button.
> What I have done is to create a dataset that has an insert but this is
> adding the fields to a table I created for testing. If I could just
> make the 'insert' send the output to a text file instead of a table
> will do all I need.
> if you know how, please let me know. I have not had any luck sending
> the output to a file from an insert - have not found any documentation
> on it but just DTS code that will not suffice.
> I apologize for not giving specific details.
> Thanks again.
> "Ravi Mumulla \(Microsoft\)" <ravimu@.online.microsoft.com> wrote in
message news:<OqoCEoXeEHA.1644@.tk2msftngp13.phx.gbl>...
> > If the data is already in a database table, you should be able to create
a
> > dataset against it, pull the data (i.e., only the columns and rows you
want)
> > into a report table, publish the report, and export it to CSV. Check BOL
for
> > samples and walkthroughs:
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSAMPLES/htm/rss_overview_v1_631v.asp?frame=true.
> > There's also a How To section in BOL:
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_4bhu.asp?frame=true.
> >
> > --
> > Ravi Mumulla (Microsoft)
> > SQL Server Reporting Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> > "A Gutie" <fiututor@.yahoo.com> wrote in message
> > news:eca873f7.0408030527.27d8e376@.posting.google.com...
> > > Hi,
> > > I am new at reporting services and need help creating a flat file that
> > > will contain transaction logs like userid, amount, date and a comment
> > > line.
> > > I do not want the full report history since that would take a lot of
> > > space on the server.
> > > Is there such a way to create a flat file with plain text
> > > characters(maybe csv or just spaces...) with only the information I
> > > want to provide and to the folder/file I specify?
> > > Thanks.
> > > BTW, this is also my first posting ever.|||Report Server Execution Log Data would had been great but it does not
contain information from a dataset but only parameter
information(according to the specs).
This link is very good but it does not include values from dataset
if I could just include field values from dataset then it'd do.
any other hints or maybe the execution log may be modified to include
values from datasets?
Thanks again
"Ravi Mumulla \(Microsoft\)" <ravimu@.online.microsoft.com> wrote in message news:<uO7gHJoeEHA.2396@.TK2MSFTNGP11.phx.gbl>...
> Sounds like execution log will give you what you're looking for. Take a look
> at
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsadmin/htm/arp_rslogfiles_v1_88gy.asp?frame=true.
> --
> Ravi Mumulla (Microsoft)
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "A Gutie" <fiututor@.yahoo.com> wrote in message
> news:eca873f7.0408040544.744a044@.posting.google.com...
> > Hi Ravi,
> >
> > This report does not use any tables but only textboxes that are
> > populated from different datasets. All is working fine.
> >
> > EXCEPT: I need to create a text file(could be csv or just plain text
> > separated by blanks...) that will get appended information to it. It
> > will contain a few fields from the report. This process MUST be made
> > automatically without having the user click on the 'export' link. In
> > other words, like behind the scenes event when clicking on the 'view
> > report' button.
> >
> > What I have done is to create a dataset that has an insert but this is
> > adding the fields to a table I created for testing. If I could just
> > make the 'insert' send the output to a text file instead of a table
> > will do all I need.
> > if you know how, please let me know. I have not had any luck sending
> > the output to a file from an insert - have not found any documentation
> > on it but just DTS code that will not suffice.
> > I apologize for not giving specific details.
> > Thanks again.
> >
> > "Ravi Mumulla \(Microsoft\)" <ravimu@.online.microsoft.com> wrote in
> message news:<OqoCEoXeEHA.1644@.tk2msftngp13.phx.gbl>...
> > > If the data is already in a database table, you should be able to create
> a
> > > dataset against it, pull the data (i.e., only the columns and rows you
> want)
> > > into a report table, publish the report, and export it to CSV. Check BOL
> for
> > > samples and walkthroughs:
> > >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSAMPLES/htm/rss_overview_v1_631v.asp?frame=true.
> > > There's also a How To section in BOL:
> > >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_4bhu.asp?frame=true.
> > >
> > > --
> > > Ravi Mumulla (Microsoft)
> > > SQL Server Reporting Services
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > > "A Gutie" <fiututor@.yahoo.com> wrote in message
> > > news:eca873f7.0408030527.27d8e376@.posting.google.com...
> > > > Hi,
> > > > I am new at reporting services and need help creating a flat file that
> > > > will contain transaction logs like userid, amount, date and a comment
> > > > line.
> > > > I do not want the full report history since that would take a lot of
> > > > space on the server.
> > > > Is there such a way to create a flat file with plain text
> > > > characters(maybe csv or just spaces...) with only the information I
> > > > want to provide and to the folder/file I specify?
> > > > Thanks.
> > > > BTW, this is also my first posting ever.

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

Custom Delivery Extension

SSRS2000 - Is it possible to combine two existing delivery extensions into one custom delivery extension? If possible, I would like to combine file share and email delivery extensions to send email after file has been created by the file share delivery extension. Any help will be much appreciated.

Thanks

Sorry, no this is not possible. You would have to write your own extension that does the same thing.

All is not lost however: If you enable caching for the report, it should be possible to create two subscription that fire at the same time based on a shared schedule that deliver the same report (due to caching) to different locations.

-Lukasz

|||KKaps-

Although they can't be combined, you could create your own custom

delivery extension that does both functions. Take a look at the

PrinterDeliverySample to get started with creating delivery extensions.

Regards,

Scott

Custom Delivery Extension

SSRS2000 - Is it possible to combine two existing delivery extensions into one custom delivery extension? If possible, I would like to combine file share and email delivery extensions to send email after file has been created by the file share delivery extension. Any help will be much appreciated.

Thanks

Sorry, no this is not possible. You would have to write your own extension that does the same thing.

All is not lost however: If you enable caching for the report, it should be possible to create two subscription that fire at the same time based on a shared schedule that deliver the same report (due to caching) to different locations.

-Lukasz

|||KKaps-

Although they can't be combined, you could create your own custom delivery extension that does both functions. Take a look at the PrinterDeliverySample to get started with creating delivery extensions.

Regards,
Scott

Custom Delivery Extension

Hello Everyone,
I'm in the process of creating a custom delivery extension that will
write to a file share and then email users that the file is available.
I have used the custom printing extension sample as the basis for
creating my FileShareEmail extension.
I think my question is unlike most posted here in that, I have gotten
all the config files to work. So far I have set up a few parameters
(email address to and from). I then send an email with smtp.
I successfully receive the email and I created the notification.Status
= "Status: Email Sent.". This is what i see in the log file:
ReportingServicesService!notification!3ffc!11/02/2005-09:42:06::
Notification 7493a45c-2f0b-431c-bb53-592a99a5977c completed. Success:
False, Status: Email Sent., DeliveryExtension: File Share Email,
Report: 01 - Standard Listing Report, Attempt 1
There are no exceptions and the email was sent. The Report Manager
still has Done: 1 processed of 1 total; 1 errors. in the status column.
I cannot figure out why there was an error generated. Is there a
property that i forgot to set?
Another question I have is: I can see my custom extension in data
driven subscriptions but not in the regular subscriptions. Is this by
design or am I missing a config.
Resources question: I've looked quite a few places for some more
examples (other than the printer example), does anyone know some good
blogs or sites that have some different samples implemented?
The fourth and final question: Since I am trying to replicate some of
the existing functionality of RS, is there a way to send the email
through RS instead of coding my own error checking and such into my
extension?
Thanks for your help!
Regards,
DanI figured out one of the 4 questions. My Deliver() method was
returning the wrong boolean value (i.e. true when failed and false when
succeeded).

Custom Delivery Extension

Hi,
I'm writing a custom delivery extension that saves the rendered report
to the disk.
My problem is that the output file only contains spaces (the file size
is excatly what it should be but no text only black spaces).
Does anyone know why spaces appear instead of chars ?
this is the code for excel but the same happens with mhtml:
Dim deviceInfo, format As String
format = "EXCEL"
deviceInfo = String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",
format)
' Render report
m_files = notification.Report.Render(format, deviceInfo)
Dim fileName As String
fileName = "C:\" & m_files(0).FileName & ".xls"
Dim results(CInt(m_files(0).Data.Length)) As Byte
m_files(0).Data.Read(results, 0, CInt(m_files(0).Data.Length))
Dim _filestream As System.IO.FileStream = System.IO.File.OpenWrite(fileName)
_filestream.Write(results, 0, CInt(m_files(0).Data.Length))
_filestream.Flush()
_filestream.Close()You need to take the encoding of the stream into account. Use a stream
reader to read the contents passing in the encoding of the stream, and then
use a stream writer to write to the filestream, also passing in the
encoding.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"kman" <kamara1@.yahoo.com> wrote in message
news:1106326857.837797.301490@.z14g2000cwz.googlegroups.com...
> Hi,
> I'm writing a custom delivery extension that saves the rendered report
> to the disk.
> My problem is that the output file only contains spaces (the file size
> is excatly what it should be but no text only black spaces).
> Does anyone know why spaces appear instead of chars ?
> this is the code for excel but the same happens with mhtml:
> Dim deviceInfo, format As String
> format = "EXCEL"
> deviceInfo => String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",
> format)
> ' Render report
> m_files = notification.Report.Render(format, deviceInfo)
> Dim fileName As String
> fileName = "C:\" & m_files(0).FileName & ".xls"
> Dim results(CInt(m_files(0).Data.Length)) As Byte
> m_files(0).Data.Read(results, 0, CInt(m_files(0).Data.Length))
> Dim _filestream As System.IO.FileStream => System.IO.File.OpenWrite(fileName)
> _filestream.Write(results, 0, CInt(m_files(0).Data.Length))
> _filestream.Flush()
> _filestream.Close()
>|||Thanks,
I tried what you've suggested but i think i'm doing something wrong
because now i'm getting a zero byte file.
can you provide the code for that?
here's the code i added:
Dim encode As Encoding = m_files(0).Encoding
Dim _readStream As New StreamReader(m_files(0).Data, encode)
Dim _filestream As New System.IO.FileStream(fileName,
FileMode.OpenOrCreate)
Dim _writeStream As New StreamWriter(_filestream, encode)
_writeStream.Write(_readStream.ReadToEnd)
_writeStream.Close()
_readStream.Close()
_FileStream.Close()|||Daniel, somebody,
Please help ...|||You're correct - for excel there's no encoding. I tried the mhtml
format which has ASCIIEncoding.
I'm only sending the format in the device info:
String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",format)
I'm not sure what you mean to pass via url, i've tried to export the
report from the report manager and it works fine.
Can you post how to read it like you do ?|||Try not passing in this device info and instead pass the format in on the
render call only.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"kman" <kamara1@.yahoo.com> wrote in message
news:1106853884.827838.300370@.z14g2000cwz.googlegroups.com...
> You're correct - for excel there's no encoding. I tried the mhtml
> format which has ASCIIEncoding.
> I'm only sending the format in the device info:
> String.Format("<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>",format)
> I'm not sure what you mean to pass via url, i've tried to export the
> report from the report manager and it works fine.
> Can you post how to read it like you do ?
>|||i tried - notification.Report.Render(format, Nothing), but still
there's a black file.
i checked the findrendersave sample and it works fine there but i can't
use the render method directly from the web service because i need the
subscription info (parameters ...)
any ideas ?|||I'm sorry to say, I don't see what the problem is. I can't see anything
wrong with what you are doing. It should work.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"kman" <kamara1@.yahoo.com> wrote in message
news:1106909217.659089.277880@.z14g2000cwz.googlegroups.com...
>i tried - notification.Report.Render(format, Nothing), but still
> there's a black file.
> i checked the findrendersave sample and it works fine there but i can't
> use the render method directly from the web service because i need the
> subscription info (parameters ...)
> any ideas ?
>|||Hi,
Solved it. It wasn't the encoding after all but the position on the
data stream.
I added this line and it solved it:
_renderedOutputFile.Data.Seek(CType(0, Long),
System.IO.SeekOrigin.Begin)
Thanks for your help.
This is the complete code for saving the file (works for excel, mhtml
and pdf):
m_files = notification.Report.Render(format, Nothing)
Dim _fileStream As System.IO.FileStream = Nothing
Dim _renderedOutputFile As RenderedOutputFile
_renderedOutputFile = m_files(0)
Dim fileName As String = "C:\" & _renderedOutputFile.FileName.Trim &
"." & _renderedOutputFile.Extension.Trim
_fileStream = New System.IO.FileStream(fileName, FileMode.OpenOrCreate,
FileAccess.Write)
_renderedOutputFile.Data.Seek(CType(0, Long),
System.IO.SeekOrigin.Begin)
Dim arr(CInt(_renderedOutputFile.Data.Length)) As Byte
_renderedOutputFile.Data.Read(arr, 0,
CInt(_renderedOutputFile.Data.Length))
_fileStream.Write(arr, 0, CInt(_renderedOutputFile.Data.Length))
_fileStream.Close()

Friday, February 24, 2012

Custom code assembly with config file

Hi!

My report has a reference to an assembly of a class library I did. This class library has a config file, classLibrary.dll.config, where I set some parameters, one of these being the "initial path" to the project's folder(for example, project folder is myProject, and you would use the initial path to say it's in c:/projects/tests). When I preview the report everything works fine, but when I publish it I get this error:

Absolute path information is required.

I guess it's not reading the dll.config file, so it can't see the initial path value and concatenate it with the project's folder. I'm supposing this because at first, I forgot to copy the dll.config file to the Microsoft Visual Studio 8/Common7/IDE/PrivateAssemblies folder and I got the same error when trying to preview the report. Copying it to this folder solved the problem. So I think I'm not placing the dll.config file in the rigth folder (I'm copying it to Microsoft SQL Server/MSSQL/ReportServer/bin). If I don't use the config file, I mean, if I put the absolute path directly in the code, everything works, but this is just something I can't do! Can anyone help me?

Thank you!

what happens if you copy config file to reportserver/bin and give 'everyone' read access to it?|||

Hi!

It still can't see the config file... My class library has two classes, Class A uses Class B. Can I use only Class A ddl or should I put both dll files in the rssrvpolicy.config?

Thank you!

|||You should put both|||

Hi!

Still have the problem... When I try to preview the assembly location using Assembly.GetExecutingAssembly().Location, it shows me the rigth path to the dll file. When I try to see it from the published report, I get #Erro on the textbox. Is this write?

Thank you!

|||

Take a look at the logfiles at:
\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\LogFiles
Usually they can help you..
Hint:
Stop Reporting Services and WWW-Publishing, delete all old Logfiles, and restart the services. So you can easily find the right logfiles..

|||

Hi!

Thanks for the post, I'll take a look on the log files... But I'm wondering if there is a simpler way to do what I'm trying to do. I'm doing all this because I can't have in my code an absolute path to a xml file configurable by the user. I know that, if it was a web page, I could use Server.MapPath("file.xml") to made it relative to the project path. Can't I do something like this with a Class Library? Or is the config file the only solution?

Thank you!

Sunday, February 19, 2012

custom assembly permissions woes

i have a custom assembly that was working fine, and i've set the basic
permissions needed in the RSReportServer.config file and all was good
however i've just added functionality that uses
System.DirectoryServices and the new code works fine within
visualstudio but i'm quite confused on what i need to do to get it
working on reporting services.
i'll willing to give full permissions to the assembly - at least in
the beginning just to get it running.
KarlKarl,
The exception that gets thrown should describe the failing element (the name
of the secure resource thats broken the security rule)
Hint: take a look at the top of the RSServerPolicy.config file and you'll
see the security permission types - these should provide a clue to which one
you need to use
You'll need to assert this required permission too in your CA and you'll
also need to ensure your CodeGroup (where the CA DLL has been defined) has
the required level defined also.
regards,
- peteZ
"Karl Prosser" <klumsy@.xtra.co.nz> wrote in message
news:7156880c.0410110045.33f32ff5@.posting.google.com...
>i have a custom assembly that was working fine, and i've set the basic
> permissions needed in the RSReportServer.config file and all was good
> however i've just added functionality that uses
> System.DirectoryServices and the new code works fine within
> visualstudio but i'm quite confused on what i need to do to get it
> working on reporting services.
> i'll willing to give full permissions to the assembly - at least in
> the beginning just to get it running.
> Karl|||Hi Karl,
Did you ever find a solution to this problem?
I have made a few similar postings with no luck.
Works fine for System.Data.SqlClient but not with System.DirectoryServices.
Cheers,
Flon
"Karl Prosser" wrote:
> i have a custom assembly that was working fine, and i've set the basic
> permissions needed in the RSReportServer.config file and all was good
> however i've just added functionality that uses
> System.DirectoryServices and the new code works fine within
> visualstudio but i'm quite confused on what i need to do to get it
> working on reporting services.
> i'll willing to give full permissions to the assembly - at least in
> the beginning just to get it running.
> Karl
>