Is there a way for a custom assembly to access the current HttpContext of a
report? We'd like to be able to access the Request.ServerVariables
collection to pull a value that will help determine what is displayed on a
report. We recently had a problem with a custom assembly accessing an
environment variable, but fixed it by setting the EnvironmentPermission in
the code, and giving the assembly full trust (see below).
I'm wondering if there is some other form of Permission I can assert to gain
access to the Http Request object. Any help is appreciated! Thanks!
Added the following to the code:
EnvironmentPermission envPerm = new
EnvironmentPermission(EnvironmentPermissionAccess.Read, "APP_ENVIRONMENT")
envPerm.Assert();
In the rssrvpolicy.config file, added the following, which points to the URL
of the custom assembly:
<CodeGroup
class="UnionCodeGroup"
version="1"
Name="RSGlobalCodeGroup"
Description="Code group for RS_Global custom assembly"
PermissionSetName="FullTrust"
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\*"Hi Dilworth,
See you again:). As for accessing HttpContext in reporting service's
custom assembly code, IMO, I think this is not recommended. You can try
using the HttpContext.Current property to access the current executing http
request, context in the report server project. However, there is no
documenation indicate the custom assembly's code will always be executed on
the asp.net request's execution thread (worker thread...), so we can not
make sure whether it always works. Also, even it works currently, this is
not guaranteed to remain across further version changing...
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| Thread-Topic: Can custom assembly access current HttpContext of report?
| thread-index: AcYgMH0bKS9Dl18GR2GdCFdQNk9SwQ==| X-WBNR-Posting-Host: 162.111.235.36
| From: "=?Utf-8?B?RGF2aWQ=?=" <dilworth@.newsgroups.nospam>
| Subject: Can custom assembly access current HttpContext of report?
| Date: Mon, 23 Jan 2006 07:20:05 -0800
| Lines: 30
| Message-ID: <958E966D-0D3D-44FC-8899-47D76F7FE643@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67314
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Is there a way for a custom assembly to access the current HttpContext of
a
| report? We'd like to be able to access the Request.ServerVariables
| collection to pull a value that will help determine what is displayed on
a
| report. We recently had a problem with a custom assembly accessing an
| environment variable, but fixed it by setting the EnvironmentPermission
in
| the code, and giving the assembly full trust (see below).
|
| I'm wondering if there is some other form of Permission I can assert to
gain
| access to the Http Request object. Any help is appreciated! Thanks!
|
|
| Added the following to the code:
| EnvironmentPermission envPerm = new
| EnvironmentPermission(EnvironmentPermissionAccess.Read, "APP_ENVIRONMENT")
| envPerm.Assert();
|
| In the rssrvpolicy.config file, added the following, which points to the
URL
| of the custom assembly:
|
| <CodeGroup
| class="UnionCodeGroup"
| version="1"
| Name="RSGlobalCodeGroup"
| Description="Code group for RS_Global custom assembly"
| PermissionSetName="FullTrust"
| <IMembershipCondition
| class="UrlMembershipCondition"
| version="1"
| Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
| Services\ReportServer\bin\*"
||||Hi Steven,
You have been very helpful to us! :) Thanks for the info - we were
skeptical that this would even work, since we've tried before with no
success. It's not essential anyway, so we will just work around it.
"Steven Cheng[MSFT]" wrote:
> Hi Dilworth,
> See you again:). As for accessing HttpContext in reporting service's
> custom assembly code, IMO, I think this is not recommended. You can try
> using the HttpContext.Current property to access the current executing http
> request, context in the report server project. However, there is no
> documenation indicate the custom assembly's code will always be executed on
> the asp.net request's execution thread (worker thread...), so we can not
> make sure whether it always works. Also, even it works currently, this is
> not guaranteed to remain across further version changing...
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
> --
> | Thread-Topic: Can custom assembly access current HttpContext of report?
> | thread-index: AcYgMH0bKS9Dl18GR2GdCFdQNk9SwQ==> | X-WBNR-Posting-Host: 162.111.235.36
> | From: "=?Utf-8?B?RGF2aWQ=?=" <dilworth@.newsgroups.nospam>
> | Subject: Can custom assembly access current HttpContext of report?
> | Date: Mon, 23 Jan 2006 07:20:05 -0800
> | Lines: 30
> | Message-ID: <958E966D-0D3D-44FC-8899-47D76F7FE643@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67314
> | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> |
> | Is there a way for a custom assembly to access the current HttpContext of
> a
> | report? We'd like to be able to access the Request.ServerVariables
> | collection to pull a value that will help determine what is displayed on
> a
> | report. We recently had a problem with a custom assembly accessing an
> | environment variable, but fixed it by setting the EnvironmentPermission
> in
> | the code, and giving the assembly full trust (see below).
> |
> | I'm wondering if there is some other form of Permission I can assert to
> gain
> | access to the Http Request object. Any help is appreciated! Thanks!
> |
> |
> | Added the following to the code:
> | EnvironmentPermission envPerm = new
> | EnvironmentPermission(EnvironmentPermissionAccess.Read, "APP_ENVIRONMENT")
> | envPerm.Assert();
> |
> | In the rssrvpolicy.config file, added the following, which points to the
> URL
> | of the custom assembly:
> |
> | <CodeGroup
> | class="UnionCodeGroup"
> | version="1"
> | Name="RSGlobalCodeGroup"
> | Description="Code group for RS_Global custom assembly"
> | PermissionSetName="FullTrust"
> | <IMembershipCondition
> | class="UrlMembershipCondition"
> | version="1"
> | Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> | Services\ReportServer\bin\*"
> |
>|||That' fine. Thanks for your followup.
Good luck!
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--
| Thread-Topic: Can custom assembly access current HttpContext of report?
| thread-index: AcYg5YebIVPSWWtwQE+riQK7Aps/tg==| X-WBNR-Posting-Host: 162.111.235.18
| From: "=?Utf-8?B?RGF2aWQ=?=" <dilworth@.newsgroups.nospam>
| References: <958E966D-0D3D-44FC-8899-47D76F7FE643@.microsoft.com>
<39LLlNJIGHA.1236@.TK2MSFTNGXA02.phx.gbl>
| Subject: RE: Can custom assembly access current HttpContext of report?
| Date: Tue, 24 Jan 2006 04:56:02 -0800
| Lines: 94
| Message-ID: <DF3D5585-7B7E-45DE-BE0B-CB405BE710FB@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67386
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Hi Steven,
|
| You have been very helpful to us! :) Thanks for the info - we were
| skeptical that this would even work, since we've tried before with no
| success. It's not essential anyway, so we will just work around it.
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Dilworth,
| >
| > See you again:). As for accessing HttpContext in reporting service's
| > custom assembly code, IMO, I think this is not recommended. You can try
| > using the HttpContext.Current property to access the current executing
http
| > request, context in the report server project. However, there is no
| > documenation indicate the custom assembly's code will always be
executed on
| > the asp.net request's execution thread (worker thread...), so we can
not
| > make sure whether it always works. Also, even it works currently, this
is
| > not guaranteed to remain across further version changing...
| >
| > Regards,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --
| > | Thread-Topic: Can custom assembly access current HttpContext of
report?
| > | thread-index: AcYgMH0bKS9Dl18GR2GdCFdQNk9SwQ==| > | X-WBNR-Posting-Host: 162.111.235.36
| > | From: "=?Utf-8?B?RGF2aWQ=?=" <dilworth@.newsgroups.nospam>
| > | Subject: Can custom assembly access current HttpContext of report?
| > | Date: Mon, 23 Jan 2006 07:20:05 -0800
| > | Lines: 30
| > | Message-ID: <958E966D-0D3D-44FC-8899-47D76F7FE643@.microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.reportingsvcs
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.sqlserver.reportingsvcs:67314
| > | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
| > |
| > | Is there a way for a custom assembly to access the current
HttpContext of
| > a
| > | report? We'd like to be able to access the Request.ServerVariables
| > | collection to pull a value that will help determine what is displayed
on
| > a
| > | report. We recently had a problem with a custom assembly accessing
an
| > | environment variable, but fixed it by setting the
EnvironmentPermission
| > in
| > | the code, and giving the assembly full trust (see below).
| > |
| > | I'm wondering if there is some other form of Permission I can assert
to
| > gain
| > | access to the Http Request object. Any help is appreciated! Thanks!
| > |
| > |
| > | Added the following to the code:
| > | EnvironmentPermission envPerm = new
| > | EnvironmentPermission(EnvironmentPermissionAccess.Read,
"APP_ENVIRONMENT")
| > | envPerm.Assert();
| > |
| > | In the rssrvpolicy.config file, added the following, which points to
the
| > URL
| > | of the custom assembly:
| > |
| > | <CodeGroup
| > | class="UnionCodeGroup"
| > | version="1"
| > | Name="RSGlobalCodeGroup"
| > | Description="Code group for RS_Global custom assembly"
| > | PermissionSetName="FullTrust"
| > | <IMembershipCondition
| > | class="UrlMembershipCondition"
| > | version="1"
| > | Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
| > | Services\ReportServer\bin\*"
| > |
| >
| >
|
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment