コード例 #1
0
        private void ExportBtn_Click(object sender, RoutedEventArgs e)
        {
            List <TrialBalanceExport> statements = new List <TrialBalanceExport>();

            // statements.Add(new TrialBalanceExport { column1 = "Revenues" });
            foreach (TrialBalanceVm item in d1.Items)
            {
                statements.Add(new TrialBalanceExport
                {
                    Account = item.LedgerAccountName,
                    Debit   = item.DebitSide == 0 ? "" : item.DebitSide.ToString(),
                    Credit  = item.CreditSide == 0 ? "" : item.CreditSide.ToString()
                });
            }
            foreach (TrialBalanceVm item in d2.Items)
            {
                statements.Add(new TrialBalanceExport
                {
                    Account = item.LedgerAccountName,
                    Debit   = item.DebitSide == 0 ? "" : item.DebitSide.ToString(),
                    Credit  = item.CreditSide == 0 ? "" : item.CreditSide.ToString()
                });
            }

            if (statements.Count < 1)
            {
                MessageBox.Show("Get Trial Balance First");
                return;
            }
            EvanDangol.Reporting.ExportToExcel <TrialBalanceExport, List <TrialBalanceExport> > report = new EvanDangol.Reporting.ExportToExcel <TrialBalanceExport, List <TrialBalanceExport> >();
            report.dataToPrint = statements;
            report.GenerateReport("Trial Balance as of " + ((FinanceViewModel)DataContext).FromTrialBalanceDate.ToLongDateString(), "Trial Balance");
        }
コード例 #2
0
        private void ExportBtn_Click(object sender, RoutedEventArgs e)
        {
            List <IncomeStatementExport> statements = new List <IncomeStatementExport>();

            statements.Add(new Accounts.IncomeStatementExport {
                AccountType = "REVENUE"
            });
            foreach (RevenueVm item in d2.Items)
            {
                statements.Add(new Accounts.IncomeStatementExport {
                    Account = item.LedgerAccountName, Balance = item.Amount.ToString()
                });
            }
            foreach (RevenueVm item in d3.Items)
            {
                statements.Add(new Accounts.IncomeStatementExport {
                    TotalHeading = item.LedgerAccountName, Total = item.Amount.ToString()
                });
            }
            statements.Add(new Accounts.IncomeStatementExport {
                AccountType = "EXPENSE"
            });
            foreach (ExpenseVm item in d5.Items)
            {
                statements.Add(new Accounts.IncomeStatementExport {
                    Account = item.LedgerAccountName, Balance = item.Amount.ToString()
                });
            }
            foreach (ExpenseVm item in d6.Items)
            {
                statements.Add(new Accounts.IncomeStatementExport {
                    TotalHeading = item.LedgerAccountName, Total = item.Amount.ToString()
                });
            }
            //  statements.Add(new Accounts.IncomeStatementExport { column1 = "Net Income" });
            foreach (NetIncome item in d8.Items)
            {
                statements.Add(new Accounts.IncomeStatementExport {
                    TotalHeading = "Net Income", Total = item.Amount.ToString()
                });
            }

            EvanDangol.Reporting.ExportToExcel <IncomeStatementExport, List <IncomeStatementExport> > report = new EvanDangol.Reporting.ExportToExcel <IncomeStatementExport, List <IncomeStatementExport> >();
            report.dataToPrint = statements;
            report.GenerateReport("Income Statement as of " + ((FinanceViewModel)DataContext).IncomeStatementDate.ToLongDateString(), "Income Statement");
        }
コード例 #3
0
        private void ExportBtn_Click(object sender, RoutedEventArgs e)
        {
            List <BalanceSheetExport> statements = new List <BalanceSheetExport>();

            statements.Add(new BalanceSheetExport {
                AccountType = "ASSETS"
            });
            foreach (AssetsVm item in d2.Items)
            {
                statements.Add(new BalanceSheetExport {
                    Account = item.LedgerAccountName, Balance = item.Amount.ToString()
                });
            }
            foreach (AssetsVm item in d3.Items)
            {
                statements.Add(new BalanceSheetExport {
                    TotalHeading = item.LedgerAccountName, Total = item.Amount.ToString()
                });
            }
            statements.Add(new BalanceSheetExport {
                AccountType = "LIABILITIES"
            });
            foreach (LiabilitiesVm item in d5.Items)
            {
                statements.Add(new BalanceSheetExport {
                    Account = item.LedgerAccountName, Balance = item.Amount.ToString()
                });
            }
            foreach (LiabilitiesVm item in d6.Items)
            {
                statements.Add(new BalanceSheetExport {
                    TotalHeading = item.LedgerAccountName, Total = item.Amount.ToString()
                });
            }
            statements.Add(new BalanceSheetExport {
                AccountType = "EQUITY"
            });
            foreach (EquityVm item in d8.Items)
            {
                statements.Add(new BalanceSheetExport {
                    Account = item.LedgerAccountName, Balance = item.Amount.ToString()
                });
            }
            foreach (EquityVm item in d9.Items)
            {
                statements.Add(new BalanceSheetExport {
                    TotalHeading = item.LedgerAccountName, Total = item.Amount.ToString()
                });
            }
            statements.Add(new BalanceSheetExport {
                AccountType = "LIABILITIES AND EQUITY"
            });
            foreach (LiabilitiesAndEquity item in d11.Items)
            {
                statements.Add(new BalanceSheetExport {
                    TotalHeading = "Total", Total = item.Amount.ToString()
                });
            }
            EvanDangol.Reporting.ExportToExcel <BalanceSheetExport, List <BalanceSheetExport> > report = new EvanDangol.Reporting.ExportToExcel <BalanceSheetExport, List <BalanceSheetExport> >();
            report.dataToPrint = statements;
            report.GenerateReport("Balance Sheet", "Balance Sheet");
        }