Esempio n. 1
0
        public override bool Export(Elements.TableReportElement item, IReportDocument document)
        {
            var wordDoc = (NEMILTEC.Service.Reporting.Concrete.Documents.WordDocument)document;

            wordDoc.InsertRows(item.TemplateInfo.Index, item.Output);
            return(true);
        }
Esempio n. 2
0
        private void radButton1_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("Siap kan kertas di printer"
                                               , "Print Laporan Rincian Kas Bon"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question
                                               , MessageBoxDefaultButton.Button2
                                               , MessageBoxOptions.DefaultDesktopOnly);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Print Rincian Summary Gaji
                rptKasBon gj = new rptKasBon();
                gj.ReportParameters[0].Value      = NBConfig.IGMID;
                gj.ReportParameters["user"].Value = NBConfig.ValidUserName;
                IReportDocument report1 = (IReportDocument)gj;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...

                // Print the report using the printer settings.
                ReportProcessor reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(report1, printerSettings);
            }
        }
Esempio n. 3
0
        public dlgImageBarcode(string guid, string title = "")
        {
            this.Load += (EventHandler)((a0, a1) => this.me_load());
            this.InitializeComponent();
            this.Text = title;
            InstanceReportSource instanceReportSource = new InstanceReportSource();

            this.m_ReportDocument = (IReportDocument) new ImageBarcode(guid);
            instanceReportSource.ReportDocument = this.m_ReportDocument;
            this.rvReportsViewer.ReportSource   = (ReportSource)instanceReportSource;
            try
            {
                foreach (Control control in this.pnlMultiplier.Controls)
                {
                    RadioButton radioButton = control as RadioButton;
                    if (radioButton != null && Operators.ConditionalCompareObjectEqual(radioButton.Tag, (object)dlgImageBarcode.DefaultMultiplier, false))
                    {
                        radioButton.Select();
                    }
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            this.rvReportsViewer.ToolbarVisible = false;
        }
Esempio n. 4
0
        private void btnPrintTotal_Click(object sender, EventArgs e)
        {
            DialogResult res = RadMessageBox.Show("Print Total Gaji Satpam. Siap kan kertas di printer."
                                                  , "Print Total Gaji Satpam"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button2);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Print Slip Gaji
                rptGajiOtherSummary ab = new rptGajiOtherSummary();
                ab.ReportParameters[0].Value      = "satpam";
                ab.ReportParameters[1].Value      = NBConfig.IGBID;
                ab.ReportParameters["User"].Value = NBConfig.ValidUserName;

                IReportDocument report1 = (IReportDocument)ab;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...

                // Print the report using the printer settings.
                ReportProcessor reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(report1, printerSettings);

                helper.PrintLog(this.Text, ab.Name, "Satpam ; GBID = " + NBConfig.IGBID.ToString());
            }
        }
Esempio n. 5
0
 public void build(IReportDocument poReportDocument)
 {
     foreach (IReportItem oReportItem in this._oReportItemsList)
     {
         oReportItem.addToReportDocument(poReportDocument);
     }
 }
Esempio n. 6
0
        public override bool Export(Elements.TextReportElement item, IReportDocument document)
        {
            var wordDoc = (NEMILTEC.Service.Reporting.Concrete.Documents.WordDocument)document;

            wordDoc.ReplaceText(item.TemplateInfo.SubstitutionText, item.Output);
            return(true);
        }
Esempio n. 7
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("Print Absen Staff. Siap kan kertas di printer."
                                               , "Print Absen Staff"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question
                                               , MessageBoxDefaultButton.Button2
                                               , MessageBoxOptions.DefaultDesktopOnly);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Print Slip Gaji
                rptAbsenOther ab = new rptAbsenOther();
                ab.ReportParameters[0].Value = "staff";
                ab.ReportParameters[1].Value = rddGBID.SelectedValue;
                IReportDocument report1 = (IReportDocument)ab;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...

                // Print the report using the printer settings.
                ReportProcessor reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(report1, printerSettings);

                helper.PrintLog(this.GetType().Name, ab.Name, "GBID:" + rddGBID.SelectedValue.ToString());
            }
        }
