Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            XtraReport1 report  = new XtraReport1();
            XtraReport2 report2 = new XtraReport2();

            report.CreateDocument(false);
            report2.CreateDocument(false);
            report.ExportToXlsx("test1.xlsx", new DevExpress.XtraPrinting.XlsxExportOptions()
            {
                SheetName = "report1"
            });
            report2.ExportToXlsx("test2.xlsx", new DevExpress.XtraPrinting.XlsxExportOptions()
            {
                SheetName = "report2"
            });

            Workbook workbook = new DevExpress.Spreadsheet.Workbook();

            workbook.LoadDocument("test1.xlsx");

            Workbook workbook2 = new DevExpress.Spreadsheet.Workbook();

            workbook2.LoadDocument("test2.xlsx");

            workbook.Worksheets.Insert(1, "report2");
            workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
            workbook.SaveDocument("test3.xlsx");
            Process.Start("test3.xlsx");
        }
Пример #2
0
        static void Main()
        {
            Workbook workbook = new DevExpress.Spreadsheet.Workbook();

            workbook.ReplaceService <IObjectDataSourceValidationService>(new MyObjectDataSourceValidationService());
            workbook.LoadDocument("EmployeesMailMergeTemplate.xlsx");
            var result = workbook.GenerateMailMergeDocuments();

            result[0].SaveDocument("result.xlsx");
            System.Diagnostics.Process.Start("result.xlsx");
        }
