Can I disable/hide the hyperlink (jump to report) once the report is exported
to Excel but ENABLE in browser ?"May Liu" wrote:
> Can I disable/hide the hyperlink (jump to report) once the report is exported
> to Excel but ENABLE in browser ?
I asked a similar question myself:
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
No reply yet. This seems like a pretty annoying problem, has anyone else
faced it? Anyone have ideas for workarounds (none that I've thought of
have worked yet)?
Tim|||This is not supported natively by the Report Server, but here is an approach
you can try:
Since the Report Server is a web application, you should be able to write
custom code to obtain the report URL from HttpContext.Current. Then, you can
determine which format the report is requested. If this works, you can base
the Jump To action on a expression which calls your custom function and
return "" if the export format is Excel. Please note that
HttpContext.Current is not available when the report is previewed under the
Report Designer so you have to check if it is null.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"timseal" <timseal@.discussions.microsoft.com> wrote in message
news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> "May Liu" wrote:
> > Can I disable/hide the hyperlink (jump to report) once the report is
exported
> > to Excel but ENABLE in browser ?
> I asked a similar question myself:
>
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> No reply yet. This seems like a pretty annoying problem, has anyone else
> faced it? Anyone have ideas for workarounds (none that I've thought of
> have worked yet)?
> Tim|||I write the following code in Custom Code:
Function GetExportFormat() as string
GetExportFormat = System.Web.HttpContext.Current
End Function
Error is shown : HttpContext is not a member of Web.
What's wrong with my code ?
"Teo Lachev [MVP]" wrote:
> This is not supported natively by the Report Server, but here is an approach
> you can try:
> Since the Report Server is a web application, you should be able to write
> custom code to obtain the report URL from HttpContext.Current. Then, you can
> determine which format the report is requested. If this works, you can base
> the Jump To action on a expression which calls your custom function and
> return "" if the export format is Excel. Please note that
> HttpContext.Current is not available when the report is previewed under the
> Report Designer so you have to check if it is null.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "timseal" <timseal@.discussions.microsoft.com> wrote in message
> news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> >
> > "May Liu" wrote:
> >
> > > Can I disable/hide the hyperlink (jump to report) once the report is
> exported
> > > to Excel but ENABLE in browser ?
> >
> > I asked a similar question myself:
> >
> http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> >
> > No reply yet. This seems like a pretty annoying problem, has anyone else
> > faced it? Anyone have ideas for workarounds (none that I've thought of
> > have worked yet)?
> >
> > Tim
>
>|||You need to add System.Web.dll to your project references.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> I write the following code in Custom Code:
> Function GetExportFormat() as string
> GetExportFormat = System.Web.HttpContext.Current
> End Function
> Error is shown : HttpContext is not a member of Web.
> What's wrong with my code ?
> "Teo Lachev [MVP]" wrote:
> > This is not supported natively by the Report Server, but here is an
approach
> > you can try:
> >
> > Since the Report Server is a web application, you should be able to
write
> > custom code to obtain the report URL from HttpContext.Current. Then, you
can
> > determine which format the report is requested. If this works, you can
base
> > the Jump To action on a expression which calls your custom function and
> > return "" if the export format is Excel. Please note that
> > HttpContext.Current is not available when the report is previewed under
the
> > Report Designer so you have to check if it is null.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > >
> > > "May Liu" wrote:
> > >
> > > > Can I disable/hide the hyperlink (jump to report) once the report is
> > exported
> > > > to Excel but ENABLE in browser ?
> > >
> > > I asked a similar question myself:
> > >
> >
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > >
> > > No reply yet. This seems like a pretty annoying problem, has anyone
else
> > > faced it? Anyone have ideas for workarounds (none that I've thought
of
> > > have worked yet)?
> > >
> > > Tim
> >
> >
> >|||I have added the System.Web.dll in my project reference. Then I add textbox
which value is return value of custome code. The function is as follow:
Function GetHttpContext() as string
If Not System.Web.HttpContext.Current Is Nothing
'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
GetHttpContext = "Not Nothing"
else
GetHttpContext = "Nothing"
End If
End Function
But it returns #Error. I have deployed in Report Manager so that the report
is not run in design mode.
What's wrong with my code ?
"Teo Lachev [MVP]" wrote:
> You need to add System.Web.dll to your project references.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > I write the following code in Custom Code:
> >
> > Function GetExportFormat() as string
> > GetExportFormat = System.Web.HttpContext.Current
> > End Function
> >
> > Error is shown : HttpContext is not a member of Web.
> > What's wrong with my code ?
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > This is not supported natively by the Report Server, but here is an
> approach
> > > you can try:
> > >
> > > Since the Report Server is a web application, you should be able to
> write
> > > custom code to obtain the report URL from HttpContext.Current. Then, you
> can
> > > determine which format the report is requested. If this works, you can
> base
> > > the Jump To action on a expression which calls your custom function and
> > > return "" if the export format is Excel. Please note that
> > > HttpContext.Current is not available when the report is previewed under
> the
> > > Report Designer so you have to check if it is null.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > >
> > > > "May Liu" wrote:
> > > >
> > > > > Can I disable/hide the hyperlink (jump to report) once the report is
> > > exported
> > > > > to Excel but ENABLE in browser ?
> > > >
> > > > I asked a similar question myself:
> > > >
> > >
> http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > >
> > > > No reply yet. This seems like a pretty annoying problem, has anyone
> else
> > > > faced it? Anyone have ideas for workarounds (none that I've thought
> of
> > > > have worked yet)?
> > > >
> > > > Tim
> > >
> > >
> > >
>
>|||May,
Perhaps you are not using the Code keyword to call your function or security
is not set properly. I did a quick test and the following worked for me:
1. Added the following static function to an external assembly:
public static string GetHttpContext() {
if (System.Web.HttpContext.Current != null)
return System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
else
return "N/A";
}
2. Registered the assembly in the report by browsing to the assembly in the
report References tab.
3. Added a textbox to my report with a value of
="URL: " & AWC.RS.Library.RsLibrary.GetHttpContext()
4. Assign full CAS rights to the assembly in rssrvpolicy.config as follows:
<CodeGroup class="UnionCodeGroup" version="1"
PermissionSetName="FullTrust" Name="AWCLibrary">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\AWC.RS.Library.dll"/>
</CodeGroup>
Some additional notes:
1. You need to use rs:ClearSession=True with each request to avoid session
caching from the browser. By default, IE sends the session identifier with
each request. When the Report Server decides to reuse the session, it
doesn't process the report. Instead, it uses the report cached intermediate
format and it just renders the report in the requested format. In this case,
AbsoluteUri will return the original report URL.
2. For some reason the URL is not displayed in the Excel format. However,
this shouldn't be a problem for you because you are not interested in
displaying the URL but just finding out the requested format.
3. To debug the function, change the assembly build output to C:\Program
Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin and
attach to aspnet_wp.exe (XP or Windows 2000) or w3wp.exe (Windows 2003).
Make sure that Common Language code is selected.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:FAF99299-D72A-41A2-B116-A9E6A666F933@.microsoft.com...
> I have added the System.Web.dll in my project reference. Then I add
textbox
> which value is return value of custome code. The function is as follow:
> Function GetHttpContext() as string
> If Not System.Web.HttpContext.Current Is Nothing
> 'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
> GetHttpContext = "Not Nothing"
> else
> GetHttpContext = "Nothing"
> End If
> End Function
> But it returns #Error. I have deployed in Report Manager so that the
report
> is not run in design mode.
> What's wrong with my code ?
> "Teo Lachev [MVP]" wrote:
> > You need to add System.Web.dll to your project references.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > > I write the following code in Custom Code:
> > >
> > > Function GetExportFormat() as string
> > > GetExportFormat = System.Web.HttpContext.Current
> > > End Function
> > >
> > > Error is shown : HttpContext is not a member of Web.
> > > What's wrong with my code ?
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > This is not supported natively by the Report Server, but here is an
> > approach
> > > > you can try:
> > > >
> > > > Since the Report Server is a web application, you should be able to
> > write
> > > > custom code to obtain the report URL from HttpContext.Current. Then,
you
> > can
> > > > determine which format the report is requested. If this works, you
can
> > base
> > > > the Jump To action on a expression which calls your custom function
and
> > > > return "" if the export format is Excel. Please note that
> > > > HttpContext.Current is not available when the report is previewed
under
> > the
> > > > Report Designer so you have to check if it is null.
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > > >
> > > > > "May Liu" wrote:
> > > > >
> > > > > > Can I disable/hide the hyperlink (jump to report) once the
report is
> > > > exported
> > > > > > to Excel but ENABLE in browser ?
> > > > >
> > > > > I asked a similar question myself:
> > > > >
> > > >
> >
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > > >
> > > > > No reply yet. This seems like a pretty annoying problem, has
anyone
> > else
> > > > > faced it? Anyone have ideas for workarounds (none that I've
thought
> > of
> > > > > have worked yet)?
> > > > >
> > > > > Tim
> > > >
> > > >
> > > >
> >
> >
> >|||Actually, the URL is showing in Excel. It was just wrapping around the row
and it was hidden. Duh!
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com> wrote in message
news:%23VCcwuh1EHA.1264@.TK2MSFTNGP12.phx.gbl...
> May,
> Perhaps you are not using the Code keyword to call your function or
security
> is not set properly. I did a quick test and the following worked for me:
> 1. Added the following static function to an external assembly:
> public static string GetHttpContext() {
> if (System.Web.HttpContext.Current != null)
> return System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
> else
> return "N/A";
> }
> 2. Registered the assembly in the report by browsing to the assembly in
the
> report References tab.
> 3. Added a textbox to my report with a value of
> ="URL: " & AWC.RS.Library.RsLibrary.GetHttpContext()
> 4. Assign full CAS rights to the assembly in rssrvpolicy.config as
follows:
> <CodeGroup class="UnionCodeGroup" version="1"
> PermissionSetName="FullTrust" Name="AWCLibrary">
> <IMembershipCondition class="UrlMembershipCondition" version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\AWC.RS.Library.dll"/>
> </CodeGroup>
>
> Some additional notes:
> 1. You need to use rs:ClearSession=True with each request to avoid session
> caching from the browser. By default, IE sends the session identifier with
> each request. When the Report Server decides to reuse the session, it
> doesn't process the report. Instead, it uses the report cached
intermediate
> format and it just renders the report in the requested format. In this
case,
> AbsoluteUri will return the original report URL.
> 2. For some reason the URL is not displayed in the Excel format. However,
> this shouldn't be a problem for you because you are not interested in
> displaying the URL but just finding out the requested format.
> 3. To debug the function, change the assembly build output to C:\Program
> Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin and
> attach to aspnet_wp.exe (XP or Windows 2000) or w3wp.exe (Windows 2003).
> Make sure that Common Language code is selected.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:FAF99299-D72A-41A2-B116-A9E6A666F933@.microsoft.com...
> > I have added the System.Web.dll in my project reference. Then I add
> textbox
> > which value is return value of custome code. The function is as follow:
> >
> > Function GetHttpContext() as string
> > If Not System.Web.HttpContext.Current Is Nothing
> > 'GetHttpContext = System.Web.HttpContext.Current.Request.Url.Host()
> > GetHttpContext = "Not Nothing"
> > else
> > GetHttpContext = "Nothing"
> > End If
> > End Function
> >
> > But it returns #Error. I have deployed in Report Manager so that the
> report
> > is not run in design mode.
> > What's wrong with my code ?
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > You need to add System.Web.dll to your project references.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > > news:73451CD4-AE35-4F53-BB01-C22A2F6A3DD1@.microsoft.com...
> > > > I write the following code in Custom Code:
> > > >
> > > > Function GetExportFormat() as string
> > > > GetExportFormat = System.Web.HttpContext.Current
> > > > End Function
> > > >
> > > > Error is shown : HttpContext is not a member of Web.
> > > > What's wrong with my code ?
> > > >
> > > > "Teo Lachev [MVP]" wrote:
> > > >
> > > > > This is not supported natively by the Report Server, but here is
an
> > > approach
> > > > > you can try:
> > > > >
> > > > > Since the Report Server is a web application, you should be able
to
> > > write
> > > > > custom code to obtain the report URL from HttpContext.Current.
Then,
> you
> > > can
> > > > > determine which format the report is requested. If this works, you
> can
> > > base
> > > > > the Jump To action on a expression which calls your custom
function
> and
> > > > > return "" if the export format is Excel. Please note that
> > > > > HttpContext.Current is not available when the report is previewed
> under
> > > the
> > > > > Report Designer so you have to check if it is null.
> > > > >
> > > > > --
> > > > > Hope this helps.
> > > > >
> > > > > ---
> > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > Author: "Microsoft Reporting Services in Action"
> > > > > Publisher website: http://www.manning.com/lachev
> > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > Home page and blog: http://www.prologika.com/
> > > > > ---
> > > > >
> > > > > "timseal" <timseal@.discussions.microsoft.com> wrote in message
> > > > > news:6ADDBBF6-1154-4F3F-9D6C-68446FED825D@.microsoft.com...
> > > > > >
> > > > > > "May Liu" wrote:
> > > > > >
> > > > > > > Can I disable/hide the hyperlink (jump to report) once the
> report is
> > > > > exported
> > > > > > > to Excel but ENABLE in browser ?
> > > > > >
> > > > > > I asked a similar question myself:
> > > > > >
> > > > >
> > >
>
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=da6e65db-909e-41f4-b772-114cdd4d7a8e&cat=&lang=&cr=&sloc=en-us&p=1
> > > > > >
> > > > > > No reply yet. This seems like a pretty annoying problem, has
> anyone
> > > else
> > > > > > faced it? Anyone have ideas for workarounds (none that I've
> thought
> > > of
> > > > > > have worked yet)?
> > > > > >
> > > > > > Tim
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
没有评论:
发表评论