Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

ReportViewer Display Mode question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Voivod - 13 Feb 2007 14:23 GMT
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);
                                }
                            }
                        }
                    }
                }
            }
        }
    }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.