Пример #3
0
        void ProcessExcel(string fileName, Dictionary <int, int> data)
        {
            //fileName = @"C:\Users\Mushfikur Rahman\Downloads\Technical-Adaptive Assessment.xlsx";

            //Microsoft.Office.Interop.Excel.Application excelAppObj = new Microsoft.Office.Interop.Excel.Application();
            //excelAppObj.DisplayAlerts = false;

            //Open the excel work book
            //Microsoft.Office.Interop.Excel.Workbook workBook = excelAppObj.Workbooks.Open(fileName, 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, false, false);

            //Get the first sheet of the selected work book
            //Microsoft.Office.Interop.Excel.Worksheet worksheet = (Microsoft.Office.Interop.Excel.Worksheet)workBook.Worksheets.get_Item(1);
            //ExcelWorkbook workBook = ExcelWorkbook.ReadXLSX(fileName);
            //var worksheet = workBook.Worksheets[0];

            //Book workbook = new BinBook();
            //workbook.load(fileName);


            //var worksheet = workbook.getSheet(0);
            Workbook workbook = new DevExpress.Spreadsheet.Workbook();

            workbook.LoadDocument(fileName);
            Worksheet worksheet = workbook.Worksheets[0];



            //Write 20 in Cell - C3
            //worksheet.Cells[4, 4].Value = txtName.Text;

            //worksheet.Cells[30, 3].Value = txtCompany.Text + ", " + txtEmail.Text;

            //worksheet.writeStr(4, 4, txtName.Text);


            //worksheet.writeStr(30, 3, txtCompany.Text + ", " + txtEmail.Text);


            worksheet.Cells[4, 2].Value = txtName.Text;
            //worksheet.Cells[29, 2].Value = txtCompany.Text + ", " + txtEmail.Text;

            int technical = 0;
            int adaptive  = 0;

            var technicalResult = 0D;
            var adaptiveResult  = 0D;


            var curRow = 6;

            foreach (var item in data)
            {
                if (item.Value == 0)
                {
                    worksheet.Cells[curRow, 3].Value = 1;
                    //technical++;
                }
                //worksheet.writeNum(curRow, 5, 1);
                else if (item.Value == 1)
                {
                    worksheet.Cells[curRow + 1, 3].Value = 1;
                    //adaptive++;
                }
                else if (item.Value == 2)
                {
                    worksheet.Cells[curRow + 2, 3].Value = 1;
                }
                else
                {
                    worksheet.Cells[curRow + 3, 3].Value = 1;
                }
                //worksheet.writeNum(curRow + 1, 5, 1);

                curRow += 4;
            }

            //technicalResult = (technical / 12) * 100;
            //adaptiveResult = (adaptive / 12) * 100;

            //Save work book (.xlsx format)
            //workBook.SaveAs(fileName, Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbook, null, null, false,
            //false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);

            //excelAppObj.Quit();
            //workBook.WriteXLSX(fileName);
            //workbook.save(fileName);

            workbook.AddService(typeof(IChartControllerFactoryService), new ChartControllerFactoryService());
            workbook.AddService(typeof(IChartImageService), new ChartImageService());

            workbook.SaveDocument(fileName);

            var pdfFileName = fileName.Replace(".xlsx", ".pdf");

            workbook.ExportToPdf(pdfFileName);
            Session["ReportFilePath"] = pdfFileName;
            //workbook.ExportToHtml(fileName + ".pdf", 1);

            //Save to downloads//
            var reportID = ins.SaveDownloads(int.Parse(Session["userId"].ToString()), "Leadership Complexities", pdfFileName);

            Session["ReportID"] = reportID;


            string errorFileName = Server.MapPath("~") + @"\Files\Docx\EmailError.txt";

            var res         = 1; Basics.email_send(fileName.Replace(".xlsx", ".pdf"), string.Format("Leadership Complexities Assessment - {0}-{1}", txtName.Text, txtCompany.Text), "Your assessment report is ready to download.", txtEmail.Text, errorFileName);
            var CurrentPage = GetCurrentPageName();

            ins.DeleteHolt(int.Parse(Session["userId"].ToString()), CurrentPage);
            ins.DeleteAnsState(CurrentPage, int.Parse(Session["userId"].ToString()));
            if (res == 1)
            {
                Response.Redirect("Home.aspx");
            }
            else
            {
                Response.Redirect("Error.aspx");
            }
        }
        void ProcessExcel(string fileName, Dictionary <int, int> data)
        {
            //fileName = @"C:\Users\Mushfikur Rahman\Downloads\Technical-Adaptive Assessment.xlsx";

            //Microsoft.Office.Interop.Excel.Application excelAppObj = new Microsoft.Office.Interop.Excel.Application();
            //excelAppObj.DisplayAlerts = false;

            //Open the excel work book
            //Microsoft.Office.Interop.Excel.Workbook workBook = excelAppObj.Workbooks.Open(fileName, 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, false, false);

            //Get the first sheet of the selected work book
            //Microsoft.Office.Interop.Excel.Worksheet worksheet = (Microsoft.Office.Interop.Excel.Worksheet)workBook.Worksheets.get_Item(1);
            //ExcelWorkbook workBook = ExcelWorkbook.ReadXLSX(fileName);
            //var worksheet = workBook.Worksheets[0];

            //Book workbook = new BinBook();
            //workbook.load(fileName);


            //var worksheet = workbook.getSheet(0);
            Workbook workbook = new DevExpress.Spreadsheet.Workbook();

            workbook.LoadDocument(fileName);
            Worksheet worksheet = workbook.Worksheets[0];


            //Write 20 in Cell - C3
            //worksheet.Cells[4, 4].Value = txtName.Text;

            //worksheet.Cells[30, 3].Value = txtCompany.Text + ", " + txtEmail.Text;

            //worksheet.writeStr(4, 4, txtName.Text);


            //worksheet.writeStr(30, 3, txtCompany.Text + ", " + txtEmail.Text);


            worksheet.Cells[3, 3].Value  = txtName.Text;
            worksheet.Cells[29, 2].Value = txtCompany.Text + ", " + txtEmail.Text;

            int technical = 0;
            int adaptive  = 0;

            var technicalResult = 0D;
            var adaptiveResult  = 0D;


            var curRow = 5;

            foreach (var item in data)
            {
                if (item.Value == 0)
                {
                    worksheet.Cells[curRow, 4].Value = 1;
                    technical++;
                }
                //worksheet.writeNum(curRow, 5, 1);
                else
                {
                    worksheet.Cells[curRow + 1, 4].Value = 1;
                    adaptive++;
                }
                //worksheet.writeNum(curRow + 1, 5, 1);

                curRow += 2;
            }

            technicalResult = (technical / 12) * 100;
            adaptiveResult  = (adaptive / 12) * 100;

            //Save work book (.xlsx format)
            //workBook.SaveAs(fileName, Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbook, null, null, false,
            //false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);

            //excelAppObj.Quit();
            //workBook.WriteXLSX(fileName);
            //workbook.save(fileName);
            workbook.SaveDocument(fileName);

            workbook.ExportToPdf(fileName + ".pdf");

            var res = Basics.email_send(fileName, string.Format("Technical Adaptive Assessment Submission - {0}-{1}", txtName.Text, txtCompany.Text), "A new assessment has been submitted.");

            if (res == 1)
            {
                Response.Redirect("Home.aspx");
            }
            else
            {
                Response.Redirect("Error.aspx");
            }
        }
