Showing posts with label reference. Show all posts
Showing posts with label reference. Show all posts

Tuesday, March 20, 2012

Custom Security Extension issue...

I have tried to write a custom security extension. When I run the report
manager I get ...
Object Reference is not set to an instance of an object.
It's breaking in GlobalApp.Application_AuthenticationRequest
I figure its because it can't find my extension but I have the correct Url
in the securityextensioncodegroup. Could it be the type attibute in the
extension tag?
Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"You may be getting the exception in the GetWebRequest override in the
derived ReportingService class because the HttpContext.Current.Request is
null which causes the call to the AuthCookie property to fail. I'm having a
similar problem that I'm working through right now. Maybe this will give you
some place to start looking for the problem.
Just a thought...
Garry
"Tad" <Tad@.discussions.microsoft.com> wrote in message
news:CF04B8C0-641A-4D50-9A90-B49625266D90@.microsoft.com...
> I have tried to write a custom security extension. When I run the report
> manager I get ...
> Object Reference is not set to an instance of an object.
> It's breaking in GlobalApp.Application_AuthenticationRequest
> I figure its because it can't find my extension but I have the correct Url
> in the securityextensioncodegroup. Could it be the type attibute in the
> extension tag?
> Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"|||Gary,
Have you found a solution to this issue of the
HttpContext.Current.Request being null or found more information on
what might cause this to be null?
- Jessica
Garry Lenz wrote:
> You may be getting the exception in the GetWebRequest override in the
> derived ReportingService class because the
HttpContext.Current.Request is
> null which causes the call to the AuthCookie property to fail. I'm
having a
> similar problem that I'm working through right now. Maybe this will
give you
> some place to start looking for the problem.
> Just a thought...
> Garry
>
> "Tad" <Tad@.discussions.microsoft.com> wrote in message
> news:CF04B8C0-641A-4D50-9A90-B49625266D90@.microsoft.com...
> > I have tried to write a custom security extension. When I run the
report
> > manager I get ...
> >
> > Object Reference is not set to an instance of an object.
> >
> > It's breaking in GlobalApp.Application_AuthenticationRequest
> >
> > I figure its because it can't find my extension but I have the
correct Url
> > in the securityextensioncodegroup. Could it be the type attibute
in the
> > extension tag?
> >
> > Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"|||This looks familiar. It could be one of a myriad of things. In our case,
the custom security extension called a web service, and there was an invalid
type definition in the web reference. We had to delete all our binaries and
web references from the development environment, reattach the web references
and recompile. Then it worked.
I hope that points you in the right direction. Bottom line issue: don't
lose your cookies.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
<Jessica.Landisman@.ndchealth.com> wrote in message
news:1105364285.978877.33130@.c13g2000cwb.googlegroups.com...
> Gary,
> Have you found a solution to this issue of the
> HttpContext.Current.Request being null or found more information on
> what might cause this to be null?
> - Jessica
> Garry Lenz wrote:
>> You may be getting the exception in the GetWebRequest override in the
>> derived ReportingService class because the
> HttpContext.Current.Request is
>> null which causes the call to the AuthCookie property to fail. I'm
> having a
>> similar problem that I'm working through right now. Maybe this will
> give you
>> some place to start looking for the problem.
>> Just a thought...
>> Garry
>>
>> "Tad" <Tad@.discussions.microsoft.com> wrote in message
>> news:CF04B8C0-641A-4D50-9A90-B49625266D90@.microsoft.com...
>> > I have tried to write a custom security extension. When I run the
> report
>> > manager I get ...
>> >
>> > Object Reference is not set to an instance of an object.
>> >
>> > It's breaking in GlobalApp.Application_AuthenticationRequest
>> >
>> > I figure its because it can't find my extension but I have the
> correct Url
>> > in the securityextensioncodegroup. Could it be the type attibute
> in the
>> > extension tag?
>> >
>> > Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"
>sql

Wednesday, March 7, 2012

custom DLL

