using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using CrystalDecisions.CrystalReports.Engine;

namespace Transport
{
    public partial class cost_report : Office2007Form
    {
        public cost_report()
        {
            InitializeComponent();
        }

        #region  فیلد های لازم برای پرکردن گزارش
        
        public static DataTable CostReportDataTable;
        
        public static string sum_all_transport = "";
        public static string sum_all_cost = "";
        public static string sum_all_remain = "";
        public static string report_date = "";
        public static string report_cost_group = "";

        #endregion

        // متد بارگذاری فرم نمایش گزارش هزینه ها
        private void cost_report_Load(object sender, EventArgs e)
        {
            DataSet1 ds = new DataSet1();
            CR2 mycr2 = new CR2();
            TextObject sum_all_trasportt2 = (TextObject)mycr2.ReportDefinition.ReportObjects["txt_all_transport"];
            TextObject sum_all_cost2= (TextObject)mycr2.ReportDefinition.ReportObjects["txt_all_cost"];
            TextObject sum_all_remain2= (TextObject)mycr2.ReportDefinition.ReportObjects["txt_all_remain"];
            TextObject report_date2 = (TextObject)mycr2.ReportDefinition.ReportObjects["txt_report_date"];
            TextObject report_cost_group2 = (TextObject)mycr2.ReportDefinition.ReportObjects["txt_cost_group_name"];

            sum_all_trasportt2.Text = sum_all_transport;
            sum_all_cost2.Text = sum_all_cost;
            sum_all_remain2.Text = sum_all_remain;
            report_date2.Text = report_date;
            report_cost_group2.Text = report_cost_group;

            mycr2.SetDataSource(CostReportDataTable);
            crystalReportViewer1.ReportSource = mycr2;
        }

        // متد دکمه برگشت 
        private void btn_back_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