Esempio n. 8
0
        public static IReportDocument Create(ReportType type, string filename)
        {
            IReportDocument reportDocument = null;

            try
            {
                switch (type)
                {
                case ReportType.Word:
                    reportDocument = new WordDocument(filename);
                    break;

                case ReportType.Excel:
                    reportDocument = new ExcelDocument(filename);
                    break;

                case ReportType.PowerPoint:
                    reportDocument = new PowerPointDocument(filename);
                    break;
                }
            }
            catch (IOException)
            {
                return(null);
            }
            return(reportDocument);
        }
Esempio n. 9
0
        private void btnPrintLaporan_Click(object sender, EventArgs e)
        {
            DialogResult res = RadMessageBox.Show("Print Laporan Res Bulanan. Siap kan kertas di printer."
                                                  , "Print Laporan Res Bulanan"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button2);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                rptResBulananSummary rpt = new rptResBulananSummary();
                rpt.ReportParameters["GBID"].Value = rddGBID.SelectedValue;
                rpt.ReportParameters["User"].Value = NBConfig.ValidUserName;
                IReportDocument report1 = (IReportDocument)rpt;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...

                InstanceReportSource reportSource = new InstanceReportSource();
                reportSource.ReportDocument = report1;

                // Print the report using the printer settings.
                ReportProcessor reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(reportSource, printerSettings);

                helper.PrintLog(this.Text, rpt.Name, "GBID: " + NBConfig.IGBID);
            }
        }
Esempio n. 10
0
        private void btnDataAbsen_Click(object sender, EventArgs e)
        {
            ////On Printing Surat Jalan Make sure after printing surat jalan has been updated too
            ////printed so the next time surat jalan is printing COPY is appended to the title.
            DialogResult res = MessageBox.Show("Print Data Absen. Siap kan kertas di printer."
                                               , "Print Data Absen"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question
                                               , MessageBoxDefaultButton.Button2
                                               , MessageBoxOptions.DefaultDesktopOnly);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Print Slip Gaji
                rptKehadiran gj = new rptKehadiran();
                gj.ReportParameters[0].Value      = NBConfig.IGMID;
                gj.ReportParameters["User"].Value = NBConfig.ValidUserName;
                IReportDocument report1 = (IReportDocument)gj;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...

                // Print the report using the printer settings.
                ReportProcessor reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(report1, printerSettings);
            }
        }
Esempio n. 11
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult res = RadMessageBox.Show("Print Absen Staff. Siap kan kertas di printer."
                                                  , "Print Absen Staff"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button2);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Print Slip Gaji
                rptAbsenOther ab = new rptAbsenOther();
                ab.ReportParameters[0].Value = "satpam";
                ab.ReportParameters[1].Value = rddGBID.SelectedValue;
                IReportDocument report1 = (IReportDocument)ab;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...

                InstanceReportSource reportSource = new InstanceReportSource();
                reportSource.ReportDocument = report1;

                // Print the report using the printer settings.
                ReportProcessor reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(reportSource, printerSettings);
                helper.PrintLog(this.GetType().Name, ab.Name, "Memberid : " + rddMember.Text + "; GBID:" + rddGBID.Text);
            }
        }
Esempio n. 12
0
        private void radButton1_Click(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();

            //set any deviceInfo settings if necessary
            System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();

            //Print Slip Gaji
            rptBarangKeluarTabel rpt1 = new rptBarangKeluarTabel();

            rpt1.ReportParameters[0].Value = DateTime.Now;
            //gj.ReportParameters["User"].Value = NBConfig.ValidUserName;
            IReportDocument report1 = (IReportDocument)rpt1;

            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("XLS", report1, deviceInfo);
            string fileName = "SURATJALAN_" + DateTime.Now.ToString("ddMMMyy") + "." + result.Extension;

            const string path     = @"\\sinarekserver\forms\";
            string       filePath = System.IO.Path.Combine(path, fileName);

            using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
            {
                fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            }
        }
