Example #1
0
 protected void XuCalculate_Click(object sender, EventArgs e)
 {
     XmReadGui();
     XpCalculationService.Init(XpLoanSettings);
     XpCalculationService.CalculateLoan();
     XpLoanCalculations = XpCalculationService.LoanCalculations;
     XmFillGui();
 }
Example #2
0
        protected void XuExport_Click(object sender, EventArgs e)
        {
            XmReadGui();
            XpCalculationService.Init(XpLoanSettings);
            XpCalculationService.CalculateLoan();
            XpLoanCalculations = XpCalculationService.LoanCalculations;


            var outputStream = new StreamWriter(Response.OutputStream);

            try
            {
                Response.Clear();
                Response.ClearHeaders();
                Response.ClearContent();

                Response.AddHeader("content-disposition"
                                   , string.Format(
                                       "attachment; filename={0}.xml"
                                       , @"Betalingsforløb"
                                       ));
                Response.AddHeader("Pragma", "public");
                Response.ContentType     = "application/vnd.ms-excel";
                Response.ContentEncoding = System.Text.Encoding.UTF8;

                XpExportService.Init();
                XpExportService.Convert(outputStream, XpCalculationService.PaymentPlan.PaymentDetailList);

                Response.End();
            }

            catch (Exception)
            {
                // no action
            }
        }