I see that the Report Viewer Control has a number of properties that can be
set to control things like the control's border color and width, the
background color of the toolbars, the border and color of the buttons, etc.
However I have some additional formatting requirements:
1. How do I control the font properties (face, color, etc.) for the report
parameter labels and other text in the toolbars?
2. Is there a way that I can force the report parameters to render in a
single column or otherwise control their layout? They normally render across
the page and then down which sometimes results in an unusual order for the
user to see them. I know I could create custom report parameter forms but I
am trying to avoid that.
--
Chris, SSSIHi Steven,
Thank you for your reply. I have some follow up questions:
>>Based on my test, all the text's Font settings can be configured through
>>the ReportViewer control's "Font" property.
1) I see those settings in the Properties window, but how do I set these
font settings programatically?
2) The Microsoft.Reporting.WebForms.ReportViewer class has a Font property,
but it is ReadOnly. So how do I set these settings in code at runtime? Can
the font settings only be set at design time?
>>I've attached a screenshot on the setting of this Font property on my test page.
3) I do not see a screenshot attached to your posting. Did you forget to
attach it?
>>so it won't affect our rendered report's text font.
That is fine and actually the behavior I want.
--
Chris, SSSI
"Steven Cheng[MSFT]" wrote:
> Hello Chris,
> As for the two questions you mentioned, here are my understanding and
> suggestion:
> 1. How do I control the font properties (face, color, etc.) for the report
> parameter labels and other text in the toolbars?
> ==============================================> Based on my test, all the text's Font settings can be configured through
> the ReportViewer control's "Font" property. This property will affect the
> text on every element on reportviewer toolbar, include parameter label,
> parameter input textbox, buttons ...... I've attached a screenshot on
> the setting of this Font property on my test page. BTW, so far I only find
> this very Font setting for the ReportViewer which affect the text on the
> reportViewer's non-ReportClient region, so it won't affect our rendered
> report's text font.
>
> 2. Is there a way that I can force the report parameters to render in a
> single column or otherwise control their layout? They normally render
> across
> the page and then down which sometimes results in an unusual order for the
> user to see them. I know I could create custom report parameter forms but I
> am trying to avoid that.
> ===============================================> I've performed some test and research, it seems the Report parameters panel
> is fixed above the reportViewer control and there is no much individual
> properties to customize it. So far what I can get is the following option:
> 1. Make the "ShowParameterPrompts" and "ShowRefreshButton" to "false" so
> that they won't display on the reportviewr.
> 2. We can add create our own UI (through ASP.NET controls ) to accept
> parameter values
> 3. Also, we need to add our own button and use code to programmtically set
> the parameter from our custom controls into ReportViewer.ServerReport and
> call its Refresh method to rerender it.
> Please let me know if there is anything else you wonder.
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>|||Thanks for your reply Chris,
For your further question:
Yes, we can also programmatically adjust the ReportViewer.Font property
settings. For example:
page classs
{
.............
protected void btnStyle_Click(object sender, EventArgs e)
{
ReportViewer1.Font.Bold = true;
ReportViewer1.Font.Name = "Verdana";
ReportViewer1.Font.Size = FontUnit.Point(24);
ReportViewer1.Font.Underline = true;
}
}
Hope this also helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Steven,
So then the Intellisense tooltip which says ReportViewer.Font is ReadOnly is
incorrect? Is this bug being fixed?
-- Chris
Chris, SSSI
"Steven Cheng[MSFT]" wrote:
> Thanks for your reply Chris,
> For your further question:
>
> Yes, we can also programmatically adjust the ReportViewer.Font property
> settings. For example:
> page classs
> {
> ..............
> protected void btnStyle_Click(object sender, EventArgs e)
> {
> ReportViewer1.Font.Bold = true;
> ReportViewer1.Font.Name = "Verdana";
> ReportViewer1.Font.Size = FontUnit.Point(24);
> ReportViewer1.Font.Underline = true;
> }
> }
> Hope this also helps.
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Chris,
Thanks for the reply.
As for the "ReportViewer.Font" property, it is derived from the
"WebControl" class and the VS IDE's intellisense is correct, the property
does be "ReadOnly". This is a common design for some complex properties of
Webcontrol class, such as "WebControl.ControlStyle" and
"WebControl.ControlStyle". For these complex properties, we should
modify their values through their sub-properties instead of directly modify
the property instance itself. This design is also for performance
consideration since replacing a whole complex property instance is much
more expensive than just replacing those sub properties.
Therefore, when we want to customize any webcontrol's "Font" property, we
should access its sub properties instead, like:
ReportViewer1.Font.Bold = true;
ReportViewer1.Font.Name = "Verdana";
#WebControl.Font
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontro
l.font.aspx
BTW, it is recommended that we also follow this pattern when we add custom
properties for webcontrol which is of such complex type.
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Chris,
Have you got the issue resolved? Please feel free to let me know if there
is anything else we can help.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment