private void LoadReport()
        {
            try
            {
                string ConnectionString             = _host.ConnectionString;
                Stimulsoft.Report.StiReport _report = new StiReport();
                _report.Load(Resources.mrtBarcodeDetailes);
                _report.Dictionary.Databases.Clear();
                _report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("PofficeCOD186", ConnectionString));
                _report.Compile();

                _report["UserID"]     = (param.UserID.Trim() == string.Empty ? "0" : param.UserID.Trim());
                _report["fDate"]      = (param.FirstDate.Trim() == string.Empty ? "1500/01/01" : param.FirstDate.Trim());
                _report["lDate"]      = (param.LastDate.Trim() == string.Empty ? "1500/01/01" : param.LastDate.Trim());
                _report["StateCode"]  = (param.StateCode.Trim() == string.Empty ? 0 : Convert.ToInt32(param.LastStateCode));
                _report["CityCode"]   = (param.CityCode.Trim() == string.Empty ? 0 : Convert.ToInt32(param.CityCode));
                _report["PostNode"]   = (param.PostNodeCode.Trim() == string.Empty ? 0 : Convert.ToInt32(param.PostNodeCode));
                _report["StatusID"]   = (param.BarcodeStatusID.Trim() == string.Empty ? 0 :Convert.ToInt32(param.BarcodeStatusID));
                _report["UserName"]   = _LoginDetails.Pname + " " + _LoginDetails.RolePname + " از " + _LoginDetails.StateName;
                _report["ReportDate"] = DateAndTime.GetSQLDate10DigitShamsi() + " -- " + DateAndTime.GetSQLTime8Digit();

                StiWebViewer1.Report = _report;
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptBarcodeDetail ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                UserValidate();

                ReportObject(ANP.Data.BaseData.Library.Encryption.Decrypt(Request.QueryString["pra"].ToString()));
                string ConnectionString             = _host.ConnectionString;
                Stimulsoft.Report.StiReport _report = new StiReport();
                _report.Load(Resources.mrtFinancialParcelOfFirstState);
                _report.Dictionary.Databases.Clear();
                _report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("PofficeCOD186", ConnectionString));
                _report.Compile();

                _report["FirstState"]       = (ddlState == string.Empty ? 0 : Convert.ToInt32(ddlState));
                _report["FirstCity"]        = (ddlCity == string.Empty ? 0 : Convert.ToInt32(ddlCity));
                _report["FirstPostNode"]    = (ddlPostNode == string.Empty ? 0 : Convert.ToInt32(ddlPostNode));
                _report["LastState"]        = (ddlLastState == string.Empty ? 0 : Convert.ToInt32(ddlLastState));
                _report["LastCity"]         = (ddlLastCity == string.Empty ? 0 : Convert.ToInt32(ddlLastCity));
                _report["LastPostNode"]     = (ddlLastPostNode == string.Empty ? 0 : Convert.ToInt32(ddlLastPostNode));
                _report["FirstDate"]        = Fdate;
                _report["LastDate"]         = Ldate;
                _report["PayType"]          = (ddlCredit == string.Empty ? 0 : Convert.ToInt32(ddlCredit));
                _report["BarcodeStatus"]    = (ddlBarcodeStatus == string.Empty ? 0 : Convert.ToInt32(ddlBarcodeStatus));
                _report["BarcodeSubStatus"] = (ddlBarcodeSubStatus == string.Empty ? 0 : Convert.ToInt32(ddlBarcodeSubStatus));
                _report["UserName"]         = _LoginDetails.Pname + " " + _LoginDetails.RolePname + " از " + _LoginDetails.StateName;
                _report["ReportDate"]       = DateAndTime.GetSQLDate10DigitShamsi() + " -- " + DateAndTime.GetSQLTime8Digit();

                StiWebViewer1.Report = _report;
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptFinancialParcelOfFirstState ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }