Example #1
0
        private void ExportData()
        {
            NZString SlipNo      = new NZString(null, shtDelivery.GetValue(shtDelivery.ActiveRowIndex, (int)eColView.SLIP_NO));
            string   strFileName = GenerateFileName("INV_" + SlipNo.StrongValue);

            string strTemplateFileName = @"Report\TRN090_Invoice_Template.xls";
            string strTemplatePath     = Path.Combine(Application.StartupPath, strTemplateFileName);

            string strExportPath = SaveDialogUtil.GetBrowseFileDialogForExport(strFileName);

            if (!"".Equals(strExportPath))
            {
                DeliveryController ctrl = new DeliveryController();
                DataSet            ds   = new DataSet();
                ds.Tables.Add(ctrl.Load_Invoice(SlipNo));

                ExportUtil.Export(ds, strTemplatePath, strExportPath);


                MessageDialog.ShowInformation(this, null, new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription);

                if (File.Exists(strExportPath))
                {
                    System.Diagnostics.Process.Start(strExportPath);
                }
            }
        }