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 / .NET Framework / General / August 2006

Tip: Looking for answers? Try searching our database.

printdialog

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mafandon - 29 Aug 2006 19:01 GMT
Is it possible to send a performclick to a button on a printdialog?

I know you can do an if statement similar to:

if windows.forms.dialogresult.cancel then
msgbox("User cancelled print option")
end if

But I would like to open the print dialog and automatically perform the
"Print" button to save the user one more step.

Thanks much!
UsualDosage - 30 Aug 2006 22:04 GMT
You can't send a click event to an open PrintDialog.

However, you can get around this by automating the print job in the
background, and avoiding the PrintDialog all together.

If you're interested in how to accomplish this, let me know, and I'll go
into greater detail.

Signature

"Quae narravi, nullo modo negabo."

> Is it possible to send a performclick to a button on a printdialog?
>
[quoted text clipped - 8 lines]
>
> Thanks much!
mafandon - 30 Aug 2006 22:18 GMT
Sure - I'd love to hear some details!

I should make note that it's a custom sized/pre-formatted paper that the
reportviewer prints on.

> You can't send a click event to an open PrintDialog.
>
[quoted text clipped - 16 lines]
> >
> > Thanks much!
UsualDosage - 30 Aug 2006 22:55 GMT
What is the source of the item you are printing? Crystal Report, Word Doc,
Text File...?

Give me some more specifics about what exactly you are trying to
automatically print, and I'll see what I can do to help.

Signature

"Quae narravi, nullo modo negabo."

> Sure - I'd love to hear some details!
>
[quoted text clipped - 21 lines]
> > >
> > > Thanks much!
mafandon - 30 Aug 2006 23:08 GMT
It's none of those.

I'm using the reportviewer control in VB 2005 with local report /
reportembeddedresource of a .rdlc extension.

Here's a little bit of the code for when the reportviewer completes loading:

   Private Sub ReportViewer1_RenderingComplete(ByVal sender As Object,
ByVal e As Microsoft.Reporting.WinForms.RenderingCompleteEventArgs) Handles
ReportViewer1.RenderingComplete
       Try
           
ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout)
           ReportViewer1.PrintDialog()

           If Windows.Forms.DialogResult.Cancel Then
               frmInvoices.Show()
               Me.Close()
           End If

       Catch ex As Exception

       End Try
   End Sub

Thanks!

> What is the source of the item you are printing? Crystal Report, Word Doc,
> Text File...?
[quoted text clipped - 27 lines]
> > > >
> > > > Thanks much!

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.