コード例 #1
0
        public FrmReportRenderService()
        {
            var cellsFactory = new CellsFactory();

            _headerStyle      = cellsFactory.CreateStyle();
            _tableTitleStyle  = cellsFactory.CreateStyle();
            _tableHeaderStyle = cellsFactory.CreateStyle();
            _tableTotalStyle  = cellsFactory.CreateStyle();
            _tableRowStyle    = cellsFactory.CreateStyle();
            ConfigureStyles();
        }
コード例 #2
0
        protected FrmBaseRenderService(string reportId)
        {
            _reportID = reportId;

            var cellsFactory = new CellsFactory();

            _defaultStyle  = cellsFactory.CreateStyle();
            _dateTimeStyle = cellsFactory.CreateStyle();

            ConfigureStyles();
        }
コード例 #3
0
        private void saveExcel_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
        {
            string name = saveExcel.FileName;
            // Get JSON text
            JObject obj = JObject.Parse(jsonContainer.Text);

            obj.AddFirst(new JProperty("name", rootName));
            string jsonString = "[" + obj.ToString() + "]";

            // Create a Workbook object
            Workbook  workbook  = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Set Styles
            CellsFactory factory = new CellsFactory();
            Style        style   = factory.CreateStyle();

            style.HorizontalAlignment = TextAlignmentType.Center;
            style.Font.Color          = System.Drawing.Color.BlueViolet;
            style.Font.IsBold         = true;

            // Set JsonLayoutOptions
            JsonLayoutOptions options = new JsonLayoutOptions();

            options.ConvertNumericOrDate = true;
            options.TitleStyle           = style;
            options.ArrayAsTable         = true;

            // Import JSON Data
            JsonUtility.ImportData(jsonString, worksheet.Cells, 0, 0, options);

            // Save Excel file
            workbook.Save(@name);
        }
コード例 #4
0
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Instantiating a Workbook object
            Workbook  workbook  = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Read File
            string jsonInput = File.ReadAllText(dataDir + "Test.json");

            // Set Styles
            CellsFactory factory = new CellsFactory();
            Style        style   = factory.CreateStyle();

            style.HorizontalAlignment = TextAlignmentType.Center;
            style.Font.Color          = System.Drawing.Color.BlueViolet;
            style.Font.IsBold         = true;

            // Set JsonLayoutOptions
            JsonLayoutOptions options = new JsonLayoutOptions();

            options.TitleStyle   = style;
            options.ArrayAsTable = true;

            // Import JSON Data
            JsonUtility.ImportData(jsonInput, worksheet.Cells, 0, 0, options);

            // Save Excel file
            workbook.Save(dataDir + "ImportingFromJson.out.xlsx");
            // ExEnd:1
        }
コード例 #5
0
        public FundingSummaryRenderService()
        {
            var cellsFactory = new CellsFactory();

            _defaultStyle            = cellsFactory.CreateStyle();
            _textWrappedStyle        = cellsFactory.CreateStyle();
            _futureMonthStyle        = cellsFactory.CreateStyle();
            _fundingCategoryStyle    = cellsFactory.CreateStyle();
            _fundingSubCategoryStyle = cellsFactory.CreateStyle();
            _fundLineGroupStyle      = cellsFactory.CreateStyle();
            _headerAndFooterStyle    = cellsFactory.CreateStyle();

            ConfigureStyles();
        }
        public DevolvedAdultEducationFundingSummaryReportRenderService()
        {
            var cellsFactory = new CellsFactory();

            _defaultStyle            = cellsFactory.CreateStyle();
            _futureMonthStyle        = cellsFactory.CreateStyle();
            _fundingCategoryStyle    = cellsFactory.CreateStyle();
            _fundingSubCategoryStyle = cellsFactory.CreateStyle();
            _fundLineGroupStyle      = cellsFactory.CreateStyle();
            _headerStyle             = cellsFactory.CreateStyle();
            _footerStyle             = cellsFactory.CreateStyle();

            ConfigureStyles();
        }
コード例 #7
0
        public FundingSummaryReportRenderService()
        {
            var cellsFactory = new CellsFactory();

            _defaultStyle             = cellsFactory.CreateStyle();
            _reportTitleStyle         = cellsFactory.CreateStyle();
            _deliverableGroupStyle    = cellsFactory.CreateStyle();
            _deliverableSubGroupStyle = cellsFactory.CreateStyle();
            _deliverableLineStyle     = cellsFactory.CreateStyle();
            _headerAndFooterStyle     = cellsFactory.CreateStyle();
            _reportMonthlyTotalsStyle = cellsFactory.CreateStyle();

            ConfigureStyles();
        }
コード例 #8
0
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Create a Style object using CellsFactory class
            CellsFactory cf = new CellsFactory();
            Style st = cf.CreateStyle();

            // Set the Style fill color to Yellow
            st.Pattern = BackgroundType.Solid;
            st.ForegroundColor = Color.Yellow;

            // Create a workbook and set its default style using the created Style object
            Workbook wb = new Workbook();
            wb.DefaultStyle = st;

            // Save the workbook
            wb.Save(dataDir + "output_out.xlsx");
            // ExEnd:1
        }
コード例 #9
0
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Create a Style object using CellsFactory class
            CellsFactory cf = new CellsFactory();
            Style        st = cf.CreateStyle();

            // Set the Style fill color to Yellow
            st.Pattern         = BackgroundType.Solid;
            st.ForegroundColor = Color.Yellow;

            // Create a workbook and set its default style using the created Style object
            Workbook wb = new Workbook();

            wb.DefaultStyle = st;

            // Save the workbook
            wb.Save(dataDir + "output_out.xlsx");
            // ExEnd:1
        }
コード例 #10
0
        public static void Run()
        {
            //Output directory
            string outputDir = RunExamples.Get_OutputDirectory();

            // Create a Style object using CellsFactory class
            CellsFactory cf = new CellsFactory();
            Style        st = cf.CreateStyle();

            // Set the Style fill color to Yellow
            st.Pattern         = BackgroundType.Solid;
            st.ForegroundColor = Color.Yellow;

            // Create a workbook and set its default style using the created Style object
            Workbook wb = new Workbook();

            wb.DefaultStyle = st;

            // Save the workbook
            wb.Save(outputDir + "outputUsingCellsFactory.xlsx");

            Console.WriteLine("UsingCellsFactory executed successfully.");
        }