显示标签为“excel”的博文。显示所有博文
显示标签为“excel”的博文。显示所有博文

2012年2月25日星期六

Disabling Links in Excel, PDF

I am displaying some links using Jump To URL in my Report. I want to Disable
those links when I export the report to Excel or PDF
Does anyone have any clue as how wwe can disable those links when report
gets exported to Excel, PDF.
--
Thanks!
AshishI also need to know how to disable this.
"Ashish" wrote:
> I am displaying some links using Jump To URL in my Report. I want to Disable
> those links when I export the report to Excel or PDF
> Does anyone have any clue as how wwe can disable those links when report
> gets exported to Excel, PDF.
> --
> Thanks!
> Ashish

Disabling Export to Excel Sheets In MS SQL Reports 2005

Hello All,

Can i disable export to Excel sheet in ms sql server 2005 reporting services.

This is due to security reasons as the client doesnt want the reports to be send via mail.

Can someone provide the solution on how to disable export to excel

Thanks

Pritam Shetty

Look at the article here:

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

This will only disable the option in the Report Manager, URL access will be still allowed.

Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

I'm a little concerned about something...

>>

This is due to security reasons as the client doesnt want the reports to be send via mail.

<<

Disabling export doesn't prevent the reports from being sent email. Someone can still select the text on the page and dump it into an e-mail message from the HTML version, or Save the page As and attach the result to an email.

>L<

|||

Hello Lisa,

Indirectly i will be disabling all the options.

As of the copy paste thing the clients are ok with it.

But They have just asked to disble the export feature.

So i m just going with it as of now

Thanks & Regards

Pritam Shetty

Disabling 'Export to excel' option when record count >5000 in a re

