this is codebehind sql quer
string sql = "SELECT nav.scheme_name,portfolio_master.amt_invested from portfolio_master inner JOIN nav ON nav.scheme_code=portfolio_master.scheme_id and portfolio_master.user_id='" + Session["user_id"] + "' order by nav.scheme_name";
ReportDocument portfolio1 = new ReportDocument();
string reportpath = Server.MapPath("my_port.rpt");
portfolio1.Load(reportpath);
portfolio1.SetDataSource(ds.Tables[0]);
portfolio1.Refresh();
CrystalReportViewer1.ReportSource = portfolio1;
CrystalReportViewer1.Visible = true;
I have tested this query in SQL server and it fetches 9 records.
In the report, I have added 2 tables and the sql expression is as below:
SELECT "NAV"."Scheme_name", "portfolio_master"."amt_invested"
FROM "portfolio"."dbo"."portfolio_master" "portfolio_master" INNER JOIN "portfolio"."dbo"."NAV" "NAV" ON "portfolio_master"."scheme_id"="NAV"."Scheme_Code"
this result in each record displaying 14 times .
1.why this repetition
2. How do i give the user id control ( which is missing in report SQl query)
If needed I can attach the screen shots.