Пример #5
0
        protected void comboReports_SelectedIndexChanged(object sender, EventArgs e)
        {
            var SelectedReport = comboReports.Value.ToString();

            if (SelectedReport == "rep_pro_essa")
            {
                MemoryStream reportStream1 = new MemoryStream();
                MemoryStream reportStream2 = new MemoryStream();
                MemoryStream reportStream3 = new MemoryStream();
                MemoryStream reportStream4 = new MemoryStream();

                XtraReport ReportObject1 = common_services.GetSourcedReport("rep_pro_essa1");
                ReportObject1.ExportToXlsx(reportStream1, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = "BA-Scorecard"
                });

                XtraReport ReportObject2 = common_services.GetSourcedReport("rep_pro_essa2");
                ReportObject2.ExportToXlsx(reportStream2, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = "IA-Scorecard"
                });

                XtraReport ReportObject3 = common_services.GetSourcedReport("rep_pro_essa3");
                ReportObject3.ExportToXlsx(reportStream3, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = "TA-Scorecard"
                });

                XtraReport ReportObject4 = common_services.GetSourcedReport("rep_pro_essa4");
                ReportObject4.ExportToXlsx(reportStream4, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = "S&C Scorecard"
                });

                Workbook workbook = new DevExpress.Spreadsheet.Workbook();
                workbook.LoadDocument(reportStream1);

                Workbook workbook2 = new DevExpress.Spreadsheet.Workbook();
                workbook2.LoadDocument(reportStream2);

                Workbook workbook3 = new DevExpress.Spreadsheet.Workbook();
                workbook3.LoadDocument(reportStream3);

                Workbook workbook4 = new DevExpress.Spreadsheet.Workbook();
                workbook4.LoadDocument(reportStream4);

                workbook.Worksheets.Insert(1, "IA-Scorecard");
                workbook.Worksheets.Insert(2, "TA-Scorecard");
                workbook.Worksheets.Insert(3, "S&C Scorecard");
                workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);

                MemoryStream st = new MemoryStream();
                workbook.SaveDocument(st, DocumentFormat.Xlsx);

                Response.Clear();
                Response.ContentType = "application/force-download";
                Response.AddHeader("content-disposition", "attachment; filename=Scorecard_Templates_Ohio2015SS-A.xlsx");
                Response.BinaryWrite(st.ToArray());
                Response.End();

                reportViewer.OpenReport(ReportObject1);
            }
            else if (SelectedReport == "rep_pro_cms_checlist")
            {
                var projectId = System.Web.HttpContext.Current.Session["projectID"].ToString();

                comboChecklistName.DataSource = rtm_services.GetRTMCheckList(projectId);
                comboChecklistName.DataBind();
                comboChecklistName.Visible = true;
            }


            else
            {
                comboChecklistName.Visible = false;
                comboChecklistName.Value   = null;
                XtraReport ReportObject = common_services.GetSourcedReport(SelectedReport, null, null, null, Page.Request);

                reportViewer.OpenReport(ReportObject);
            }
        }
