Joined: 27 Nov 2011
Online Status: Offline
Posts: 7
Topic: Link Multiple Tables in Crystal Report Foreign key Posted: 02 Apr 2014 at 1:49am
Hello , i'm New to Crystal report. i have 2 tables with primary and foreign key
Customer Details
EID - Primary Key
PurchaseDetails
PNo-Primary Key PDate, EID- Foreigh Key NetAmount
Report Query written in c#
SELECT DISTINCT P.PNo, P.PDate, P.PM, P.DisAmt, P.LT, P.NT, P.EID, P.PTime, C.EName FROM PurchaseDetails AS P INNER JOIN CustomerDetails AS C ON P.EID = C.EID
In Report Automattically linked based key.
but report data not showing can u plz anyone tell me solution for this . its very urgent!
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 02 Apr 2014 at 4:27am
The query looks good. But we do not know the data. Do you have another way to access the data (Toad, MS-SQL Server Management Studio, etc.) to test that the query actually returns data.
Joined: 27 Nov 2011
Online Status: Offline
Posts: 7
Posted: 02 Apr 2014 at 6:43pm
S i checked in query browser its executed and returned data
This is my report loading code
DataSet dd = null; dd = getdatasetfromquery("SELECT DISTINCT P.PNo, P.PDate, P.PM, P.DisAmt, P.NT,P.LT,P.EID,C.EName FROM PurchaseDetails AS P INNER JOIN CustomerDetails AS C ON P.EID = C.EID");
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Posted: 03 Apr 2014 at 7:45am
hmmm....
If you are setting the datasource for the report in code, you shouldn't need the tables, and if you are selecting the data tables in the report, you don't need the dataset...could that be what is happening...
what sort of data connection are you using?
If you use ADO.Net, you can stop your code after the ds is created, write out the ds to an xml file using ds.writexml(filename, includeSchema), the set your report to read the filename...you will have data and schema for designing the report.
Now in code, all you need is to get the ds, create the new report, set the datasource to ds and display the report. (this is pushing the data to the report)
If you are using another connection type, you probably don't have to worry about the datasource, the report will 'pull' the data from the database (this is the more typical setup for reporting, though I like to push the data myself).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum