Hi,
just a simple question... I've a report (rdlc) inside a reportviewer,
and i'd like to catch a sort of "DisplayModeChanged" event, but the
ReportViewer doesn't have this kind of event.
So I was trying to figure out an alternative way...
Basically I need to set a parameter to a X value when the report
display mode is set to "Print preview" (and to an Y value when the
report is displayed in normal mode).
Any ideas?
Thank you very much
Voivod - 13 Feb 2007 14:58 GMT
> Hi,
> just a simple question... I've a report (rdlc) inside a reportviewer,
[quoted text clipped - 8 lines]
> Any ideas?
> Thank you very much
After a little of work I found a way to to this... Basically i go
through the Controls collection of the ReportViewer and find the one
named "printPreview", and then i handle the "click" event:
foreach (Control ct in reportViewer.Controls)
{
foreach (Control ct1 in ct.Controls)
{
foreach (Control ct2 in ct1.Controls)
{
if (ct2.Name == "reportToolBar")
{
foreach (Control ct3 in ct2.Controls)
{
if (ct3.Name == "toolStrip1")
{
ToolStrip ts = (ToolStrip)ct3;
foreach (ToolStripItem itm in ts.Items)
{
if (itm.Name == "printPreview")
{
itm.Click += new EventHandler(itm_Click);
}
}
}
}
}
}
}
}