Пример #6
0
        protected void comboChecklistName_SelectedIndexChanged(object sender, EventArgs e)
        {
            string path         = null;
            string guidancepath = null;
            string MITApath     = null;
            string report       = comboReports.SelectedItem.ToString();
            string reportname   = comboReports.Value.ToString();

            if (reportname == "rep_pro_cms_checlist")
            {
                string       SelectedChecklisID = comboChecklistName.Value.ToString();
                string       SelecteChecklist   = comboChecklistName.Text.ToString();
                string       checklist          = SelectedChecklisID;
                MemoryStream reportStream5      = new MemoryStream();
                MemoryStream reportStream6      = new MemoryStream();
                //MemoryStream reportStream7 = new MemoryStream();
                //MemoryStream reportStream8 = new MemoryStream();

                XtraReport ReportObject1 = common_services.GetSourcedReport("rep_pro_cms_checlist", checklist);
                ReportObject1.ExportToXlsx(reportStream5, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = SelecteChecklist
                });

                XtraReport ReportObject2 = common_services.GetSourcedReport("rep_pro_cms_checklist_criticalsuccessfactors", checklist);
                ReportObject2.ExportToXlsx(reportStream6, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = "Critical Success Factor"
                });

                Workbook workbook  = new DevExpress.Spreadsheet.Workbook();
                Workbook workbook2 = new DevExpress.Spreadsheet.Workbook();
                Workbook workbook3 = new DevExpress.Spreadsheet.Workbook();
                Workbook workbook4 = new DevExpress.Spreadsheet.Workbook();
                Workbook workbook5 = new DevExpress.Spreadsheet.Workbook();

                switch (SelecteChecklist)
                {
                case "Provider Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Provider Management Checklist.xlsx");

                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "2.2 Standards and Conditions":
                    path         = Server.MapPath(@"~/Content/SpreadSheetTemplate/Standards and Conditions.xlsx");
                    guidancepath = Server.MapPath("~/Content/SpreadSheetTemplate/Guidance Standards and Conditions.xlsx");
                    MITApath     = Server.MapPath("~/Content/SpreadSheetTemplate/MITA Business Process Access and Delivery.xlsx");

                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(guidancepath);
                    workbook4.LoadDocument(MITApath);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "MITA Business Processes");
                    workbook.Worksheets.Insert(3, "Guidance");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                    workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);

                    break;

                case "Integration and Utility":
                    path         = Server.MapPath(@"~/Content/SpreadSheetTemplate/Integration and Utility.xlsx");
                    guidancepath = Server.MapPath("~/Content/SpreadSheetTemplate/Guidance Integration and Utility.xlsx");
                    MITApath     = Server.MapPath("~/Content/SpreadSheetTemplate/MITA Business Process Access and Delivery.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(guidancepath);
                    workbook4.LoadDocument(MITApath);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "MITA Business Processes");
                    workbook.Worksheets.Insert(3, "Guidance");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                    workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);
                    break;

                case "Plan Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Plan Management.xlsx");

                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "Information Architecture":
                    path         = Server.MapPath(@"~/Content/SpreadSheetTemplate/Information Architure Checklist.xlsx");
                    guidancepath = Server.MapPath("~/Content/SpreadSheetTemplate/Guidance Inforamtion Achitecture.xlsx");
                    MITApath     = Server.MapPath("~/Content/SpreadSheetTemplate/MITA Business Process Access and Delivery.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(guidancepath);
                    workbook4.LoadDocument(MITApath);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "MITA Business Processes");
                    workbook.Worksheets.Insert(3, "Guidance");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                    workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);

                    break;

                case "Contractor Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Contractor Management Checklist.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "Member Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Member Management.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "Care Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/CMS_CareManagement.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "Operations Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Operations Management.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "Financial Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Financial Management Checklist.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "Access and Delivery":
                    path         = Server.MapPath(@"~/Content/SpreadSheetTemplate/Access and Delivery Checklist.xlsx");
                    guidancepath = Server.MapPath("~/Content/SpreadSheetTemplate/Guidance Access and Delivery.xlsx");
                    MITApath     = Server.MapPath("~/Content/SpreadSheetTemplate/MITA Business Process Access and Delivery.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(guidancepath);
                    workbook4.LoadDocument(MITApath);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "MITA Business Processes");
                    workbook.Worksheets.Insert(3, "Guidance");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                    workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);
                    break;

                case "Intermediary and Interface":
                    path         = Server.MapPath(@"~/Content/SpreadSheetTemplate/Intermediary and Interface.xlsx");
                    guidancepath = Server.MapPath("~/Content/SpreadSheetTemplate/Guidance Intermediary and Interface.xlsx");
                    MITApath     = Server.MapPath("~/Content/SpreadSheetTemplate/MITA Business Process Access and Delivery.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(guidancepath);
                    workbook4.LoadDocument(MITApath);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "MITA Business Processes");
                    workbook.Worksheets.Insert(3, "Guidance");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                    workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);
                    break;

                case "Performance Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Performance Management.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);

                    break;

                case "Standards and Conditions":
                    path         = Server.MapPath(@"~/Content/SpreadSheetTemplate/Standards and Conditions.xlsx");
                    guidancepath = Server.MapPath("~/Content/SpreadSheetTemplate/Guidance Standards and Conditions.xlsx");
                    MITApath     = Server.MapPath("~/Content/SpreadSheetTemplate/MITA Business Process Access and Delivery.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(guidancepath);
                    workbook4.LoadDocument(MITApath);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "MITA Business Processes");
                    workbook.Worksheets.Insert(3, "Guidance");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                    workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);

                    break;

                case "Eligibility and Enrollment":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Eligibility and Enrollment Management.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
                    break;

                case "Business Relationship Management":
                    path = Server.MapPath(@"~/Content/SpreadSheetTemplate/Eligibility and Enrollment Management.xlsx");
                    workbook.LoadDocument(path);
                    workbook2.LoadDocument(reportStream5);
                    workbook3.LoadDocument(reportStream6);
                    workbook.Worksheets.Insert(1, SelecteChecklist);
                    workbook.Worksheets.Insert(2, "Critical Success Factor");

                    workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                    workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);


                    break;
                }



                MemoryStream st = new MemoryStream();
                workbook.SaveDocument(st, DocumentFormat.Xlsx);
                var    state    = System.Web.HttpContext.Current.Session["EnterpriseName"].ToString();
                string filename = SelecteChecklist + " Checklist (MITA Module)" + state + ".xlsx";
                Response.Clear();
                Response.ContentType = "application/force-download";
                Response.AddHeader("content-disposition", "attachment; filename=" + filename);
                Response.BinaryWrite(st.ToArray());


                Response.End();
                reportViewer.OpenReport(ReportObject1);
            }
            else
            {
                comboChecklistName.Visible = false;
                comboChecklistName.Value   = null;
            }
        }
