Exemplo n.º 1
0
        private void BtnFilterOption_Click(object sender, EventArgs e)
        {
            FilterRptDayBook frm = new FilterRptDayBook();

            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog();
            BindReport(frm);
        }
Exemplo n.º 2
0
        private void AfterLoading(object sender, EventArgs e)
        {
            this.Activated -= AfterLoading;
            FilterRptDayBook frm = new FilterRptDayBook();

            frm.ShowDialog();
            BindReport(frm);
        }
Exemplo n.º 3
0
        private void BindReport(FilterRptDayBook frm)
        {
            //DataTable dtTerm = new DataTable();
            DataSet ds = new DataSet();

            if (frm.ButtonAction == "OK")
            {
                DataTable NullDt = new DataTable();
                Grid.DataSource = NullDt;
                DateTime FromDate = new DateTime();
                DateTime ToDate   = new DateTime();
                if (ClsGlobal.DateType == "D")
                {
                    FromDate = Convert.ToDateTime(frm.TxtFromDate.Text);
                    ToDate   = Convert.ToDateTime(frm.TxtToDate.Text);
                }
                else
                {
                    FromDate = Convert.ToDateTime(frm.TxtFromDate.Tag.ToString());
                    ToDate   = Convert.ToDateTime(frm.TxtToDate.Tag.ToString());
                }

                bool isNarrationShow = (frm.ChkNarration.Checked == true) ? true : false;
                ds = _objRptAllLedger.DayBookDateWise(FromDate, ToDate, ClsGlobal.BranchId, ClsGlobal.CompanyUnitId, isNarrationShow);
                Grid.DataSource = ds.Tables[0];

                Grid.Columns["Date"].AutoSizeMode        = DataGridViewAutoSizeColumnMode.Fill;
                Grid.Columns["Voucher No"].AutoSizeMode  = DataGridViewAutoSizeColumnMode.Fill;
                Grid.Columns["Particulars"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                Grid.Columns["Dr Amount"].AutoSizeMode   = DataGridViewAutoSizeColumnMode.Fill;
                Grid.Columns["Cr Amount"].AutoSizeMode   = DataGridViewAutoSizeColumnMode.Fill;

                Grid.Columns["Dr Amount"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                Grid.Columns["Cr Amount"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                int i = 0;
                foreach (DataGridViewRow row in Grid.Rows)
                {
                    if (row.Cells["IsBold"].Value.ToString() == "Y" || row.Cells["Particulars"].Value.ToString() == "Total :" || row.Cells["Particulars"].Value.ToString() == "Day Total :" || row.Cells["Voucher No"].Value.ToString() == "Narr :")
                    {
                        if (row.Cells["IsBold"].Value.ToString() == "Y")
                        {
                            Grid.Rows[row.Index].DefaultCellStyle.Font = new Font("Arial", 8f, FontStyle.Bold);
                        }
                        if (row.Cells["Particulars"].Value.ToString() == "Total :" || row.Cells["Particulars"].Value.ToString() == "Day Total :")
                        {
                            Grid.Rows[row.Index].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                        }

                        if (row.Cells["Voucher No"].Value.ToString() == "Narr :")
                        {
                            Grid.Rows[i].Cells[1].Style.Alignment      = DataGridViewContentAlignment.MiddleRight;
                            Grid.Rows[row.Index].DefaultCellStyle.Font = new Font("Arial", 8f, FontStyle.Italic);
                        }
                    }
                    i++;
                }
                Grid.Columns["IsBold"].Visible = false;
                Grid.Columns.Cast <DataGridViewColumn>().ToList().ForEach(f => f.SortMode = DataGridViewColumnSortMode.NotSortable);
            }
            frm.Dispose();
        }