Esempio n. 13
0
        private void btPrintPages_Click(object sender, EventArgs e)
        {
            if (int.Parse(txtFrom.Value.ToString()) > 0)
            {
                DialogResult res = MessageBox.Show("Print Slip Gaji. Siap kan kertas di printer."
                                                   , "Print Slip Gaji"
                                                   , MessageBoxButtons.OKCancel
                                                   , MessageBoxIcon.Question
                                                   , MessageBoxDefaultButton.Button2
                                                   , MessageBoxOptions.DefaultDesktopOnly);

                if (res == System.Windows.Forms.DialogResult.OK)
                {
                    //Print Slip Gaji
                    rptGajiStaff gj = new rptGajiStaff();
                    gj.ReportParameters["GBID"].Value = rddGajiMingguan.SelectedValue;
                    gj.ReportParameters["User"].Value = NBConfig.ValidUserName;
                    IReportDocument report1 = (IReportDocument)gj;
                    ////set parameters when necessary

                    //// PrinterSettings
                    PrinterSettings printerSettings = new PrinterSettings();
                    printerSettings.DefaultPageSettings.PaperSize      = new PaperSize("Mini Letter", 850, 550);
                    printerSettings.DefaultPageSettings.Margins.Top    = 17;
                    printerSettings.DefaultPageSettings.Margins.Bottom = 17;
                    printerSettings.DefaultPageSettings.Margins.Left   = 12;
                    printerSettings.DefaultPageSettings.Margins.Right  = 12;

                    //// Adjust the printer settings if necessary...
                    printerSettings.PrintRange = PrintRange.SomePages;
                    printerSettings.FromPage   = int.Parse(txtFrom.Value.ToString());
                    printerSettings.ToPage     = int.Parse(txtTo.Value.ToString());

                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = report1;
                    // Print the report using the printer settings.
                    ReportProcessor reportProcessor = new ReportProcessor();

                    reportProcessor.PrintReport(reportSource, printerSettings);

                    //process printed
                    if (!NBConfig.GetGBIDPrintedStaff())
                    {
                        using (sinarekDataSetTableAdapters.gajibulananTableAdapter gb = new sinarekDataSetTableAdapters.gajibulananTableAdapter())
                        {
                            gb.UpdatePrintedStaff(NBConfig.ValidUserName, NBConfig.IGBID);
                        }
                        SetPrintedForms();
                        helper.NotifMessage("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                    }
                }
            }
            else
            {
                //Silahkan pilih halaman untuk di print
                MessageBox.Show("Pilih halaman untuk di print!");
            }
        }
Esempio n. 14
0
        ReportSource CreateInstanceReportSource(IReportDocument report, ReportSource originalReportSource)
        {
            var instanceReportSource = new InstanceReportSource {
                ReportDocument = report
            };

            instanceReportSource.Parameters.AddRange(originalReportSource.Parameters);
            return(instanceReportSource);
        }
Esempio n. 15
0
        internal static void CreateReport(this IReportDocument report, string fileName, string renderType)
        {
            var instanceReportSource = new InstanceReportSource {
                ReportDocument = report
            };
            var result = new ReportProcessor().RenderReport(renderType, instanceReportSource, null);

            using (var fileStream = new FileStream(fileName, FileMode.Create))
            {
                fileStream.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
                fileStream.Flush();
            }
        }
Esempio n. 16
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //Check if there is at least one rincian

            //Check nota sequence

            //Check nilai surat jalan vs nilai uang setoran

            //Others info connected to this transaction
            //Print Selected Transaction
            //Print
            DialogResult res = MessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptLaporanPenj rpt = new rptLaporanPenj();
                rpt.ReportParameters["user"].Value     = NBConfig.ValidUserName;
                rpt.ReportParameters["lappenid"].Value = lappenid_;
                //rpt.ReportParameters["custtypetoid"].Value = custtypetoid;

                IReportDocument iRpt = (IReportDocument)rpt;
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                try
                {
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = iRpt;

                    reportProcessor = new ReportProcessor();
                    reportProcessor.PrintReport(reportSource, printerSettings);
                    using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter())
                    {
                        tbl.UpdateLapPenj(NBConfig.ValidUserName
                                          , 1
                                          , 1
                                          , int.Parse(lappenid_));
                    }
                    SetFormPrinted();
                }
                catch (Exception ex)
                {
                    helper.ErrorMessage(ex.Message);
                }
            }
        }