Пример #7
0
        protected void button2_Click(object sender, EventArgs e)
        {
            rep_pro_essa1 report  = new rep_pro_essa1();
            rep_pro_essa2 report2 = new rep_pro_essa2();
            rep_pro_essa3 report3 = new rep_pro_essa3();
            rep_pro_essa4 report4 = new rep_pro_essa4();

            report.CreateDocument(false);
            report2.CreateDocument(false);

            //report.DataSource = common_services.GetSourcedReport("rep_pro_essa1");

            MemoryStream reportStream1 = new MemoryStream();
            MemoryStream reportStream2 = new MemoryStream();
            MemoryStream reportStream3 = new MemoryStream();
            MemoryStream reportStream4 = new MemoryStream();

            report.ExportToXlsx(reportStream1, new DevExpress.XtraPrinting.XlsxExportOptions()
            {
                SheetName = "BA-Scorecard"
            });
            report2.ExportToXlsx(reportStream2, new DevExpress.XtraPrinting.XlsxExportOptions()
            {
                SheetName = "IA-Scorecard"
            });
            report3.ExportToXlsx(reportStream3, new DevExpress.XtraPrinting.XlsxExportOptions()
            {
                SheetName = "TA-Scorecard"
            });
            report4.ExportToXlsx(reportStream4, new DevExpress.XtraPrinting.XlsxExportOptions()
            {
                SheetName = "S&C Scorecard"
            });

            Workbook workbook = new DevExpress.Spreadsheet.Workbook();

            workbook.LoadDocument(reportStream1);

            Workbook workbook2 = new DevExpress.Spreadsheet.Workbook();

            workbook2.LoadDocument(reportStream2);

            Workbook workbook3 = new DevExpress.Spreadsheet.Workbook();

            workbook3.LoadDocument(reportStream3);

            Workbook workbook4 = new DevExpress.Spreadsheet.Workbook();

            workbook4.LoadDocument(reportStream4);

            workbook.Worksheets.Insert(1, "IA-Scorecard");
            workbook.Worksheets.Insert(2, "TA-Scorecard");
            workbook.Worksheets.Insert(3, "S&C Scorecard");
            workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
            workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);
            workbook.Worksheets[3].CopyFrom(workbook4.Worksheets[0]);
            //workbook.SaveDocument("C:/Users/Mohan Babu/Desktop/ReadycertXLS/Scorecard_Templates_Ohio2015SS-A.xlsx");
            MemoryStream st = new MemoryStream();

            workbook.SaveDocument(st, DocumentFormat.Xlsx);

            Response.Clear();
            Response.ContentType = "application/force-download";
            Response.AddHeader("content-disposition", "attachment; filename=Scorecard_Templates_Ohio2015SS-A.xlsx");
            Response.BinaryWrite(st.ToArray());
            Response.End();
            //System.Diagnostics.Process.Start("C:/Users/Mohan Babu/Desktop/ReadycertXLS/Scorecard_Templates_Ohio2015SS-A.xlsx");
        }
