Solved

Report Print Dialog - click print twice?

Posted on 2006-06-26
6
1,357 Views
Last Modified: 2009-12-16
Using VS2005 windows forms.  I've got a local report with the standard report viewer (actually, a bunch of em).  When you click the print button, the print dialog comes up.  This dialog acts as if it doesn't have focus (but looks like it does).  If you click the print button on the print dialog, nothing happens.  Click it again and it prints.  Actually, you can click anywhere on the print dialog first and it "gains focus" but doesn't look any different.  Then click print and it prints.  Has anyone else noticed this?  Is there a work around till MS gets it fixed?  Any ideas?
0
Comment
Question by:Jahelka
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:sr101880
ID: 16992150
This isn’t anything official it’s more something to check out, but I was having the same problem this fixed it for me.    I setup my report landscape style and had a page size of 14w X 8.5h.    To fix my printing problem, I needed to change the interactive size and the pagesize in the report properties to match.  To do this click on the gray space outside of the body of your report.  This will display the report properties in the properties window.  Then change the sizes to match your output paper size.  The behavior you described stopped after I set the properties to the proper size.  Let me know if you have any questions.
0
 
LVL 1

Author Comment

by:Jahelka
ID: 16992603
DANG!  You got me all excited when I opened up one of my reports and found that I had my interactive size and page size set to two different things!  I do have some landscape reports, and they were different.  I set them to the same and tried it out.  Didn't solve the problem.  I checked out some of my portrait reports, and they do the same thing...  The print dialog LOOKS like it has focus...  Mouse over the buttons or the printers and nothing happens.  If you click anywhere on the print dialog, then the mouse overs work (over a printer, shows current status, over the print button, it gets the yellow glow (in XP)).

Maybe there is something else that is causing the problem and you just think it was pagesize/interactive size?  Any other ideas?
0
 
LVL 4

Expert Comment

by:sr101880
ID: 16992700
I am running my app on a win2k box.  Do you have a win2k box you could try your app on to rule out the operating system?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 1

Author Comment

by:Jahelka
ID: 16992762
Lemme give that a shot...  I have tried it on three different computers, but they all have XP.  I'll give it a shot and report back...
0
 
LVL 4

Accepted Solution

by:
sr101880 earned 250 total points
ID: 16992836
I found a big discussion on this at:   http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=177732&SiteID=1

It looks like the code below should fix the problems you are having if you add it to your report viewer form.  Let me know if you have any questions.


Private Sub ReportViewer1_RenderingComplete(ByVal sender As Object, ByVal e As Microsoft.Reporting.WinForms.RenderingCompleteEventArgs) Handles ReportViewer1.RenderingComplete

Me.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)

Me.ReportViewer1.ZoomMode = ZoomMode.PageWidth

End Sub

0
 
LVL 1

Author Comment

by:Jahelka
ID: 16995289
OK, here is what I did to make the "workaround" work.  MS admits this is a bug, so I'm sure they will have it fixed eventually.  In the mean time...

This code makes sure the report prints the first time everytime (I was also having issues with this):

Use this line:
        Me.rv.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout)
Right before
        Me.rv.RefreshReport()
on your report form.

This code fixed the print dialog not getting focus issue (add a timer to the form):

    Private Sub rv_Print(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles rvClassResults.Print
        e.Cancel = True
        workaroundTimer.Start()
    End Sub

    Private Sub workaroundTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles workaroundTimer.Tick
        workaroundTimer.Stop()
        Me.rv.PrintDialog()
    End Sub

Thanks for getting me pointed in the right direction!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question