Discussion:
Can I change the text on the "View Report" button?
(too old to reply)
Chris G.
2006-09-07 18:39:02 UTC
Permalink
SSRS 2005

In the web form Report Viewer Control, is there a simple way to change the
text that appears on the "View Report" button?

I would like to either shorten the text or have it appear on two lines to
minimize the page width taken up by this button.

-- Chris
--
Chris, SSSI
Steven Cheng[MSFT]
2006-09-08 06:04:50 UTC
Permalink
Hello Chris,

As for the ReportViewer Control's "ViewButton", based on my research, it is
encapsulated as an "ViewReportButton" class which is an internal Type. I've
tried reference to this button instance from ReportViewer control's
Controls collection and change it Text, but that didn't work. I think it is
internally assigned the "View Report" text value. Actually since
Reportviewer is a well encapsulated webcontrol, there hasn't much options
for us to customize its individual settigns.

So far what I can get are the following two options if we want to provide a
custom parameterArea or button:

1. Still use the ReportViewer's built-in parameterArea and
ViewReportButton, however, we can only change the button's text by using
clent-side script(find the submit button and change its value), e.g:

==========================
<script language="javascript">
function AdjustViewButton()
{
var div = document.getElementById("ReportViewer1");
elems = form1.getElementsByTagName("INPUT");

var i;

for(i=0;i<elems.length;i++)
{
if(elems[i].type == "submit" && elems[i].value == "View Report")
{
elems[i].value = "View";
}
}
}
.................................

<body onload="AdjustViewButton();" >
....................
=============================


2. Do not use the built-in parametersArea of the ReportViewer control(hide
it by setting ShowParameterPrompt=false), and provide our own UI(like label
and textbox ) to accept parameters from user, also add our own View Report
Button, and in the button's click event, we need to use custom code to add
parameters into ReportViewr.serverReport's parameters collection and render
the report.

Hope this helps some. If you have any other ideas, please feel free to let
me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

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



This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT]
2006-09-12 09:52:32 UTC
Permalink
Hello Chris,

How are you doing on this issue, have you got any further idea or does my
last reply helps you a little? If there is any other information you
wonder, please feel free to let me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
Chris G.
2006-09-12 16:17:02 UTC
Permalink
Hi Steven,

Thank you for your reply and suggestions. It is not what I wanted to hear
;-) but I understand your proposals.

It would be nice if Microsoft could provide the ability to do such simple
customization through properties, etc. in the future.

It seems that the out of the box SRSS offering gets you going very quickly,
but very soon you also run into limitations and have to write custom code. It
is of course great that such custom code solutions are possible (it is very
flexible), but it also minimizes the productivity gains to be obtained with
SRSS. Just my 2 cents. ;-)

-- Chris
--
Chris, SSSI
Post by Steven Cheng[MSFT]
Hello Chris,
How are you doing on this issue, have you got any further idea or does my
last reply helps you a little? If there is any other information you
wonder, please feel free to let me know.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT]
2006-09-13 08:31:47 UTC
Permalink
Thanks for your followup Chris,

Yes, I can understand your concern here since what you want to customize is
just a simple Text property of the Button and it will be much more
convenient if the ReportViewer control has provide such a property for
modify it directly.

Fortunately the ReportViewer control still provide some programmtic
approach here as workaround. Also, since this is the first version of the
component, the dev team may haven't considered all the possible scenarios.
So please trust me, our dev guys will surely improve it for sequential
release(also the reporting services) according to more and more community
user experience and feedback. Thus, any of your feedback and comments are
really important to us.

Please feel free to post your comments and request so that our product team
can hear more on such feature request:

http://connect.microsoft.com/feedback/default.aspx?SiteID=210

Again thanks for your posting and understanding!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.
itaysh
2013-08-21 16:39:14 UTC
Permalink
Chris G. wrote on 09/07/2006 14:39 ET
Post by Chris G.
SSRS 200
In the web form Report Viewer Control, is there a simple way to change th
text that appears on the "View Report" button
I would like to either shorten the text or have it appear on two lines t
minimize the page width taken up by this button
Chris, SSS
hi
can you help on where to write this code in the report it sel
thanks

Continue reading on narkive:
Loading...