Esempio n. 17
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string iLappenID = radGridView3.SelectedRows[0].Cells["lappenID"].Value.ToString();
            //Print
            DialogResult res = RadMessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button2);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptLaporanUJ rpt = new rptLaporanUJ();
                rpt.ReportParameters["user"].Value     = NBConfig.ValidUserName;
                rpt.ReportParameters["lappenid"].Value = iLappenID;
                rpt.ReportParameters["logid"].Value    = radGridView3.SelectedRows[0].Cells["logID"].Value.ToString();

                IReportDocument iRpt = (IReportDocument)rpt;

                iRpt.DocumentName = radGridView3.SelectedRows[0].Cells["NOSJ"].Value.ToString() + " "
                                    + radGridView3.SelectedRows[0].Cells["SalesName"].Value.ToString();
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                try
                {
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = iRpt;

                    reportProcessor = new ReportProcessor();

                    reportProcessor.PrintReport(reportSource, printerSettings);
                    using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter())
                    {
                        tbl.UpdateLapPenj(NBConfig.ValidUserName
                                          , 1
                                          , 1, int.Parse(iLappenID));
                    }
                    helper.PrintLog(this.GetType().Name, rpt.Name, "Print:" + iLappenID);
                    this.vlappenTableAdapter.FillByTanggal(this.sinarekDataSet.vlappen, dtpTanggalLaporan.Value, "UJ");
                }
                catch (Exception ex)
                {
                    helper.SysLog(this.GetType().Name, this.Text, ex.Message);
                    //helper.ErrorMessage(ex.Message);
                }
            }
        }
Esempio n. 18
0
        private void btnPrintBJ_Click(object sender, EventArgs e)
        {
            DialogResult res = RadMessageBox.Show(@"Laporan Barang Jadi. Laporan Bisa Dilihat Di Z:\Inventory\Report\"
                                                  , "Print Laporan Stock"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button2);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Create stock akhir before printing
                helper.SysLog(this.GetType().Name, this.Text, "Creating Stock AKhir");
                using (sinarekDataSetTableAdapters.productbaseTableAdapter tbl = new sinarekDataSetTableAdapters.productbaseTableAdapter())
                {
                    tbl.pCreateStockAkhir(dtpTanggal.Value, int.Parse(rddTipe.SelectedValue.ToString()), NBConfig.ValidUserName);
                }

                rptTotalBarangNEW rpt = new rptTotalBarangNEW();
                rpt.ReportParameters["tanggal"].Value = dtpTanggal.Value;
                rpt.ReportParameters["User"].Value    = NBConfig.ValidUserName;

                IReportDocument iRpt = (IReportDocument)rpt;

                iRpt.DocumentName = "Barang_Jadi_" + DateTime.Now.ToString("yyyyMMddhhmm");
                ////set parameters when necessary
                //Laporan di simpan ke folder
                helper.SavedToEXCEL(iRpt, @"d:\Inventory\Report\");
                helper.PrintLog(this.Text, rpt.Name + "_FileEXCEL", "tanggal:" + dtpTanggal.Value.ToString());

                ////// PrinterSettings
                //PrinterSettings printerSettings = new PrinterSettings();
                ////// Adjust the printer settings if necessary...
                //try
                //{
                //    // Print the report using the printer settings.
                //    ReportProcessor reportProcessor = new ReportProcessor();
                //    reportProcessor.PrintReport(report1, printerSettings);

                //    //print log
                //    helper.PrintLog(this.Text, rpt.Name, "tanggal:" + dtpTanggal.Value.ToString());

                //}
                //catch (Exception ex)
                //{
                //    helper.SysLog(this.GetType().Name, this.Text, ex.Message);
                //    helper.ErrorMessage("Ada masalah untuk print laporan barang jadi. Segera hubungi administrator");
                //}
            }
        }
Esempio n. 19
0
        protected string ExportPdf(IReportDocument report)
        {
            Utility.Utilities.CreateDir(FileSavePath);
            string fullPath = FileSavePath + "\\" + Utility.Utilities.CleanInvalidFileName(this.file_name) + ".pdf";

            Exception exportException;

            ReportExporter.SaveReport(report, fullPath, out exportException);

            if (exportException != null)
            {
                throw exportException;
            }
            return(fullPath);
        }
Esempio n. 20
0
        /// <summary>
        /// Generate pdf file
        /// </summary>
        /// <param name="report"></param>
        /// <returns></returns>
        protected string GeneratePdf(IReportDocument report)
        {
            FileHelper.CreateDir(ReportGenerator.FileSavePath);
            string fullPath = ReportGenerator.FileSavePath + "\\" + FileHelper.CleanInvalidFileName(this.file_name) + ".pdf";

            Exception exportException;

            ReportGenerator.SaveReport(report, fullPath, out exportException, "PDF");

            if (exportException != null)
            {
                throw exportException;
            }
            return(fullPath);
        }
