Greetings from Appdev (i'm new to Crystall Report)
I was Creating a web application which will contains a crystal report.
My Requirement is:
The report should be displayed Based on the value (textbox in web form) which is given in textbox.
Eg: if Textbox value = 2 means only the item which has id 2 should only get display.
My crystal report has 3 sub Reports like cheque,Party(which also contains values from other table called voucher) and finally bank. these 4 tables are linked by 1 common field called id.
- need to know how to pass parameter to crystall report.
- How to display the result only once (my code display same result twice)
this is how i bind the crystal report using parameters from .cs file in c#
public void LoadTransReceipt()
{
string Date = "";
string Sql = "SELECT tREC_NUPKId as ID from TB_TransReceipt where tREC_VCVoucherNo='" + TXTVou.Text.Trim() + "' and tREC_NUIsActive=1";
SqlDataReader rdr = mobjGenlib.objDBLib.ExecuteQueryReader(Sql.ToString());
while (rdr.Read())
{
Session["ID"] = rdr.GetValue(0).ToString();
}
rdr.Close();
if (!string.IsNullOrEmpty(Session["ID"] as string))
{
if (Session["Date"] != null)
{
Date = mobjGenlib.ConvertString(Session["Date"]);
}
reportPath = GetReportPath("ReceiptReport.rpt");
CRReport = new ReportDocument();
CRReport.Load(reportPath);
CrystalReportViewer1.ReportSource = CRReport;
AddParameterToReport("IDP", Session["ID"].ToString());
AddParameterToReport("ActiveP", 1);
AddParameterToReport("IDB", Session["ID"].ToString());
AddParameterToReport("ActiveB", 1);
AddParameterToReport("IDC", Session["ID"].ToString());
AddParameterToReport("ActiveC", 1);
// ConnectionInfo connectionInfo = ConnInfo();
ConnectionInfo objConnInfo = new ConnectionInfo();
objConnInfo.DatabaseName = "Demo";
objConnInfo.UserID = "aa";
objConnInfo.Password = "aaaa";
objConnInfo.ServerName = "HOME-PC\\SQLEXPRESS";
SetDBLogonForReport(objConnInfo, CRReport);
SetDataSetForMultipleSubReport(objConnInfo, CRReport);
}
}
but when i execute the code it displaying all data's available in table with double time like shown below
can any one help me to solve this issue
Thanks in advance
getting error as
" **
Specified argument was out of the range of valid values
**"