public void bindReport() { if (Request.QueryString["d"] != null) { DataTable dt = new DataTable(); DataTable dt1 = new DataTable(); dt = DCDetails.DC_Get_InvoiceDetails_On_subdocID(Convert.ToDecimal(Request.QueryString["sd"].ToString()), Convert.ToInt32(Request.QueryString["d"].ToString())); dt1 = DCDetails.Rep_DC_Get_Datails_OnSubdocno(Convert.ToInt32(Request.QueryString["d"].ToString())); // decimal Amount = Convert.ToDecimal(dt.Rows[0]["TotalAmount"]); // DataSet ds1 = new DataSet(); // ds1 = ActualInvoiceDetails.GetConvertion_fromnumber(Amount); // dv. //objds.Tables.Add(dt); // ds.Tables.Add(dt1.Tables[0]); // DataView dv1 = new DataView(); // ds.Tables.Add(DCDetails.DC_Get_InvoiceDetails_On_subdocID(Convert.ToDecimal(Request.QueryString["sd"].ToString())).Tables[0]); // ds.Tables.Add(DCDetails.Rep_DC_Get_Datails_OnSubdocno(Convert.ToInt32(Request.QueryString["d"].ToString())).Tables[0]); // DataView dv1 = new DataView(ds1.Tables[0]); ReportDocument rd = new ReportDocument(); rd.Load(Server.MapPath("../Report/PrintInvoice.rpt")); rd.Database.Tables[0].SetDataSource(dt); rd.Database.Tables[1].SetDataSource(dt1); // rd.Database.Tables[2].SetDataSource(ds1.Tables[0]); // rd.SetDataSource(dt); // rd.SetDataSource(dt1); // rd.SetParameterValue(1, Convert.ToDecimal(Request.QueryString["sd"].ToString())); // rd.SetParameterValue(0,Convert.ToInt32(Request.QueryString["d"].ToString())); CrptInvoice.ReportSource = rd; CrptInvoice.DataBind(); } }
protected void btnPrint_Click1(object sender, EventArgs e) { Session["DATAREP"] = null; string AllDock = ""; bool checkAll = false; if (Rptrpending.Items[0].Selected == true) { checkAll = true; } for (int i = 1; i < Rptrpending.Items.Count; i++) { if (checkAll == true) { AllDock = AllDock + Rptrpending.Items[i].Value.ToString() + ","; } else if (Rptrpending.Items[i].Selected == true) { AllDock = AllDock + Rptrpending.Items[i].Value.ToString() + ","; } } AllDock = AllDock + "0"; DataTable dt = new DataTable(); dt = DCDetails.DC_Get_InvoiceDetails_On_subdocID(0, AllDock, ""); Session["DATAREP"] = dt; fillReport(); }
protected void btnPrint_Click(object sender, EventArgs e) { string strinvno = ""; foreach (GridViewRow row in grdinvDetails.Rows) { strinvno = strinvno + ((Label)row.FindControl("lblInvoiceNo")).Text.Trim() + ","; } DataTable dt = new DataTable(); dt = DCDetails.DC_Get_InvoiceDetails_On_subdocID(Convert.ToDecimal(strFY), strinvno, Convert.ToString(Session["UserName"])); Session["DATAREPInv"] = dt; fillReport(); }
public void bindReport() { if (Request.QueryString["d"] != null) { DataTable dt = new DataTable(); DataTable dt1 = new DataTable(); dt = DCDetails.DC_Get_InvoiceDetails_On_subdocID(Convert.ToDecimal(Request.QueryString["sd"].ToString()), Convert.ToInt32(Request.QueryString["d"].ToString())); dt1 = DCDetails.Rep_DC_Get_Datails_OnSubdocno(Convert.ToInt32(Request.QueryString["d"].ToString())); ReportDocument rd = new ReportDocument(); if (Request.QueryString["type"] == "without") { rd.Load(Server.MapPath("../Report/PrintInvoiceWithoutDiscount.rpt")); } else if (Request.QueryString["type"] == "GST") { rd.Load(Server.MapPath("../Report/GSTInvoice.rpt")); } else { rd.Load(Server.MapPath("../Report/PrintInvoice.rpt")); } // rd.Load(Server.MapPath("../Report/PrintInvoice.rpt")); rd.Database.Tables[0].SetDataSource(dt); rd.Database.Tables[1].SetDataSource(dt1); // rd.Database.Tables[2].SetDataSource(ds1.Tables[0]); // rd.SetDataSource(dt); // rd.SetDataSource(dt1); // rd.SetParameterValue(1, Convert.ToDecimal(Request.QueryString["sd"].ToString())); // rd.SetParameterValue(0,Convert.ToInt32(Request.QueryString["d"].ToString())); CrptInvoice.ReportSource = rd; CrptInvoice.DataBind(); } }