Пример #8
0
        protected void comboIVV_SelectedIndexChanged(object sender, EventArgs e)
        {
            string SelectedReport = comboReports.Value.ToString();

            if (SelectedReport == "rep_pro_ivv_progress")
            {
                string SelectedID       = comboIVV.Value.ToString();
                string SelecteChecklist = comboIVV.Text.ToString();
                string StateProject     = SelectedID;



                MemoryStream reportStream1 = new MemoryStream();
                MemoryStream reportStream2 = new MemoryStream();

                XtraReport ReportObject1 = common_services.GetSourcedReport("rep_pro_ivv_progress", StateProject);
                ReportObject1.ExportToXlsx(reportStream1, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = "IV&V"
                });

                XtraReport ReportObject2 = common_services.GetSourcedReport("rep_pro_ivv_checklist_rtm");
                ReportObject2.ExportToXlsx(reportStream2, new DevExpress.XtraPrinting.XlsxExportOptions()
                {
                    SheetName = "Programmatic"
                });

                Workbook workbook = new DevExpress.Spreadsheet.Workbook();
                workbook.LoadDocument(reportStream1);

                Workbook workbook2 = new DevExpress.Spreadsheet.Workbook();
                workbook2.LoadDocument(reportStream2);

                var      path      = Server.MapPath(@"~/Content/SpreadSheetTemplate/IVV CMS Response.xlsx");
                Workbook workbook3 = new DevExpress.Spreadsheet.Workbook();
                workbook3.LoadDocument(path);



                workbook.Worksheets.Insert(1, "Programmatic");
                workbook.Worksheets.Insert(2, "CMS Response");

                workbook.Worksheets[1].CopyFrom(workbook2.Worksheets[0]);
                workbook.Worksheets[2].CopyFrom(workbook3.Worksheets[0]);


                MemoryStream st = new MemoryStream();
                workbook.SaveDocument(st, DocumentFormat.Xlsx);
                var    state    = System.Web.HttpContext.Current.Session["EnterpriseName"].ToString();
                string filename = " 05 MECT 2_2 Appendix D_MMIS IVV Progress Report Template.xlsx";
                Response.Clear();
                Response.ContentType = "application/force-download";
                Response.AddHeader("content-disposition", "attachment; filename=" + filename);
                Response.BinaryWrite(st.ToArray());


                Response.End();

                reportViewer.OpenReport(ReportObject1);
            }

            else
            {
                comboIVV.Visible = false;
                comboIVV.Value   = null;
            }
        }