I have a custom DLL in C# which does a lot of calculations.

I need to use it in my DataFlowTask. I wanted to add it as a reference in ScriptComponent and use it from there, but I do not see my dll there.

The dll is sign but does not have Post-build event command filled in the properties of the project and my dll is deployed and installed to assembly.

What do I do wrong?

How can I use my dll in ScripComponent? Any other options? What am I missing?

Thanks.

Vita wrote:

How can I use my dll in ScripComponent?

Take a read of this:

VSA requires DLLs to be in the Microsoft.Net folder (but not all the time)

(http://blogs.conchango.com/jamiethomson/archive/2005/11/02/SSIS_3A00_-VSA-requires-DLLs-to-be-in-the-Microsoft.Net-folder-_2800_but-not-all-the-time_2900_.aspx)

-Jamie

|||

Got it!

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Would I be able to debug it?

|||

Vita wrote:

Got it!

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Would I be able to debug it?

Unfortunately you can't step through the code in the script component. The best you can do is use message boxes to provide debugging info.

Stepping through code in the script task should work just fine.

-Jamie

|||

Interesting!

I have not used script task yet.

What can it be used for?

Can I calculate some formulas from the data I have in the Database using my custom dll as reference and update (not insert) a table which has some empty fields. How would I specify for example that one field from one table must be added to another field in another table and update third table based on the id?

Thanks a lot.

|||

Vita wrote:

Interesting!

I have not used script task yet.

What can it be used for?

Can I calculate some formulas from the data I have in the Database using my custom dll as reference and update (not insert) a table which has some empty fields. How would I specify for example that one field from one table must be added to another field in another table and update third table based on the id?

Thanks a lot.

Script Component works in the dataflow which means you execute .Net code on data in your pipeline.

Script Task is a task in the control-flow. You can basically do what you want with it - think of the script task as just another host for the clr.

Does that help?

-Jamie

|||thanks a lot!

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!

Custom Code and Report Parameters

Can custom code reference the values of report parameters?Are you going to access from custom code/appl or you are going to use it
from the custom code of the report properties option ? Why I am asking you is
that in 1st case you will get the parameters since you will be passing for
"rendering" the report. In the 2nd case try using =Report.Parameters!Param1
Amarnath.
"QM06" wrote:
> Can custom code reference the values of report parameters?

Custom Code - Reference Report Objects

Hi,
Can anyone point me in the right direction on how to reference report objects in a custom sub or function. For example if I want to assign a value to a report parameter or a textbox
public Sub SetDepth()
Parameters!test.Value = 2
ReportItems!Textbox23.value = "test"
end sub
I've tried really simle stuff like below but i get the following error [BC30469] Reference to a non-shared member requires an object reference.
Cheers
KevinYou can pass in the Parameters or ReportItems collection as an argument to
your function. Note you can't change the values of parameters/textboxes
though - they are read-only.
Fang Wang (MSFT)
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kevin Wilson" <KevinWilson@.discussions.microsoft.com> wrote in message
news:E136C0ED-9890-4315-8455-14687D66FB24@.microsoft.com...
> Hi,
> Can anyone point me in the right direction on how to reference report
objects in a custom sub or function. For example if I want to assign a value
to a report parameter or a textbox
> public Sub SetDepth()
> Parameters!test.Value = 2
> ReportItems!Textbox23.value = "test"
> end sub
> I've tried really simle stuff like below but i get the following error
[BC30469] Reference to a non-shared member requires an object reference.
> Cheers
> Kevin|||How do you do this?
"Fang Wang (MSFT)" wrote:
> You can pass in the Parameters or ReportItems collection as an argument to
> your function. Note you can't change the values of parameters/textboxes
> though - they are read-only.
> Fang Wang (MSFT)
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Kevin Wilson" <KevinWilson@.discussions.microsoft.com> wrote in message
> news:E136C0ED-9890-4315-8455-14687D66FB24@.microsoft.com...
> > Hi,
> > Can anyone point me in the right direction on how to reference report
> objects in a custom sub or function. For example if I want to assign a value
> to a report parameter or a textbox
> >
> > public Sub SetDepth()
> > Parameters!test.Value = 2
> > ReportItems!Textbox23.value = "test"
> > end sub
> >
> > I've tried really simle stuff like below but i get the following error
> [BC30469] Reference to a non-shared member requires an object reference.
> >
> > Cheers
> > Kevin
>
>|||For example if you want to calculate average sales. You have two fields
Number of Units and Sales in dollars.
You can write custom code as below:
Public Function GetAvg(ByVal NoOfUnits As Integer, ByVal TotalSales As
Decimal) As Decimal
Dim ReturnValue As Decimal
ReturnValue = 0
If NoOfUnits <> 0 Then
ReturnValue = TotalSales/NoOfUnits
End If
Return ReturnValue
End
In your table cell you can write expression as:
Code.GetAvg(Fields!Units.Value, Fields!Sales.Value)
When you preview the report, you will see the calculated average value in
that cell.
I hope this helps.
"Tanya" <Tanya@.discussions.microsoft.com> wrote in message
news:68055C09-D38E-4CDA-990C-CD4641594E33@.microsoft.com...
> How do you do this?
> "Fang Wang (MSFT)" wrote:
>> You can pass in the Parameters or ReportItems collection as an argument
>> to
>> your function. Note you can't change the values of parameters/textboxes
>> though - they are read-only.
>> Fang Wang (MSFT)
>> Microsoft SQL Server Reporting Services
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "Kevin Wilson" <KevinWilson@.discussions.microsoft.com> wrote in message
>> news:E136C0ED-9890-4315-8455-14687D66FB24@.microsoft.com...
>> > Hi,
>> > Can anyone point me in the right direction on how to reference report
>> objects in a custom sub or function. For example if I want to assign a
>> value
>> to a report parameter or a textbox
>> >
>> > public Sub SetDepth()
>> > Parameters!test.Value = 2
>> > ReportItems!Textbox23.value = "test"
>> > end sub
>> >
>> > I've tried really simle stuff like below but i get the following error
>> [BC30469] Reference to a non-shared member requires an object reference.
>> >
>> > Cheers
>> > Kevin
>>

Sunday, February 19, 2012

Custom assembly, not a trusted assembly

When I add a reference to my custom assembly to the report and try to preview it I get the following error message:
Parameters Error

The report references the code module ‘Employee, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null’, which is not a trusted assembly.

OK
I have modifed the reporting services rspreviewpolicy.config and rssrvpolicy.config with the following:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Custom_Code_Group"
Description="This code group grants custom code full trust. ">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\Employee.dll"
/>
</CodeGroup>
However it has made no difference. I know I must be missing something. Can anyone point me in the right direction.

Thank you in advance.I just upgraded from RS 2005 Beta 1 to Beta 2. Now I'm having the same problem. I had all of my custom assemblies working fine in Beta 1. When I installed Beta 2, I gleaned from a few postings that I had to move my assemblies to

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

Done.

I then modified RSPreviewPolicy.config in the same folder to give access to these assemblies.

<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="SystemCommon"
Description="Grants permissions to the User Utilities assembly">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\et.User.SystemCommon.dll"
/>
</CodeGroup>

Doesn't work.

"The report references the code module 'et.User.SystemCommon' .... , which is not a trusted assembly."

Question : are there any significant changes to Code Access Security from Beta 1 to Beta 2? In Beta 1, if you did anything wrong in the config file (ie "URLMembershipCondition" vs. "UrlMembershipCondition"), the whole IDE gave out. I'm wondering if perhaps this is a more subtle way of telling me the same thing?

Significantly, the reports are working fine on the server.

I'ma go getta coffee.|||There was a problem with custom assemblies in some of the earlier builds. Your solution should work for the released version.

Friday, February 17, 2012

Custom Assembly generates error in Aggregation Wizard

I have a fairly simple custom assembly for adding some functions to a cube. Having a reference to the assembly in the cube project causes the following error when I try and run the aggregation wizard for the cube:

Message: Errors in the metadata manager. The system assembly cannot be modified by a user request. To restart the process, resolve the problem and then click start.

I get the message after the "Specify Object Counts" step, when it starts the process of determining the aggregations.

Is this a bug or is there something I need to do in the custom assembly differently? I started with the code framework from the AdventureWorksAMO sample project, and added/removed functions.

After applying SP1, I now get the following error when running the aggregation wizard:

"clr assembly must have main file specified"

The workaround is to remove the assembly reference and then run the aggregation wizard, and then re-add the assembly reference.

Although this works, it bring into question why the error in the first place? Any CLR assembly I've tested causes the same problem.

|||

This error will be fixed in the next SP, meanwhile the work-around is indeed to remove the assemblies and add them back after designing aggregations.

About why the error happens in the first place:

- when ran from BI development studio, the aggregation design wizard can have unsaved changes in the background (in the cube and/or dimension editors). or the entire BI project database might not have been deployed

- the wizard requires the database to be saved to the server in order to use the aggregations designing algorithm, so it does temporarily deploy the database (in a transaction that is being rolled back at the end); this is where the error about the assemblies happens

Adrian Dumitrascu

Custom Assembly generates error in Aggregation Wizard

I have a fairly simple custom assembly for adding some functions to a cube. Having a reference to the assembly in the cube project causes the following error when I try and run the aggregation wizard for the cube:

Message: Errors in the metadata manager. The system assembly cannot be modified by a user request. To restart the process, resolve the problem and then click start.

I get the message after the "Specify Object Counts" step, when it starts the process of determining the aggregations.

Is this a bug or is there something I need to do in the custom assembly differently? I started with the code framework from the AdventureWorksAMO sample project, and added/removed functions.

After applying SP1, I now get the following error when running the aggregation wizard:

"clr assembly must have main file specified"

The workaround is to remove the assembly reference and then run the aggregation wizard, and then re-add the assembly reference.

Although this works, it bring into question why the error in the first place? Any CLR assembly I've tested causes the same problem.

|||

This error will be fixed in the next SP, meanwhile the work-around is indeed to remove the assemblies and add them back after designing aggregations.

About why the error happens in the first place:

- when ran from BI development studio, the aggregation design wizard can have unsaved changes in the background (in the cube and/or dimension editors). or the entire BI project database might not have been deployed

- the wizard requires the database to be saved to the server in order to use the aggregations designing algorithm, so it does temporarily deploy the database (in a transaction that is being rolled back at the end); this is where the error about the assemblies happens

Adrian Dumitrascu

Custom Assemblies

Hi,
I had an external assembly for which i had added the reference in the
report.When i view the report in PREVIEW section the report is displyed
properly with the data but when i review in browser the report is shown with
error as "Security Error" where i am referencing the external DLL. Can
anybody tell me how to set security for the external DLL.
Thanks
JasvinderLook at this thread, you have to get Reporting Services trust your DLL.
http://groups.google.de/groups?hl=de&lr=&threadm=OAxg3EQRFHA.4028%40tk2msftngp13.phx.gbl&rnum=1&prev=/groups%3Fq%3Dreporting%2Bservices%2Bassembly%2Bgac%26hl%3Dde%26lr%3D%26scoring%3Dd%26selm%3DOAxg3EQRFHA.4028%2540tk2msftngp13.phx.gbl%26rnum%3D1
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Jasvinder" <Jasvinder@.discussions.microsoft.com> schrieb im Newsbeitrag
news:7800CAD7-7871-4104-B175-9FC2133CAC9A@.microsoft.com...
> Hi,
> I had an external assembly for which i had added the reference in the
> report.When i view the report in PREVIEW section the report is displyed
> properly with the data but when i review in browser the report is shown
> with
> error as "Security Error" where i am referencing the external DLL. Can
> anybody tell me how to set security for the external DLL.
> Thanks
> Jasvinder

Tuesday, February 14, 2012

Custom application advice

Hi,
I have made a custom web application using .asp and an
Access 2000 backend database. This application allows
users to enter reference numbers. Once reference numbers
are entered, a list is generated to be run on an external
database to get account information for the account
reference in question. By this I mean the account
holder's name, address, postcode etc...
Next, I have to import this back into the database so that
the database is enriched with more information. Staff
then work on the records, phoning customers to make sure
details are correct etc... If details are not correct,
then amendments are made on screen and saved to the
database along with the original record. This is to show
what the original record looked like and the revised
version - if there were any changes.
My problem at the moment is getting the whole thing going
for real as the setup is a test. I want to migrate to
SQL2000 and make this application run in a live
environment so that I can upload the enriched files on a
daily basis quickly and easily. Furthermore, it has been
discussed whether I can upload enriched data (maybe a .txt
file) onto the main database using a file upload facility -
is this possible?
At the moment, this is how my system works - which is
still at trial stage, so I would not mind any comments on
improvement:
1. Enter customer references. This gets posted into a
table with a timestamp, user's name (for tracking)
2. I then generate a list of two or more occurences of the
customer references. This part I am unsure about,
particularly when my list of two or more would have
different ID numbers from the records in my original table!
3. Once an external enrichment process has occurred, then
I import and overwrite the entire table (is this right?)
4. Staff can then search for and lookup the enriched data
by entering a customer reference. There is then a form
beside the original data, where they can post any
amendments.
5. Amendments are then created as a new record inthe
table, flagged as 'Amendment' and the original record
flagged as 'Original'.
6. A list can then be produced showing the Original Data
and Amendments on fields that have been amended.
Help will be appreciated.
Thanks.
SKC
The newsgroups aren't really the best venue for designing entire
applications. However, if this is a web application, I'd recommend
that you explore using asp.net, where you can work more easily with
XML and SQL Server. www.gotdotnet.com is a great source of more
information, tutorials, and samples to get you started.
--Mary
On Wed, 1 Sep 2004 02:15:16 -0700, "skc"
<anonymous@.discussions.microsoft.com> wrote:

>Hi,
>I have made a custom web application using .asp and an
>Access 2000 backend database. This application allows
>users to enter reference numbers. Once reference numbers
>are entered, a list is generated to be run on an external
>database to get account information for the account
>reference in question. By this I mean the account
>holder's name, address, postcode etc...
>Next, I have to import this back into the database so that
>the database is enriched with more information. Staff
>then work on the records, phoning customers to make sure
>details are correct etc... If details are not correct,
>then amendments are made on screen and saved to the
>database along with the original record. This is to show
>what the original record looked like and the revised
>version - if there were any changes.
>My problem at the moment is getting the whole thing going
>for real as the setup is a test. I want to migrate to
>SQL2000 and make this application run in a live
>environment so that I can upload the enriched files on a
>daily basis quickly and easily. Furthermore, it has been
>discussed whether I can upload enriched data (maybe a .txt
>file) onto the main database using a file upload facility -
> is this possible?
>At the moment, this is how my system works - which is
>still at trial stage, so I would not mind any comments on
>improvement:
>1. Enter customer references. This gets posted into a
>table with a timestamp, user's name (for tracking)
>2. I then generate a list of two or more occurences of the
>customer references. This part I am unsure about,
>particularly when my list of two or more would have
>different ID numbers from the records in my original table!
>3. Once an external enrichment process has occurred, then
>I import and overwrite the entire table (is this right?)
>4. Staff can then search for and lookup the enriched data
>by entering a customer reference. There is then a form
>beside the original data, where they can post any
>amendments.
>5. Amendments are then created as a new record inthe
>table, flagged as 'Amendment' and the original record
>flagged as 'Original'.
>6. A list can then be produced showing the Original Data
>and Amendments on fields that have been amended.
>Help will be appreciated.
>Thanks.
>SKC