Click here to Skip to main content
15,904,652 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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#

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!
Posted
Comments
Maciej Los 2-Apr-14 14:22pm    
"report data not showing" - is not informative at all!
Please, be more specific and provide more details. Use "Improve question" widget.
Hae you checked connection string?
Brinda Arumugam 3-Apr-14 0:44am    
checked connection string .its rite. and checked also query its executed and returned data...

this s my coding
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");

Report_PurchaseAll_View report1 = new Report_PurchaseAll_View();
ConnectionInfo crConnectionInfo;
Tables crTables;
TableLogOnInfo crTableLogOnInfo;
crTables = report1.Database.Tables;
crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = ValidationT_SQLC.Path;
crConnectionInfo.DatabaseName = ValidationT_SQLC.Name;

foreach (CrystalDecisions.CrystalReports.Engine.Table aTable in crTables)
{
crTableLogOnInfo = aTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
aTable.ApplyLogOnInfo(crTableLogOnInfo);
}
report1.SetDataSource(dd.Tables[0]);
crystalReportViewer1.ReportSource = report1;
crystalReportViewer1.Refresh();

public DataSet getdatasetfromquery(string query)
{
DataSet ds = new DataSet();
cmd = con.CreateCommand();
cmd.CommandText = query.ToString();
cmd.CommandType = CommandType.Text;
da = new SqlCeDataAdapter(cmd);
da.Fill(ds);
return ds;
}

Maciej Los 2-Apr-14 14:24pm    
Urgent? Sorry, but if something is urgent for you, it must be non-urgent for us.
Brinda Arumugam 3-Apr-14 3:56am    
tnks for fast reply... i got solutions
thatraja 3-Apr-14 5:19am    
Share your solutions(you could post even a Tip/Trick), it could help others in future.

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