shakeel.faiz May 5, 20180 Comments

Create Chart PDF with Desired Page Size and Rotate Text with Shape using Aspose.Cells for Java 18.4

Create Chart PDF with Desired Page Size and Rotate Text with Shape using Aspose.Cells for Java 18.4

May 5, 2018
Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.Cells for JavaWe are pleased to announce the release of Aspose.Cells for Java 18.4. This release includes many new features and enhancements along with some critical bug fixes that further improve the overall stability of the APIs. We also recommend our clients to use the powerful Aspose for Java APIs directly in their Maven Projects with simple configurations. Please check the release notes in order to get an idea about what is new and what has been fixed with this revision of Aspose.Cells for Java. Here is a look at the major features in this release.

Create Chart PDF with Desired Page Size

You can create chart’s PDF file with your desired page size using Aspose.Cells and specify how you want to align the chart inside the page as top, bottom, center, left, right etc. Besides this, the output chart can be created in stream or on disk. Please see the following article for more detail on this topic.

Rotate Text with Shape inside the Worksheet

You can add text inside any shape using Microsoft Excel. If you add shape using the older Microsoft Excel 2003, then text will not rotate with shape. But if you add shape using newer versions of Microsoft Excel e.g. 2007, 2010, 2013 or 2016 etc. then text will be rotated with shape. You can control if the text should rotate with shape or not using the ShapeTextAlignment.RotateTextWithShape property.

Read/Write TSV (Tab-Separated Values) Files

TSV files are used to contain spreadsheet data but without any formatting. The format is same with Tab Delimited where data is arranged in rows and columns such as tables and spreadsheets. To open tab delimited files, developers should call the LoadOptions method and select the TSV value, predefined in the FileFormatType enumeration. Please see the following sample code and the related article for your reference.

// Creating TSV LoadOptions object.
LoadOptions loadOptions = new LoadOptions(FileFormatType.TSV);

// Creating an Workbook object with TSV text file path and the LoadOptions object.
Workbook workbook = new Workbook("SampleTSVfile.tsv", loadOptions);

// Print success message.
System.out.println("TSV workbook has been opened successfully.");

Get All Hidden Rows Indices after Refreshing AutoFilter

When you apply auto filter on worksheet cells, then some of the rows get hidden automatically. But it might be the case that some of the rows are already hidden manually by MS Excel end user and they are not hidden by auto filter feature. It therefore makes difficult to know which of the rows are hidden by auto filter and which rows are hidden manually by MS Excel end user. Aspose.Cells deals with this problem using the int[] AutoFilter.refresh(boolean hideRows) method. This method returns the row indices of all the rows that are hidden by auto filter and not by manual way in MS Excel.

Avoid Blank Page in Output Pdf when there is Nothing to Print

When the Excel file is empty and user saves it to PDF using Aspose.Cells, it renders blank page in output PDF. Sometime, this default behavior is undesirable. Aspose.Cells provides the PdfSaveOptions.OutputBlankPageWhenNothingToPrint property to deal with this issue. If you will set it as false, then CellsException will occur whenever there is nothing to print in the output PDF.

Find Type of X and Y Values of Points in Chart Series

Sometime, you want to know the type of X and Y values of chart points in a series. Aspose.Cells provides ChartPoint.XValueType and ChartPoint.YValueType properties that can be used for this purpose. Please note, you will have to call Chart.calculate() method before you could use these properties effectively.

Get HTML5 string from Cell

Aspose.Cells returns the HTML string of the cell using the string Cell.getHtmlString (boolean html5) method. If you pass “false” as parameter, it will return you Normal HTML but if you pass “true” as parameter, it will return Html5 string.

Hiding Overlaid Content with CrossHideRight while saving to Html

When you save your MS Excel file to HTML, you can specify different cross types for cell strings. By default, Aspose.Cells generates HTML as per Microsoft Excel but when you change cross type to CrossHideRight then it hides all the strings from the right side of the cell which are overlaid or overlapping with cell string.

Specify the Language of the Excel File using Built In Document Properties

You can change the Language of MS Excel file by right clicking the file and then selecting Properties > Details and then editing the Language field. Please use BuiltInDocumentPropertyCollection.Language property to change it programmatically using Aspose.Cells APIs.

Aspose.Cells for Java Resources

The resources, you may need to accomplish your tasks:

Leave a comment

Posted inAspose.Cells Product Family, Muhammad Shakeel Faiz

Related Articles