Esempio n. 21
0
        private void btnPrintSales_Click(object sender, EventArgs e)
        {
            //Print
            DialogResult res = RadMessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button2);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptLaporanPenjSales rpt = new rptLaporanPenjSales();
                rpt.ReportParameters["user"].Value      = NBConfig.ValidUserName;
                rpt.ReportParameters["salesname"].Value = lblSales.Text;
                rpt.ReportParameters["tanggal"].Value   = dtpTanggal.Value;

                IReportDocument iRpt = (IReportDocument)rpt;

                //iRpt.DocumentName = radGridView1.SelectedRows[0].Cells["NOSJ"].Value.ToString() + " "
                //                    + radGridView1.SelectedRows[0].Cells["SalesName"].Value.ToString();
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                try
                {
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = iRpt;
                    reportProcessor             = new ReportProcessor();
                    reportProcessor.PrintReport(reportSource, printerSettings);
                    //SavedToPDF(iRpt, @"C:\Users\VINA\Documents\Laporan Penjualan");
                    using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter())
                    {
                        tbl.UpdatePrintedSales(NBConfig.ValidUserName
                                               , 1
                                               , dtpTanggal.Value
                                               , lblSales.Text);
                    }
                    helper.PrintLog(this.GetType().Name, rpt.Name, "PrintSales:" + lblSales.Text + "," + dtpTanggal.Value.ToString("dd MMM yy"));
                    this.vlappenTableAdapter.FillByTanggal(this.sinarekDataSet.vlappen, dtpTanggal.Value, "Penjualan");
                }
                catch (Exception ex)
                {
                    helper.ErrorMessage(ex.Message);
                }
            }
        }
Esempio n. 22
0
        /// <summary>
        /// Recupera a view do documento do relatório.
        /// </summary>
        /// <param name="reportDocument"></param>
        /// <returns></returns>
        public static Colosoft.Reports.UI.IReportViewer GetViewer(this IReportDocument reportDocument)
        {
            var serviceLocator = Microsoft.Practices.ServiceLocation.ServiceLocator.Current;

            UI.IReportViewer reportViewer = null;
            try
            {
                reportViewer = serviceLocator.GetInstance <Colosoft.Reports.UI.IReportViewer>();
            }
            catch (Exception)
            {
                Notifications.Notification.Dispatch(ResourceMessageFormatter.Create(() => Properties.Resources.Extensions_GetReportViewerViewModelError), "Error".GetFormatter(), Notifications.MessageResultOption.OK, Notifications.NotificationType.Error, Notifications.MessageResult.OK);
                return(null);
            }
            reportViewer.Document = reportDocument;
            return(reportViewer);
        }
Esempio n. 23
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("Print Laporan Perhitungan Stock. Siap kan kertas di printer."
                                               , "Print Laporan Perhitungan Stock"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question
                                               , MessageBoxDefaultButton.Button2
                                               , MessageBoxOptions.DefaultDesktopOnly);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                rptSisaBarang gj = new rptSisaBarang();
                gj.ReportParameters["tanggal"].Value = dtpTanggal.Value;
                gj.ReportParameters["tipeid"].Value  = rddTipe.SelectedValue;
                gj.ReportParameters["User"].Value    = NBConfig.ValidUserName;
                IReportDocument report1 = (IReportDocument)gj;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...
                try
                {
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = report1;

                    // Print the report using the printer settings.
                    ReportProcessor reportProcessor = new ReportProcessor();
                    reportProcessor.PrintReport(reportSource, printerSettings);

                    //print log
                    helper.PrintLog(this.Text, gj.Name, "tanggal:" + dtpTanggal.Value.ToString() +
                                    ",tipeid:" + rddTipe.SelectedValue.ToString());

                    //Process Stock Data Akhir
                    //TODO: For Tipe 1 keep data for BSJ & BJ
                    //TODO: For the rest only keep record with stock with parentid = -1
                }
                catch (Exception ex)
                {
                    helper.ErrorMessage("Ada masalah untuk print laporan stock. Segera hubungi administrator");
                    helper.SysLog(this.GetType().Name, this.Text, "ERROR : " + ex.Message + " : " + ex.StackTrace);
                }
            }
        }