Hi,
I have a report that has two drill downs that drill to about 5000 records
and due to this I am having time out problems while exporting to excel. For
now, we have worked around the timeout problem but what I would like to know
is whether or not there is a way to disable the excel option in the export
drop down list - only when the SQL report generates like more than 5000 rows.
The reason to disable being, the RS/RM is consuming CPU like crazy and its
repurcussions are unbearable.Hi,
The only thing you can do is to disable Excel export server wide. This you
can do in the RSReportServer.config and add Visible="false" to the element of
the Excel export.
Unfortunately it isn't possible to set it per report or even dynamic.
Jan Pieter Posthuma
"Jammer" wrote:
> Hi,
> I have a report that has two drill downs that drill to about 5000 records
> and due to this I am having time out problems while exporting to excel. For
> now, we have worked around the timeout problem but what I would like to know
> is whether or not there is a way to disable the excel option in the export
> drop down list - only when the SQL report generates like more than 5000 rows.
> The reason to disable being, the RS/RM is consuming CPU like crazy and its
> repurcussions are unbearable.|||"Jan Pieter Posthuma" <JanPieterPosthuma@.discussions.microsoft.com> wrote in
message news:B18CDAAB-35F2-4CA6-AC13-EC30640558EA@.microsoft.com...
> Hi,
> The only thing you can do is to disable Excel export server wide. This you
> can do in the RSReportServer.config and add Visible="false" to the element
> of
> the Excel export.
> Unfortunately it isn't possible to set it per report or even dynamic.
>
If you take a short peek into the generated script when you activate the
toolbar, you can create your own 'export' button with or without excel
export very easily (rs:format=EXCEL)
I modified the ReportViewer sample to display a small popup toolbar with:
export the Excel, PDF and Print on it (takes up way less space then the
standard toolbar)
Alfred|||Hey Alfred,
Can you tell me how you achieved creating your own export to excel bar:
Thanks
Balaji
"Smeenk, A.D." wrote:
> "Jan Pieter Posthuma" <JanPieterPosthuma@.discussions.microsoft.com> wrote in
> message news:B18CDAAB-35F2-4CA6-AC13-EC30640558EA@.microsoft.com...
> > Hi,
> >
> > The only thing you can do is to disable Excel export server wide. This you
> > can do in the RSReportServer.config and add Visible="false" to the element
> > of
> > the Excel export.
> >
> > Unfortunately it isn't possible to set it per report or even dynamic.
> >
> If you take a short peek into the generated script when you activate the
> toolbar, you can create your own 'export' button with or without excel
> export very easily (rs:format=EXCEL)
> I modified the ReportViewer sample to display a small popup toolbar with:
> export the Excel, PDF and Print on it (takes up way less space then the
> standard toolbar)
> Alfred
>
>|||"Balaji" <Balaji@.discussions.microsoft.com> wrote in message
news:29713B57-0C78-4AB9-B7BE-8E5234D59809@.microsoft.com...
> Hey Alfred,
> Can you tell me how you achieved creating your own export to excel bar:
>
Like I said, I modifed the ReportViewer sample, its (by default) installed
here:
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\Samples\Applications\ReportViewer
I modified the properties and added 'small' to the ToolBar options, and when
selected I generate different code. I add an extra table around the iframe
and use a div to display a popup menu like when you hover over an image in
IE. The 'onclick' of the images activates a new window with the requested
export of the report (actually a re-render of the report I think, I didn't
add the session ID)
Alfred|||Instead of disabling export to Excel you might want to add a link at the top
of the page that says Export Data. Use jump to URL and specify CSV and ASCII
(the CSV export does Unicode and Excel doesn't handle unicode CSV). By
rendering in ASCII CSV Excel comes up automatically and this is very very
fast. I had an Excel export that took 5 minutes and brought the server to
its knees go to 10 seconds.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Smeenk, A.D." <alfreds@.dbs-at-nospam-at-nl> wrote in message
news:uX66yHuVFHA.2196@.TK2MSFTNGP09.phx.gbl...
> "Balaji" <Balaji@.discussions.microsoft.com> wrote in message
> news:29713B57-0C78-4AB9-B7BE-8E5234D59809@.microsoft.com...
>> Hey Alfred,
>> Can you tell me how you achieved creating your own export to excel bar:
> Like I said, I modifed the ReportViewer sample, its (by default) installed
> here:
> C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\Samples\Applications\ReportViewer
> I modified the properties and added 'small' to the ToolBar options, and
> when selected I generate different code. I add an extra table around the
> iframe and use a div to display a popup menu like when you hover over an
> image in IE. The 'onclick' of the images activates a new window with the
> requested export of the report (actually a re-render of the report I
> think, I didn't add the session ID)
> Alfred
>|||"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:%23HdntxuVFHA.2664@.TK2MSFTNGP15.phx.gbl...
> Instead of disabling export to Excel you might want to add a link at the
> top of the page that says Export Data. Use jump to URL and specify CSV and
> ASCII (the CSV export does Unicode and Excel doesn't handle unicode CSV).
> By rendering in ASCII CSV Excel comes up automatically and this is very
> very fast. I had an Excel export that took 5 minutes and brought the
> server to its knees go to 10 seconds.
>
That 'export to CSV' should 'officially' be on the right-click menu when you
view a table layout report part, now for some reason that does not function
on all machines... any idea's?
Yes same report, all machines Windows XP SP2, IE 6.
With one person the option re-appeared after a reset of the local intranet
security to default...
Alfred|||No idea about that. Note that the export to CSV you are talking about
exports as Unicode and Excel will bring it all together in a single column.
Bruce L-C
"Smeenk, A.D." <alfreds@.dbs-at-nospam-at-nl> wrote in message
news:OFAlFu4VFHA.1452@.TK2MSFTNGP14.phx.gbl...
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:%23HdntxuVFHA.2664@.TK2MSFTNGP15.phx.gbl...
>> Instead of disabling export to Excel you might want to add a link at the
>> top of the page that says Export Data. Use jump to URL and specify CSV
>> and ASCII (the CSV export does Unicode and Excel doesn't handle unicode
>> CSV). By rendering in ASCII CSV Excel comes up automatically and this is
>> very very fast. I had an Excel export that took 5 minutes and brought the
>> server to its knees go to 10 seconds.
> That 'export to CSV' should 'officially' be on the right-click menu when
> you view a table layout report part, now for some reason that does not
> function on all machines... any idea's?
> Yes same report, all machines Windows XP SP2, IE 6.
> With one person the option re-appeared after a reset of the local intranet
> security to default...
> Alfred
>|||Why don't you increase the timeout?
Farahmand
"Jammer" wrote:
> Hi,
> I have a report that has two drill downs that drill to about 5000 records
> and due to this I am having time out problems while exporting to excel. For
> now, we have worked around the timeout problem but what I would like to know
> is whether or not there is a way to disable the excel option in the export
> drop down list - only when the SQL report generates like more than 5000 rows.
> The reason to disable being, the RS/RM is consuming CPU like crazy and its
> repurcussions are unbearable.|||Why don't you increase the timeout?
Farahmand
"Jammer" wrote:
> Hi,
> I have a report that has two drill downs that drill to about 5000 records
> and due to this I am having time out problems while exporting to excel. For
> now, we have worked around the timeout problem but what I would like to know
> is whether or not there is a way to disable the excel option in the export
> drop down list - only when the SQL report generates like more than 5000 rows.
> The reason to disable being, the RS/RM is consuming CPU like crazy and its
> repurcussions are unbearable.

2012年2月17日星期五

Disable Hyperlink in EXCEL

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
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>