Ejemplo n.º 1
0
        private void ExportMatrixData()
        {
            WfMatrix matrix = WfMatrixAdapter.Instance.Load(this.ExportKey);

            matrix.Loaded = true;

            switch (this.ExFormat)
            {
            case ExportFormat.Xlsx:
                Response.Clear();
                Response.ClearHeaders();
                using (MemoryStream fileSteam = matrix.ExportToExcel2007(this.RoleAsPerson))
                {
                    fileSteam.CopyTo(Response.OutputStream);
                }
                //Response.BinaryWrite(bytes);
                //Response.ContentType = MediaTypeNames.Text.Xml;
                Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                Response.AppendHeader("CONTENT-DISPOSITION", "attachment;filename=" + matrix.ProcessKey + ".xlsx");
                Response.Flush();
                Response.End();
                break;

            case ExportFormat.Xml:
                WorkbookNode workbook = matrix.ExportToExcelXml(this.RoleAsPerson);
                workbook.Response(matrix.ProcessKey);
                break;
            }
        }
Ejemplo n.º 2
0
        protected void generateMatrixButton_Click(object sender, EventArgs e)
        {
            WfMatrix matrix = CreateMatrix();

            WorkbookNode workbook = matrix.ExportToExcelXml(false);

            workbook.Response("Matrix");
        }