private void LoadPageInformations() { try { string strDept = ""; string strBrand = ""; string strRange = ""; string strSite = ""; string strFromItem = ""; string strToItem = ""; string strAsOnDate = ""; string strShowZeroQty = "N"; string strShowInactive = "N"; for (int i = 0; i < ddlDept_webBI_StockBalance.Items.Count; i++) { if (ddlDept_webBI_StockBalance.Items[i].Selected == true) { strDept = strDept + ddlDept_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ","; } } for (int i = 0; i < ddlBrand_webBI_StockBalance.Items.Count; i++) { if (ddlBrand_webBI_StockBalance.Items[i].Selected == true) { strBrand = strBrand + ddlBrand_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ","; } } for (int i = 0; i < ddlRange_webBI_StockBalance.Items.Count; i++) { if (ddlRange_webBI_StockBalance.Items[i].Selected == true) { strRange = strRange + ddlRange_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ","; } } for (int i = 0; i < ddlSite_webBI_StockBalance.Items.Count; i++) { if (ddlSite_webBI_StockBalance.Items[i].Selected == true) { strSite = strSite + ddlSite_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ","; } } for (int i = 0; i < ddlFItem_webBI_StockBalance.Items.Count; i++) { if (ddlFItem_webBI_StockBalance.Items[i].Selected == true) { strFromItem = strFromItem + ddlFItem_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ","; } } //strFromItem = ddlFItem_webBI_StockBalance.Items[ddlFItem_webBI_StockBalance.SelectedIndex].Value; //strToItem = ddlTItem_webBI_StockBalance.Items[ddlTItem_webBI_StockBalance.SelectedIndex].Value; strAsOnDate = dtAsOnDate_webBI_StockBalance.Value.ToString(); if (chkShowZeroQtyItems_webBI_StockBalance.Checked) { strShowZeroQty = "Y"; } if (chkShowInActive_webBI_StockBalance.Checked) { strShowInactive = "Y"; } string postData = "{\"toDate\":\"" + strAsOnDate.Trim() + "\"," + "\"Site\":\"" + strSite.Trim() + "\"," + "\"Dept\":\"" + strDept.Trim() + "\"," + "\"Brand\":\"" + strBrand.Trim() + "\"," + "\"fromItem\":\"" + strFromItem.Trim() + "\"," + "\"toItem\":\"" + strToItem.Trim() + "\"," + "\"Range\":\"" + strRange.Trim() + "\"," + "\"showInActive\":\"" + strShowInactive.Trim() + "\"," + "\"showZeroQty\":\"" + strShowZeroQty.Trim() + "\"}"; oDT_General = oCommonEngine.GetDataTableFromAPI(Login.strAPIURL + "/api/webInventory_StockBalance", postData); ReportDataSource rds = new ReportDataSource("ds_webBI_StockBalance", oDT_General); this.rv_webBI_StockBalance.LocalReport.DataSources.Clear(); this.rv_webBI_StockBalance.LocalReport.DataSources.Add(rds); string postData1Title = "{\"fromDate\":\"" + strAsOnDate.Trim() + "\"," + "\"toDate\":\"" + strSite.Trim() + "\"," + "\"ReportTitle\":\"" + "Stock Balance" + "\"," + "\"site\":\"" + strSite.Trim() + "\"}"; //oDT_GeneralTitle = oCommonEngine.GetDataTableFromAPI(Login.strAPIURL + "/api/webBI_ReportTittle", postData1Title); oDT_GeneralTitle = oCommonEngine.ExecuteDataTable("select '' as fromDate,'' as toDate ,'Goods Receive Note Print' as reportTitle,'' as site ,'' as userCode,'' as siteText, Comp_Title1 as companyHeader1,Comp_Title2 as companyHeader2,Comp_Title3 as companyHeader3,Comp_Title4 as companyHeader4,Footer_1 as companyFooter1,Footer_2 as companyFooter2,Footer_3 as companyFooter3,Footer_4 as companyFooter4 from Title where Product_License='" + ddlSite_webBI_StockBalance.Value + "'"); ReportDataSource titledatasource = new ReportDataSource("ds_webBI_ReportTittle", oDT_GeneralTitle); this.rv_webBI_StockBalance.LocalReport.DataSources.Add(titledatasource); this.rv_webBI_StockBalance.LocalReport.ReportPath = "rpt_webBI_StockBalance.rdlc"; this.rv_webBI_StockBalance.LocalReport.Refresh(); this.rv_webBI_StockBalance.SizeToReportContent = true; this.rv_webBI_StockBalance.Width = Unit.Percentage(100); this.rv_webBI_StockBalance.Height = Unit.Percentage(100); this.rv_webBI_StockBalance.AsyncRendering = false; this.rv_webBI_StockBalance.ZoomMode = ZoomMode.FullPage; oCommonEngine.SetAlert(this.Page, "Report Loaded Sucessfully...!", Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short); } catch (Exception) { throw; } }
private void LoadPageInformations() { try { string strDiv = ""; string stritemCode = ""; string strRange = ""; string strBrand = ""; string strDate = ""; strDiv = ddlDiv_StockCount.Items[ddlDiv_StockCount.SelectedIndex].Value.ToString().Trim(); stritemCode = ddlItem_StockCount.Items[ddlItem_StockCount.SelectedIndex].Value.ToString().Trim(); strBrand = ddlBrand_StockCount.Items[ddlBrand_StockCount.SelectedIndex].Value.ToString().Trim(); strRange = ddlRange_StockCount.Items[ddlRange_StockCount.SelectedIndex].Value.ToString().Trim(); strDate = dtDate_StockCount.Value.ToString(); if (stritemCode == "") { stritemCode = "%"; } if (strRange == "") { strRange = "%"; } if (strBrand == "") { strBrand = "%"; } string postData = "{\"div\":\"" + strDiv.Trim() + "\"," + "\"itemCode\":\"" + stritemCode.Trim() + "\"," + "\"itemBrand\":\"" + strBrand.Trim() + "\"," + "\"itemRange\":\"" + strRange.Trim() + "\"," + "\"date\":\"" + strDate.Trim() + "\"}"; oDT_General = oCommonEngine.GetDataTableFromAPI(System.Configuration.ConfigurationManager.AppSettings["SequoiaUri"] + "api/stockCount", postData); if (oDT_General.Rows.Count > 0 && tblStockCount.Rows.Count == 1) { for (int i = 0; i < oDT_General.Rows.Count; i++) { HtmlTableRow _Row = new HtmlTableRow(); HtmlTableCell Col_1 = new HtmlTableCell(); Col_1.InnerText = oDT_General.Rows[i]["ItemCode"].ToString(); Col_1.Attributes.Add("style", "width: 5 %; text-align:center"); _Row.Controls.Add(Col_1); HtmlTableCell Col_2 = new HtmlTableCell(); Col_2.Attributes.Add("style", "width: 10 %; text-align:center"); Col_2.InnerText = oDT_General.Rows[i]["ItemName"].ToString(); _Row.Controls.Add(Col_2); HtmlTableCell Col_3 = new HtmlTableCell(); Col_3.Attributes.Add("style", "width: 10 %; text-align:center"); Col_3.InnerText = oDT_General.Rows[i]["ItemBrand"].ToString(); _Row.Controls.Add(Col_3); HtmlTableCell Col_4 = new HtmlTableCell(); Col_4.Attributes.Add("style", "width: 10 %; text-align:center"); Col_4.InnerText = oDT_General.Rows[i]["ItemRange"].ToString(); _Row.Controls.Add(Col_4); HtmlTableCell Col_5 = new HtmlTableCell(); Col_5.Attributes.Add("style", "width: 10 %; text-align:center"); Col_5.InnerText = oDT_General.Rows[i]["ItemUOM"].ToString(); _Row.Controls.Add(Col_5); HtmlTableCell Col_6 = new HtmlTableCell(); Col_6.Attributes.Add("style", "width: 5 %; text-align:center"); Col_6.InnerText = oDT_General.Rows[i]["AWHQ"].ToString(); _Row.Controls.Add(Col_6); HtmlTableCell Col_7 = new HtmlTableCell(); Col_7.Attributes.Add("style", "width: 5 %; text-align:center"); Col_7.InnerText = oDT_General.Rows[i]["AW01"].ToString(); _Row.Controls.Add(Col_7); HtmlTableCell Col_8 = new HtmlTableCell(); Col_8.Attributes.Add("style", "width: 5 %; text-align:center"); Col_8.InnerText = oDT_General.Rows[i]["AW02"].ToString(); _Row.Controls.Add(Col_8); HtmlTableCell Col_9 = new HtmlTableCell(); Col_9.Attributes.Add("style", "width: 5 %; text-align:center"); Col_9.InnerText = oDT_General.Rows[i]["AW03"].ToString(); _Row.Controls.Add(Col_9); HtmlTableCell Col_10 = new HtmlTableCell(); Col_10.Attributes.Add("style", "width: 5 %; text-align:center"); Col_10.InnerText = oDT_General.Rows[i]["AW04"].ToString(); _Row.Controls.Add(Col_10); HtmlTableCell Col_11 = new HtmlTableCell(); Col_11.Attributes.Add("style", "width: 5 %; text-align:center"); Col_11.InnerText = oDT_General.Rows[i]["AW05"].ToString(); _Row.Controls.Add(Col_11); HtmlTableCell Col_12 = new HtmlTableCell(); Col_12.Attributes.Add("style", "width: 5 %; text-align:center"); Col_12.InnerText = oDT_General.Rows[i]["AW06"].ToString(); _Row.Controls.Add(Col_12); HtmlTableCell Col_13 = new HtmlTableCell(); Col_13.Attributes.Add("style", "width: 5 %; text-align:center"); Col_13.InnerText = oDT_General.Rows[i]["AW07"].ToString(); _Row.Controls.Add(Col_13); HtmlTableCell Col_14 = new HtmlTableCell(); Col_14.Attributes.Add("style", "width: 5 %; text-align:center"); Col_14.InnerText = oDT_General.Rows[i]["AW08"].ToString(); _Row.Controls.Add(Col_14); HtmlTableCell Col_15 = new HtmlTableCell(); Col_15.Attributes.Add("style", "width: 5 %; text-align:center"); Col_15.InnerText = oDT_General.Rows[i]["AW09"].ToString(); _Row.Controls.Add(Col_15); HtmlTableCell Col_16 = new HtmlTableCell(); Col_16.Attributes.Add("style", "width: 5 %; text-align:center"); Col_16.InnerText = oDT_General.Rows[i]["AW10"].ToString(); _Row.Controls.Add(Col_16); HtmlTableCell Col_17 = new HtmlTableCell(); Col_17.Attributes.Add("style", "width: 5 %; text-align:center"); Col_17.InnerText = oDT_General.Rows[i]["AW11"].ToString(); _Row.Controls.Add(Col_17); HtmlTableCell Col_18 = new HtmlTableCell(); Col_18.Attributes.Add("style", "width: 5 %; text-align:center"); Col_18.InnerText = oDT_General.Rows[i]["balance"].ToString(); _Row.Controls.Add(Col_18); tblStockCount.Rows.Add(_Row); } } } catch (Exception) { throw; } }