Link to home
Start Free TrialLog in
Avatar of Ennio
Ennio

asked on

Dynamic Send DataSET to Report

I have a blank crystal report, and I would like to know how can I send a dataset to the report, and generate the report dynamic.

I have this on my code, but when I open the report I get an error saying the report has no table.

The dataset is getting the data from the DB, and I only have 3 column Name, Date, Time

Private Sub ReportView_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim rpt As New CrystalReport1() 'The report you created
        CompanyClassObject = New CompanyClass()
        DataSetCompanyDetails = CompanyClassObject.GetTimeDetailsForCompany(CopmanyID)
        Try
            rpt.SetDataSource(DataSetCompanyDetails)
            CrystalReportViewer1.ReportSource = rpt
 
        Catch Excep As Exception
            MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
 
    End Sub

Open in new window

Avatar of Ennio
Ennio

ASKER

If I genereate the report using the wizard, it works, but the problem is that I want to use the dataset that I create in the code, and not the one used to generate the report, because I need to add some paramenters to generate the dataset, and when I use the one from the wizard it keeps me asking for the values.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial