Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Gud evening....

I just want to know whether we can generate a report from two completely different tables using crystal report in VB.NET visual studio 2010.

i have 2 different tables,'Incomes' & 'Expenses' Both of them have no connection with each other. But both the tables have a field called as 'Amount'. I want to show all the incomes on the left hand side and all the expenses on right hand side of the report. When i drag the fields from the respective tables on the report and when i run it, i get following error.

"Cannot determine the queries necessary to get the data for this report.
Failed to retrieve data from the database. "

Is there any solution to do so?

If yes then please help me..
Posted
Comments
Maciej Los 7-Jul-13 11:04am    
We need to see example data. Use "Improve question" widget to update your question.

1 solution

Quote:
i have 2 different tables,'Incomes' & 'Expenses' Both of them have no connection with each other


If there ius no relationship between the two there is no way to get them into a single report. One SQL query = one report. If you can't make a MEANINGFUL SQL query to retrieve data from both tables, you can't make a meaningful report out of the data.
 
Share this answer
 
Comments
Idle_Force 7-Jul-13 22:27pm    
How about a sub report for one of the tables? Just wondering, never had this scenario myself. Not a normal situation.
Dave Kreskowiak 7-Jul-13 23:39pm    
Sub-reports are normally a detail of a parent item. There is a parent-child relationship between tables. In his case, he case get a sub-report, but of what? He'll get a sub-report of meaningless data and how many times is he going to get the same child data?

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