Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
This release of Aspose.Cells for .NET API has exposed two new overloads of the SheetRender.ToImage method that now allows accepting an instance of System.Drawing.Graphics class to render in Graphics context. The signatures of the newly added methods are as follows.
SheetRender.ToImage(int pageIndex, Graphics g, float x, float y)SheetRender.ToImage(int pageIndex, Graphics g, float x, float y, float width, float height)Following is the simple usage scenario.
C#
// Create workbook object from source file
Workbook workbook = new Workbook(filePath);
// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Create empty Bitmap
Bitmap bmp = new Bitmap(800, 800);
// Create Graphics context
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.Blue);
// Set OnePagePerSheet to true in image or print options
ImageOrPrintOptions opts = new ImageOrPrintOptions();
opts.OnePagePerSheet = true;
// Render worksheet to graphics context
SheetRender sr = new SheetRender(worksheet, opts);
sr.ToImage(0, g, 0, 0);
// Save the graphics‑context image in PNG format
bmp.Save("test.png", ImageFormat.Png);
Aspose.Cells for .NET 8.5.2 has exposed the PivotTable.GetCellByDisplayName method that can be used to retrieve the Cell object by the name of the PivotField. This method could be useful in scenarios where you wish to highlight or format the PivotField header.
Following is the simple usage scenario.
C#
// Create workbook object from source Excel file
Workbook workbook = new Workbook(filePath);
// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Access first pivot table inside the worksheet
PivotTable pivotTable = worksheet.PivotTables[0];
// Access cell by display name of the 2nd data field of the pivot table
Cell cell = pivotTable.GetCellByDisplayName(pivotTable.DataFields[1].DisplayName);
// Access cell style and set its fill color and font color
Style style = cell.GetStyle();
style.ForegroundColor = Color.LightBlue;
style.Font.Color = Color.Black;
// Set the style of the cell
pivotTable.Format(cell.Row, cell.Column, style);
// Save workbook
workbook.Save("output.xlsx");
Aspose.Cells for .NET 8.5.2 has exposed the SaveOptions.MergeAreas property that can accept a Boolean value. The default value is false; however, if set to true, the Aspose.Cells for .NET API tries to merge the individual CellAreas before saving the file.
SaveOptions.MergeAreas property to direct the API to auto‑merge the CellAreas before the save operation.
With the release of v8.5.2, the Aspose.Cells API has exposed the Shape.Geometry.ShapeAdjustValues property that can be used to make changes to the adjustment points of different shapes.
For instance,
Here is the simplest usage scenario.
C#
// Create workbook object from source Excel file
Workbook workbook = new Workbook(filePath);
// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Access first three shapes of the worksheet
Shape shape1 = worksheet.Shapes[0];
Shape shape2 = worksheet.Shapes[1];
Shape shape3 = worksheet.Shapes[2];
// Change the adjustment values of the shapes
shape1.Geometry.ShapeAdjustValues[0].Value = 0.5d;
shape2.Geometry.ShapeAdjustValues[0].Value = 0.8d;
shape3.Geometry.ShapeAdjustValues[0].Value = 0.5d;
// Save the workbook
workbook.Save("output.xls");
Aspose.Cells for .NET 8.5.2 has exposed the ConsolidationFunction.DistinctCount field that can be used to apply the Distinct Count consolidation function on a DataField of a PivotTable.
This release of Aspose.Cells.GridDesktop has exposed four new events. Two of these events trigger on different states of loading spreadsheet files in GridDesktop, whereas the other two trigger upon calculation of formulas.
The events are listed as follows.
GridDesktop.BeforeLoadFileGridDesktop.FinishLoadFileGridDesktop.BeforeCalculateGridDesktop.FinishCalculateAnalyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.