Crystal Reports sort of

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

Hey Again Group,

Sorry to be a pain but ..........

I have a Windows Forms Project with serveral reports in now.

At the moment I have 7 Forms all Called Print1, Print2, Print3 and so on.
Each form has a Crystal Report Viewer on it assigned to the perticular
report eg, Print1.rpt, Print2.rpt, and so on.

Is there a better way to do this by code, im looking at about 50 or so
reports and i think its going to get very messy if i have 50 forms all with
a crystal report viewer on.

Im thinking on the lines I have one for then in the Display Report Button
code I tell it to load Formx, and use the crystal report viewer with
reportx.rpt? Is this correct?

Any Ideas or Code?

Many Thanks
MCN
 
Hi Mad

I use a single form to display reports. I use a simple
select case for each report on form load event.

Kind Regards
Jorge
 
Thanks for your reply, So far for my button I have

Private Sub btnFaxsPrint_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnFaxsPrint.Click
Dim LoadReportPrint As frmReportPrint
LoadReportPrint = New frmReportPrint()
LoadReportPrint.ShowDialog()

Me.CrystalReportViewer1.ReportSource = Faxs.rpt
End Sub

Only thing is it errors on the Me.CrystalReportViewer1 Line as
CrystalReportViewer1 is in a different form:(

Could somebody Kindly help?

Many Thanks
MCN
 
Assuming that the viewew is on LoadReportPrint and it's called
CrystalReportViewer1

Dim whatever as New LoadReportPrint
Dim rpt as New Faxs.RptObjectName (ie Faxes - it will be in intellisense b/c
they're typed)
whatever.CrystalReportsViewer1.ReportSource = rpt
whatever.ShowDialog() 'Or .Show()
 
Back
Top