Example #1
0
        private void LoadPageInformations(string _PKey1)
        {
            try
            {
                HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format(System.Configuration.ConfigurationManager.AppSettings["uri"] + "api/PoPrintLists"));
                WebReq.Method = "GET";
                HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
                Console.WriteLine(WebResp.StatusCode);
                Console.WriteLine(WebResp.Server);
                string jsonString;
                using (Stream stream = WebResp.GetResponseStream())
                {
                    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
                    jsonString = reader.ReadToEnd();
                }
                oDT_Header = (DataTable)JsonConvert.DeserializeObject(jsonString, (typeof(DataTable)));
                if (_PKey1 != "")
                {
                    DataView oDV = new DataView(oDT_Header);
                    oDV.RowFilter = "poNo='" + _PKey1 + "'";
                    oDT_Header    = oDV.ToTable();
                }

                //oDT_Header = (DataTable)JsonConvert.DeserializeObject(jsonString, (typeof(DataTable)));
                ReportDataSource rds = new ReportDataSource("ds_PORequest", oDT_Header);
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Clear();
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Add(rds);

                string strFromDate    = "";
                string strToDate      = "";
                string postData1Title = "{\"fromDate\":\"" + strFromDate.Trim() + "\"," +
                                        "\"toDate\":\"" + strToDate.Trim() + "\"," +
                                        //"\"ReportTitle\":\"" + "Sales Collection" + "\"," +
                                        "\"ReportTitle\":\"" + " Invoice Print " + "\"," +
                                        "\"site\":\"" + System.Configuration.ConfigurationManager.AppSettings["SiteCode"].ToString() + "\"}";
                //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='" + oDT_Header.Rows[0]["itemSiteCode"] + "'");
                ReportDataSource titledatasource = new ReportDataSource("ds_webBI_ReportTittle", oDT_GeneralTitle);
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Add(titledatasource);

                oDT_Logo = oCommonEngine.ExecuteDataTable("select Trans_Logo as Logo from Title  ");
                ReportDataSource Logodatasource = new ReportDataSource("ds_Logo", oDT_Logo);
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Add(Logodatasource);

                this.rv_webBI_InvoicePrint.LocalReport.ReportPath = "rpt_webBI_Invoice.rdlc";
                this.rv_webBI_InvoicePrint.LocalReport.Refresh();
                this.rv_webBI_InvoicePrint.SizeToReportContent = true;
                this.rv_webBI_InvoicePrint.Width          = Unit.Percentage(100);
                this.rv_webBI_InvoicePrint.Height         = Unit.Percentage(100);
                this.rv_webBI_InvoicePrint.AsyncRendering = false;
                this.rv_webBI_InvoicePrint.ZoomMode       = ZoomMode.FullPage;
                oCommonEngine.SetAlert(this.Page, "Report Loaded Sucessfully...!", Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
                throw;
            }
        }
        private void LoadPageInformations(string _PKey1)
        {
            try
            {
                var client = new HttpClient();
                client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                string api      = "api/Stkprintlists?filter={\"where\":{\"docNo\":\"" + _PKey1 + "\"}}";
                var    response = client.GetAsync(api).Result;
                var    a        = response.Content.ReadAsStringAsync().Result;
                oDT_Header = (DataTable)JsonConvert.DeserializeObject(a, (typeof(DataTable)));
                oDT_Header.DefaultView.Sort = "docLineno asc";
                oDT_Header = oDT_Header.DefaultView.ToTable();
                ReportDataSource rds = new ReportDataSource("ds_Stkprintlist", oDT_Header);
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Clear();
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Add(rds);

                string strFromDate    = "";
                string strToDate      = "";
                string postData1Title = "{\"fromDate\":\"" + strFromDate.Trim() + "\"," +
                                        "\"toDate\":\"" + strToDate.Trim() + "\"," +
                                        //"\"ReportTitle\":\"" + "Sales Collection" + "\"," +
                                        "\"ReportTitle\":\"" + " Goods Return Print " + "\"," +
                                        "\"site\":\"" + System.Configuration.ConfigurationManager.AppSettings["SiteCode"].ToString() + "\"}";
                //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='" + oDT_Header.Rows[0]["storeNo"] + "'");
                ReportDataSource titledatasource = new ReportDataSource("ds_webBI_ReportTittle", oDT_GeneralTitle);
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Add(titledatasource);

                oDT_Logo = oCommonEngine.ExecuteDataTable("select Trans_Logo as Logo from Title  ");
                ReportDataSource Logodatasource = new ReportDataSource("ds_Logo", oDT_Logo);
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Add(Logodatasource);

                this.rv_webBI_GRNReturnPrint.LocalReport.ReportPath = "rpt_webGRNReturn.rdlc";
                this.rv_webBI_GRNReturnPrint.LocalReport.Refresh();
                this.rv_webBI_GRNReturnPrint.SizeToReportContent = true;
                this.rv_webBI_GRNReturnPrint.Width          = Unit.Percentage(100);
                this.rv_webBI_GRNReturnPrint.Height         = Unit.Percentage(100);
                this.rv_webBI_GRNReturnPrint.AsyncRendering = false;
                this.rv_webBI_GRNReturnPrint.ZoomMode       = ZoomMode.FullPage;
                oCommonEngine.SetAlert(this.Page, "Report Loaded Sucessfully...!", Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
                throw;
            }
        }
Example #3
0
        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;
            }
        }