private void btnPrint_Click(object sender, EventArgs e)
        {
            frmRaporDialog frm = new frmRaporDialog(true, true, true, false);

            frm.ShowDialog();
            try {
                ReportTo?dest = frm.GetReportDestination();
                if (dest.HasValue)
                {
                    if (dest.Value != ReportTo.CrytalReport)
                    {
                        // Create the report and turn our query into a ReportSource
                        var report = new Report(_data.ToReportSource());
                        // Customize the Text Fields
                        report.TextFields.Title  = "Gün gün Kasa Raporu";
                        report.TextFields.Header = string.Format(@"
    Kasa  :{0}
    Rapor Tarihi: {1}
    Tarih Aralığı:{2}
",
                                                                 cmboxKasalar.Text, DateTime.Now, GetTarihAraligi());


                        // Render hints allow you to pass additional hints to the reports as they are being rendered
                        report.DataFields["Gelir"].ShowTotals  = true;
                        report.DataFields["Gider"].ShowTotals  = true;
                        report.DataFields["Bakiye"].ShowTotals = true;
                        // Customize the data fields
                        report.RenderHints["HtmlStyle"]              = "th { font-size: 14px !important;font-weight:bold !important}";
                        report.DataFields["Gelir"].DataFormatString  = "{0:F2}";
                        report.DataFields["Gider"].DataFormatString  = "{0:F2}";
                        report.DataFields["Bakiye"].DataFormatString = "{0:F2}";
                        report.DataFields["Tarih"].DataFormatString  = "{0:d}";
                        string        fileName = "gunGunKasaRaporu.xls";
                        IReportWriter writer   = new ExcelReportWriter();
                        if (dest.Value == ReportTo.Html)
                        {
                            writer   = new HtmlReportWriter();
                            fileName = "gunGunKasaRaporu.html";
                        }
                        else if (dest.Value == ReportTo.Csv)
                        {
                            writer   = new DelimitedTextReportWriter();
                            fileName = "gunGunKasaRaporu.txt";
                        }
                        string     file = Path.Combine(Engine.DokumanPath(), fileName);
                        FileStream fs   = new FileStream(file, FileMode.Create);

                        writer.WriteReport(report, fs);
                        fs.Close();
                        Process prc = new Process();
                        prc.StartInfo.FileName = file;
                        prc.Start();
                    }
                }
            } catch (Exception exc) {
                MessageBox.Show(exc.Message);
                LogWrite.Write(exc);
            }
        }
