?
Solved

Report Print Dialog - click print twice?

Posted on 2006-06-26
6
Medium Priority
?
1,449 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 750 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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