Esempio n. 24
0
        /// <summary>
        /// uses telerik reporting tool and writes data to either pdf or excel file according to selected report format from UI
        /// </summary>
        /// <param name="reportToExport">object of the class which prepares report</param>
        /// <param name="reportFormat">either pdf or excel format</param>
        /// <param name="varianceReportPath">html to excel template file path</param>
        /// <param name="baseFileName"></param>
        /// <param name="currentDateTime"></param>
        /// <returns></returns>
        public static string CreateFileUsingTelerik(IReportDocument reportToExport, Enums.DownloadFileType reportFormat, string varianceReportPath, string baseFileName, string currentDateTime)
        {
            var instanceReportSource = new InstanceReportSource {
                ReportDocument = reportToExport
            };
            var result = new ReportProcessor().RenderReport(reportFormat.ToString(), instanceReportSource, null);


            string fileName = string.Format("{0}{1}.{2}", baseFileName, currentDateTime, result.Extension);

            string filePath = Path.Combine(varianceReportPath, fileName);

            using (var fs = new FileStream(filePath, FileMode.Create))
            {
                fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            }
            return(fileName);
        }
        private ReportDocumentParser(ILogger <ReportDocumentParser> logger, string textBlock, DocumentSettings configuration)
        {
            _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
            _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
            if (string.IsNullOrEmpty(textBlock))
            {
                throw new ArgumentNullException(nameof(textBlock));
            }
            TextBlock   = textBlock;
            _entityType = _configuration.DataEntity;
            _entity     = (IReportDocument)Activator.CreateInstance(_entityType);

            if (_configuration.DataProcessor != null)
            {
                _entity.DataProcessor = (IDataProcessor)Activator.CreateInstance(configuration.DataProcessor);
            }
            _entity.OriginalDocument = textBlock;
        }
Esempio n. 26
0
        private void btnPrintNama_Click(object sender, EventArgs e)
        {
            if (rddMember.SelectedValue != null)
            {
                DialogResult res = MessageBox.Show("Print Slip Gaji Untuk " + rddMember.Text + ". Siap kan kertas di printer."
                                                   , "Print Slip Gaji Per Nama"
                                                   , MessageBoxButtons.OKCancel
                                                   , MessageBoxIcon.Question
                                                   , MessageBoxDefaultButton.Button2
                                                   , MessageBoxOptions.DefaultDesktopOnly);

                if (res == System.Windows.Forms.DialogResult.OK)
                {
                    //Print Slip Gaji
                    rptGajiMingguanNama gj = new rptGajiMingguanNama();
                    gj.ReportParameters["GMID"].Value     = rddGajiMingguan.SelectedValue;
                    gj.ReportParameters["User"].Value     = NBConfig.ValidUserName;
                    gj.ReportParameters["memberid"].Value = rddMember.SelectedValue;
                    IReportDocument report1 = (IReportDocument)gj;
                    ////set parameters when necessary

                    //// PrinterSettings
                    PrinterSettings printerSettings = new PrinterSettings();
                    //// Adjust the printer settings if necessary...
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = report1;
                    // Print the report using the printer settings.
                    ReportProcessor reportProcessor = new ReportProcessor();
                    reportProcessor.PrintReport(reportSource, printerSettings);

                    //process printed
                    if (!NBConfig.GetGBIDPrintedStaff())
                    {
                        using (sinarekDataSetTableAdapters.gajibulananTableAdapter gb = new sinarekDataSetTableAdapters.gajibulananTableAdapter())
                        {
                            gb.UpdatePrintedStaff(NBConfig.ValidUserName, NBConfig.IGBID);
                        }
                        SetPrintedForms();
                        helper.NotifMessage("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                    }
                }
            }
        }
Esempio n. 27
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //Print Selected Transaction
            //string custtypetoid = radGridView1.SelectedRows[0].Cells["custtypetoid"].Value.ToString();
            string iLogID = radGridView1.SelectedRows[0].Cells["LogID"].Value.ToString();
            //Print
            DialogResult res = MessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptTM rpt = new rptTM();
                rpt.ReportParameters["user"].Value  = NBConfig.ValidUserName;
                rpt.ReportParameters["logid"].Value = lblLogID.Text;
                //rpt.ReportParameters["custtypetoid"].Value = custtypetoid;

                IReportDocument iRpt = (IReportDocument)rpt;
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...

                // Print the report using the printer settings.
                try
                {
                    reportProcessor = new ReportProcessor();
                    reportProcessor.PrintReport(iRpt, printerSettings);

                    using (sinarekDataSetTableAdapters.logproductTableAdapter tbl = new sinarekDataSetTableAdapters.logproductTableAdapter())
                    {
                        tbl.UpdatePrinted(NBConfig.ValidUserName, long.Parse(lblLogID.Text));
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "SMS - Error Notofication");
                }
            }
        }
