Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generic report viewer
Message
De
06/09/2002 09:01:25
 
 
À
05/09/2002 18:06:08
Ron Hodge
Sebrex Systems, Inc.
Dacula, Georgie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00697291
Message ID:
00697452
Vues:
13
Below is the code I use. The only problem is, any time you add a report you have to add to the case statement. But basically, I just pass the dataset and name of the table in the dataset. It could definitely be improved upon, but it works for me.
Public Class frmReport
    Inherits System.Windows.Forms.Form

    Public oRpt As Object
    Public dsReport As DataSet
    Public strTableName As String


    Private Sub frmReport_Load(ByVal sender As System.Object, ByVal e As 
                               System.EventArgs) Handles MyBase.Load
        Try
            Select Case UCase(pcPassStr)

                Case "CCCREPORT"
                    oRpt = New rptCCCReport()

                Case "CONCERNLOG"
                    oRpt = New rptConcernLog()

                Case "COURIERPICKUP"
                    oRpt = New rptCourierPickup()

                Case "DEMOGRAPHICERROR"
                    oRpt = New rptDemographicError()

                Case "MONTHLYPHONELOG"
                    oRpt = New rptMonthlyPhoneLog()

                Case "PHONELOG"
                    oRpt = New rptPhoneLog()

                Case "PHONELOGPIECHART"
                    oRpt = New rptPhoneLogPieChart()

                Case "SPECIMENPROBLEM"
                    oRpt = New rptSpecimenProblemAndErrorLog()

                Case "TESTCANCELLATION"
                    oRpt = New rptTestCancellation()

                Case "TRANSFERBARGRAPH"
                    oRpt = New rptTransferBarGraph()

                Case "TRANSFERPIECHART"
                    oRpt = New rptTransferPieChart()

                Case "VERBALVERIFICATION"
                    oRpt = New rptVerbalVerification()
            End Select

            strTableName = pcPassStr
            dsReport = pdsReport
            pcPassStr = ""

            oRpt.SetDataSource(dsReport)
            Me.CrystalReportViewer1.ReportSource = oRpt

            Me.CrystalReportViewer1.Width = Me.Size.Width - 20
            Me.CrystalReportViewer1.Height = Me.Size.Height - 60
            Me.cmdCreateExcel.Left = Me.Size.Width - 326
            Me.cmdCreateExcel.Top = Me.Size.Height - 53
            Me.cmdExit.Left = Me.Size.Width - 94
            Me.cmdExit.Top = Me.Size.Height - 53
        Catch
            GetError("FileError.log", Err.Description, Err.Source, Err.Erl)
        End Try
    End Sub

    Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As 
                              System.EventArgs) Handles cmdExit.Click
        Me.Close()
    End Sub

    Private Sub cmdCreateExcel_Click(ByVal sender As System.Object, ByVal e 
                          As System.EventArgs) Handles cmdCreateExcel.Click
        'CreateExcelWorkSheet(dsReport, strTableName)
        Me.CrystalReportViewer1.ExportReport()
    End Sub
End Class
Randy Belcher
AFG Industries, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform