Click here to Skip to main content
13,139,114 members (63,698 online)
Rate this:
Please Sign up or sign in to vote.
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 7-Jul-13 3:54am
Maciej Los 7-Jul-13 11:04am
We need to see example data. Use "Improve question" widget to update your question.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 7 Jul 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100