Esempio n. 2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmRaporDialog frm = new frmRaporDialog(true, true, true, false);

            frm.ShowDialog();
            ReportTo?dest = frm.GetReportDestination();

            if (dest.HasValue)
            {
                try {
                    if (dest != ReportTo.CrytalReport)
                    {
                        var report = new Report(_source.ToReportSource());
                        // Customize the Text Fields
                        report.RenderHints.IncludePageNumbers = true;
                        report.TextFields.Title  = tabPage2.Text;
                        report.TextFields.Header = string.Format(@"
            Rapor Tarihi:{0}
            Rapor Tarih Aralığı:{1}
            Cari:{2}         
            ", DateTime.Now, GetTarihAraligi(), RaporCariString());
                        report.DataFields["Tarih"].DataFormatString  = "{0:d}";
                        report.DataFields["Borc"].DataFormatString   = "{0:F2}";
                        report.DataFields["Alacak"].DataFormatString = "{0:F2}";
                        report.DataFields["Alacak"].ShowTotals       = true;
                        report.DataFields["Borc"].ShowTotals         = true;
                        string        fileName = "cariHareketDokumu.xls";
                        IReportWriter writer   = new ExcelReportWriter();

                        if (dest.Value == ReportTo.Html)
                        {
                            writer   = new HtmlReportWriter();
                            fileName = "cariHareketDokumu.html";
                        }
                        else if (dest.Value == ReportTo.Csv)
                        {
                            writer   = new DelimitedTextReportWriter();
                            fileName = "cariHareketDokumu.txt";
                        }
                        string     file = Path.Combine(Engine.DokumanPath(), fileName);
                        FileStream fs   = new FileStream(file, FileMode.Create);

                        writer.WriteReport(report, fs);
                        fs.Close();
                        Process prc = new Process();
                        prc.StartInfo.FileName = file;
                        prc.Start();
                    }
                    else
                    {
                        //frmStokAlisSatisRaporCrytalRapor frm2 = new frmStokAlisSatisRaporCrytalRapor(_source);
                        //frm2.Show();
                    }
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
            }
        }
Esempio n. 3
0
    private void btnPrint_Click(object sender, EventArgs e) {
        frmRaporDialog frm = new frmRaporDialog(true, true, true, false);
        frm.ShowDialog();
        ReportTo? dest = frm.GetReportDestination();
        if (dest.HasValue) {
            try {
                if (dest.Value != ReportTo.CrytalReport) {


                    // Create the report and turn our query into a ReportSource
                    var report = new Report(_source.ToReportSource());
                    // Customize the Text Fields

                    report.TextFields.Title = "Kasa Hareket Dökümü";
                    report.TextFields.Header = string.Format(@"
            Rapor Tarihi:{0}
            Tarih Aralığı:{1}
            Kasa:{2} 
            ", DateTime.Now,GetTarihAraligi(), _source.Rows[0]["KasaKod"].ToStringOrEmpty());
                    // Render hints allow you to pass additional hints to the reports as they are being rendered
                    report.RenderHints.BooleanCheckboxes = true;
                    // Customize the data fields
                    report.DataFields["Tutar"].ShowTotals = true;
                    report.DataFields["KasaKod"].Hidden = true;
                    //report.DataFields["Tutar"].DataFormatString = "{0:c}";
                    report.DataFields["Tarih"].DataFormatString = "{0:d}";
                    string fileName = "kasahareketDokumu.xls";
                    IReportWriter writer = new ExcelReportWriter();
                    if (dest.Value == ReportTo.Html) {
                        writer = new HtmlReportWriter();
                        fileName = "kasahareketDokumu.html";
                    } else if (dest.Value == ReportTo.Csv) {
                        writer = new DelimitedTextReportWriter();
                        fileName = "kasahareketDokumu.txt";
                    }
                    string file = Path.Combine(Engine.DokumanPath(), fileName);
                    FileStream fs = new FileStream(file, FileMode.Create);

                    writer.WriteReport(report, fs);
                    fs.Close();
                    Process prc = new Process();
                    prc.StartInfo.FileName = file;
                    prc.Start();

                }
            } catch (Exception exc) {
                MessageBox.Show(exc.Message);
                LogWrite.Write(exc);
            }

        }
    }
Esempio n. 4
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmRaporDialog frm = new frmRaporDialog(true, true, true, false);

            frm.ShowDialog();
            ReportTo?dest = frm.GetReportDestination();

            if (dest.HasValue)
            {
                try {
                    if (dest != ReportTo.CrytalReport)
                    {
                        var report = new Report(_source.ToReportSource());
                        // Customize the Text Fields
                        report.RenderHints.IncludePageNumbers = true;
                        report.TextFields.Title  = tabPageFiltre.Text;
                        report.TextFields.Header = string.Format(@"
            Rapor Tarihi:{0}
            Stok:{1}
            Rapor Tarih Aralığı:{2}            
            ", DateTime.Now, SecilenStok(), GetTarihAraligi()
                                                                 );

                        //report.DataFields["Tarih"].DataFormatString = "{0:d}";
                        //report.DataFields["BirimFiyat"].DataFormatString = "{0:F2}";
                        //report.DataFields["Tutar"].DataFormatString = "{0:F2}";
                        report.RenderHints["HtmlStyle"]                    = "th { font-size: 13px !important;font-weight:bold !important;}";
                        report.RenderHints["HtmlStyle"]                    = "td { font-size: 11px !important;line-height:1em; }";
                        report.DataFields["KalanMiktar"].ShowTotals        = true;
                        report.DataFields["SatisMiktar"].ShowTotals        = true;
                        report.DataFields["AlisMiktar"].ShowTotals         = true;
                        report.DataFields["OrtalamaAlisFiyat"].ShowTotals  = true;
                        report.DataFields["OrtalamaSatisFiyat"].ShowTotals = true;
                        report.DataFields["AlisTutar"].ShowTotals          = true;

                        report.DataFields["SatisTutar"].ShowTotals         = true;
                        report.DataFields["KalanMalinMaliyeti"].ShowTotals = true;

                        string        fileName = "malMaliyetRaporu";
                        IReportWriter writer   = new ExcelReportWriter();

                        if (dest.Value == ReportTo.Excel)
                        {
                            fileName = fileName + ".xls";
                        }
                        else if (dest.Value == ReportTo.Html)
                        {
                            writer   = new HtmlReportWriter();
                            fileName = fileName + ".html";
                        }
                        else if (dest.Value == ReportTo.Csv)
                        {
                            writer   = new DelimitedTextReportWriter();
                            fileName = fileName + ".txt";
                        }
                        string     file = Path.Combine(Engine.DokumanPath(), fileName);
                        FileStream fs   = new FileStream(file, FileMode.Create);

                        writer.WriteReport(report, fs);
                        fs.Close();
                        Process prc = new Process();
                        prc.StartInfo.FileName = file;
                        prc.Start();
                    }
                    else
                    {
                        //frmStokAlisSatisRaporCrytalRapor frm2 = new frmStokAlisSatisRaporCrytalRapor(_source);
                        //frm2.Show();
                    }
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
            }
        }
Esempio n. 5
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmRaporDialog frm = new frmRaporDialog(true, true, true, false);

            frm.ShowDialog();
            ReportTo?dest = frm.GetReportDestination();

            if (dest.HasValue)
            {
                try {
                    if (dest != ReportTo.CrytalReport)
                    {
                        var report = new Report(_source.ToReportSource());
                        // Customize the Text Fields
                        report.RenderHints.IncludePageNumbers = true;
                        report.TextFields.Title  = tabPage2.Text;
                        report.TextFields.Header = string.Format(@"
            Rapor Tarihi:{0}
            Stok:{2}
            Toplam Adet:{2}
            Toplam Tutar:{3}
            Rapor Tarih Aralığı:{4} 
            ", DateTime.Now, SecilenStok(), _source.Compute("sum(Miktar)", ""), _source.Compute("sum(Tutar)", ""), GetTarihAraligi());
                        report.DataFields["Tarih"].DataFormatString      = "{0:d}";
                        report.DataFields["BirimFiyat"].DataFormatString = "{0:F2}";
                        report.DataFields["Tutar"].DataFormatString      = "{0:F2}";
                        string        fileName = StokAlisSatisRapor.AlisRapor == _alisSatis ? "malAlisRapor" : "malSatisRapor";
                        IReportWriter writer   = new ExcelReportWriter();
                        if (dest.Value == ReportTo.Excel)
                        {
                            fileName = fileName + ".xls";
                        }
                        else if (dest.Value == ReportTo.Html)
                        {
                            writer   = new HtmlReportWriter();
                            fileName = fileName + ".html";
                        }
                        else if (dest.Value == ReportTo.Csv)
                        {
                            writer   = new DelimitedTextReportWriter();
                            fileName = fileName + ".txt";
                        }
                        string     file = Path.Combine(Engine.DokumanPath(), fileName);
                        FileStream fs   = new FileStream(file, FileMode.Create);

                        writer.WriteReport(report, fs);
                        fs.Close();
                        Process prc = new Process();
                        prc.StartInfo.FileName = file;
                        prc.Start();
                    }
                    else
                    {
                        //frmStokAlisSatisRaporCrytalRapor frm2 = new frmStokAlisSatisRaporCrytalRapor(_source);
                        //frm2.Show();
                    }
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
            }
        }
Esempio n. 6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmRaporDialog frm = new frmRaporDialog(true, true, true, false);

            frm.ShowDialog();
            ReportTo?dest = frm.GetReportDestination();

            if (dest.HasValue)
            {
                try {
                    if (dest != ReportTo.CrytalReport)
                    {
                        var report = new Report(ListToDataTable().ToReportSource());
                        // Customize the Text Fields

                        report.TextFields.Title  = "Banka Hareket Raporu";
                        report.TextFields.Header = string.Format(@"
            Rapor Tarihi  :{0}
            HesapNo       :{1}
            BankaAdı      :{2}
            HesapSahibi   :{3}
            ŞubeAdı       :{4}
            ParaBirimi    :{5}           
            Tarih Aralığı :{6} 
            ", DateTime.Now, txtHesapNo.Text, txtBankaAdi.Text, txtHesapSahip.Text, txtSubeAdi.Text
                                                                 , txtParaBirimi.Text, GetTarihAraligi());
                        report.DataFields["Tarih"].DataFormatString = "{0:d}";
                        report.DataFields["Tutar"].DataFormatString = "{0:F2}";
                        report.DataFields["Tutar"].ShowTotals       = true;
                        string        fileName = "bankaRaporu";
                        IReportWriter writer   = new ExcelReportWriter();
                        if (dest.Value == ReportTo.Excel)
                        {
                            fileName = fileName + ".xls";
                        }
                        else if (dest.Value == ReportTo.Html)
                        {
                            writer   = new HtmlReportWriter();
                            fileName = fileName + ".html";
                        }
                        else if (dest.Value == ReportTo.Csv)
                        {
                            writer   = new DelimitedTextReportWriter();
                            fileName = fileName + ".txt";
                        }
                        string     file = Path.Combine(Engine.DokumanPath(), fileName);
                        FileStream fs   = new FileStream(file, FileMode.Create);

                        writer.WriteReport(report, fs);
                        fs.Close();
                        Process prc = new Process();
                        prc.StartInfo.FileName = file;
                        prc.Start();
                    }
                    else
                    {
                        //frmBankaHarReport frm2 = new frmBankaHarReport(hareketList);
                        //frm2.Show();
                    }
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
            }
        }
Esempio n. 7
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmRaporDialog frm = new frmRaporDialog(true, true, true, false);

            frm.ShowDialog();
            ReportTo?dest = frm.GetReportDestination();

            if (dest.HasValue)
            {
                try {
                    if (dest != ReportTo.CrytalReport)
                    {
                        List <DurumGelirGider> liste = new List <DurumGelirGider>();

                        liste.Add(_gelirler);

                        var report = new Report(liste.ToReportSource());


                        // Customize the Text Fields
                        report.RenderHints.IncludePageNumbers = true;
                        report.TextFields.Title  = "Genel Durum Raporu";
                        report.TextFields.Header = string.Format(@"
            Rapor Tarihi:{0} 
            Toplam Gelir:{1:F}
            Toplam Gider:{2:F}
            Bakiye:{3:F}
            Rapor Tarih Aralığı:{4}
            
            ", DateTime.Now, toplamGelir(), toplamGider(), bakiye(), GetTarihAraligi());
                        //report.DataFields["Alacak"].DataFormatString = "{0:F2}";
                        //report.DataFields["Borc"].DataFormatString = "{0:F2}";
                        //report.DataFields["AlacakBakiyesi"].DataFormatString = "{0:F2}";
                        //report.DataFields["BorcBakiyesi"].DataFormatString = "{0:F2}";
                        string        fileName = "genelDurumRaporu.xls";
                        IReportWriter writer   = new ExcelReportWriter();

                        if (dest.Value == ReportTo.Html)
                        {
                            writer   = new HtmlReportWriter();
                            fileName = "genelDurumRaporu.html";
                        }
                        else if (dest.Value == ReportTo.Csv)
                        {
                            writer   = new DelimitedTextReportWriter();
                            fileName = "genelDurumRaporu.txt";
                        }
                        string     file = Path.Combine(Engine.DokumanPath(), fileName);
                        FileStream fs   = new FileStream(file, FileMode.Create);

                        writer.WriteReport(report, fs);
                        fs.Close();
                        Process prc = new Process();
                        prc.StartInfo.FileName = file;
                        prc.Start();
                    }
                    else
                    {
                        //frmStokHareketDokumuForCrytalReport frm2 = new frmStokHareketDokumuForCrytalReport(_source);
                        //frm2.Show();
                    }
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
            }
        }