Esempio n. 28
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            ////On Printing Surat Jalan Make sure after printing surat jalan has been updated too
            ////printed so the next time surat jalan is printing COPY is appended to the title.
            DialogResult res = MessageBox.Show("Print Laporan Stock. Siap kan kertas di printer."
                                               , "Print Laporan Stock"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question
                                               , MessageBoxDefaultButton.Button2
                                               , MessageBoxOptions.DefaultDesktopOnly);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                rptSisaBarang gj = new rptSisaBarang();
                gj.ReportParameters["tanggal"].Value = dtpTanggal.Value;
                gj.ReportParameters["tipeid"].Value  = rddTipe.SelectedValue;
                gj.ReportParameters["User"].Value    = NBConfig.ValidUserName;
                IReportDocument report1 = (IReportDocument)gj;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...
                try
                {
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = report1;

                    // Print the report using the printer settings.
                    ReportProcessor reportProcessor = new ReportProcessor();
                    reportProcessor.PrintReport(reportSource, printerSettings);

                    //print log
                    helper.PrintLog(this.Text, gj.Name, "tanggal:" + dtpTanggal.Value.ToString() +
                                    ",tipeid:" + rddTipe.SelectedValue.ToString());
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Ada masalah untuk print laporan stock. Segera hubungi administrator", "SMS - Error Notification");
                }
            }
        }
Esempio n. 29
0
        /// <summary>
        /// Save Report to a file to a specified location
        /// </summary>
        /// <param name="rptDoc"></param>
        /// <param name="Location"></param>
        internal static void SavedToEXCEL(IReportDocument rptDoc, string Location)
        {
            ReportProcessor      reportProcessor = new ReportProcessor();
            InstanceReportSource reportSource    = new InstanceReportSource();

            reportSource.ReportDocument = rptDoc;
            string    rptName = string.Empty;
            Hashtable htbl    = new Hashtable();

            //set any deviceInfo settings if necessary
            System.Collections.Hashtable deviceInfo             = new System.Collections.Hashtable();
            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("XLS", reportSource, deviceInfo);
            string fileName = result.DocumentName + "." + result.Extension;
            string filePath = System.IO.Path.Combine(Location, fileName);

            using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
            {
                fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            }
        }
Esempio n. 30
0
        private void btnTotalRincian_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("Print Laporan Rincian Total Gaji. Siap kan kertas di printer."
                                               , "Print Laporan Rincian Total Gaji"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question
                                               , MessageBoxDefaultButton.Button2
                                               , MessageBoxOptions.DefaultDesktopOnly);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Print Rincian Summary Gaji
                rptGajiTotal gj = new rptGajiTotal();
                gj.ReportParameters[0].Value      = NBConfig.IGMID;
                gj.ReportParameters["user"].Value = NBConfig.ValidUserName;
                IReportDocument report1 = (IReportDocument)gj;
                ////set parameters when necessary

                //// PrinterSettings
                PrinterSettings printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...
                InstanceReportSource reportSource = new InstanceReportSource();
                reportSource.ReportDocument = report1;
                // Print the report using the printer settings.
                ReportProcessor reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(reportSource, printerSettings);

                //process printed
                if (!NBConfig.GetGMIDPrinted())
                {
                    using (sinarekDataSetTableAdapters.gajimingguanTableAdapter gm = new sinarekDataSetTableAdapters.gajimingguanTableAdapter())
                    {
                        gm.UpdatePrinted(NBConfig.ValidUserName, NBConfig.IGMID);
                    }
                    SetPrintedForms();
                    MessageBox.Show("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                }
            }
        }