MessageBox & Crystal Printing

M

MadCrazyNewbie

Hey Group,

Hope you all well? Wonder if somebody could possibly help me?

At the Mo I use the following code to Print a Crystal Report:

rptForm.Text = "Excellence.Net - Fax`s" 'Set the form's titlebar
rptForm.CRVReportPrint.ReportSource = New Faxs() 'Tell the viewer which
report to display
rptForm.CRVReportPrint.RefreshReport() 'Refresh the viewer
rptForm.ShowDialog() 'Show the report

What I would Like is to have a it pop up a message box and ask me if I would
Like to Print a FaxUser report or a FaxAdmin Report?

How would I achive this?

Many Thanks
Regards
MCN
 
C

Chris Dunaway

Hey Group,

Hope you all well? Wonder if somebody could possibly help me?

At the Mo I use the following code to Print a Crystal Report:

rptForm.Text = "Excellence.Net - Fax`s" 'Set the form's titlebar
rptForm.CRVReportPrint.ReportSource = New Faxs() 'Tell the viewer which
report to display
rptForm.CRVReportPrint.RefreshReport() 'Refresh the viewer
rptForm.ShowDialog() 'Show the report

What I would Like is to have a it pop up a message box and ask me if I would
Like to Print a FaxUser report or a FaxAdmin Report?

How would I achive this?

Many Thanks
Regards
MCN

There are many ways to do this. Here's one:

Create a form with two radio buttons for the two different reports. Add a
property to the form class (for example ReportToPrint) that will indicate
which option the user chose. Also have an OK and CANCEL button on the
form. When the user clicks the OK button, set the ReportToPrint property
of the form class to indicate which radio button was selected.

Use code similar to this to call the form:

'(This code is untested)

Dim sReportToPrint As String
Dim frm As New ReportChoiceForm

If frm.DialogResult = DialogResult.OK Then
sReportToPrint = frm.ReportToPrint

'Code to print report here
End If

Again, this is just one way. There are probably many other (and better)
ways to do this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top