Click here to Skip to main content
15,887,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using dataset as a container of my datagridview into crystal reports
here's my code:
VB
Dim rptDoc1 As CrystalDecisions.CrystalReports.Engine.ReportDocument


        rptDoc1 = New CRPTEAM
        rptDoc1.SetDataSource(dtagrdTeam.DataSource And dtagrdTSched.DataSource)

        frmPrntTeam.CRPT.ReportSource = rptDoc1
        frmPrntTeam.ShowDialog()


Here's my Error: System.InvalidCastException: 'Operator 'And' is not defined for type 'DataTable' and type 'DataTable'.'

What I have tried:

I've tried it so many times please help thanks
Posted
Updated 2-Oct-19 21:20pm
v2

1 solution

Well... the error message is pretty obvious. You can't use "And" operator to "connect" two datasources into one...

We can't help you due to the small portion infromation about the relationship between two datasources.

Please, refer this article: Generating a Report from Multiple Data Sources in Crystal Reports[^], which may help you to resolve your issue.
 
Share this answer
 
Comments
Member 14598452 3-Oct-19 3:57am    
uhhmm, what information should I give so that I'll be able to help you help me in this situation? hehe thanks
Member 14598452 21-Oct-19 4:23am    
what i really need to know is the right code for using 2 datagrids as a datasource for my crystal report, please do help me, is it really possible?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900