Solved

Report Print Dialog - click print twice?

Posted on 2006-06-26
6
1,408 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

740 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