Autofit Rows for Merged Cells using Aspose.Cells for .NET v19.3

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Aspose.Cells for .NET logoGuys, are you ready? Before we dive into its details: I want you to get an essence of the public release. I am giving you little preview of the new features and other enhancements available in the release for quick reference. I guess you know the valuable usage of MS Excel’s auto-fit rows/cols feature. Yet, you are one step ahead and perform the operation on merged cells by Aspose.Cells. While working in MS Excel IDE, you might not dislike formatted Tables but sometimes you need to convert to raw range. Here comes the library to accomplish these tasks via the APIs. Some of you might also like importing from JSON. So let’s not wait another moment to review the release notes. Do you want to know all exciting features and other enhancements? Here you go.

Autofit Rows for Merged Cells

Autofitting rows is a very common operation which you perform while working with the Excel files. This feature was already there in Aspose.Cells API however many people asked for more control over this operation. To fulfill this requirement we have provided AutoFitMergedCellsType enumerator which contains the following options:

  • None: Ignore merged cells.
  • FirstLine: Only expands the height of the first row.
  • LastLine: Only expands the height of the last row.
  • EachLine: Expands the height of each row.

Here is a snapshot of this feature where the effect of one of the options EechLine is shown.

You can test this feature using following sample code.

For more details on this topic please visit here.

Convert table to range with Options

Conversion of the table to a range was available earlier. However what if you want to control the formatting of destination range like formatting only the partial output. The good news is that this feature is available now and you don’t need to write extra code to format the output range. We have introduced a new class TableToRangeOptions where LastRow property is available to set the last row to which formatting is copied from the source table. Here is the view of a sample table and converted range which is formatted up to row 5.

Here is a sample code which is used to create the above range.

For detailed information on conversions follow this link.

Import data from JSON

As you know that JavaScript Object Notation is a common data interchange format which is quite lightweight and can be read by human and machines easily. Now, for example, you get data from some Web API in JSON format and need it to be imported into some Excel file, then Aspose.Cells is there to provide this facility.

JSONUtility class is introduced by Aspose.Cells for this purpose having ImportData method that not only imports data but also performs different conversions and formatting using the JsonLayoutOptions object during the import process. You may try this exciting feature by following article Importing Data from JSON. Here is a sample code to use this feature:

You can see that result is cool as fully formatted Excel file is created without using any extra code to parse the JSON string from any source like Web API. Isn’t it? For example, if you get the following string from Web API, then output Excel file is shown in the image below:

[{“color”: “red”,”value”: “#f00”},{“color”: “green”,”value”: “#0f0”},{“color”: “blue”,”value”: “#00f”},{“color”: “cyan”,”value”: “#0ff”},{“color”: “magenta”,”value”: “#f0f”},{“color”: “yellow”,”value”:”#ff0″},{“color”: “black”,”value”: “#000”}]

Get Range with External Links

Microsoft Excel supports external links for fetching data from different sources. We have provided the option to retrieve these links from the Excel file using Name.GetRefferedAreas method. This method returns ReferredArea which has many useful properties as follows:

  • EndColumn: The end column of the area
  • EndRow: The end row of the area
  • ExternalFileName: Get the external file name if this is an external reference
  • IsArea: Indicates whether this is an area
  • IsExternalLink: Indicates whether this is an external link
  • SheetName: Indicates which sheet this reference is in
  • StartColumn: The start column of the area
  • StartRow: The start row of the area

You may find details on how to get range with external links for your reference. In the following example, an external file having named range “Names” is linked with the Excel file. We can access this named range in the linked file and display its properties mentioned above.

Keep separators for blank rows during spreadsheet to CSV

Many times you convert the Excel sheets to CSV for using it in some other environment or applications. You may need to decide yourself about the separators for blank rows in the spreadsheet while exporting it to CSV. For example, there is a blank row in the source spreadsheet and you want either a blank row in the CSV or have a row with predefined separators. We have provided this feature now and you can get details about this feature here.

For better understanding, have a look at the following image which shows the result of this feature.

Following is a sample code which demonstrates this new feature.

To use these useful features and avail other enhancements, I recommend you to try the release Aspose.Cells for .NET v19.3. And, if you have more time, browse Developers’ Guide for your complete reference on what you can deliver using the rendering extension API. You are always welcome to share your review, concerns or feedback on forums.

Posted in Aspose.Cells Product Family | Leave a comment

Import Data from JSON using Aspose.Cells for Java 19.3

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Big smiles as I am here to announce the release of the latest version of Aspose.Cells for Java. In this post, I am going to give you a glimpse of all the new exciting features for best utilization of the API along with the improvements and fixes. Links to the relevant articles and resources will also be available for quick reference. So let us start reviewing what is there in this release.

Import data from JSON

As you know that JavaScript Object Notation is a common data interchange format which is quite lightweight and can be read by human and machines easily. Now, for example, you get data from some Web API in JSON format and need it to be imported into some Excel file, then Aspose.Cells is there to provide this facility.

JSONUtility class is introduced by Aspose.Cells for this purpose having ImportData method that not only imports data but also performs different conversions and formatting using the JsonLayoutOptions object during the import process. You may try this exciting feature by following article Importing Data from JSON. Here is a sample code to use this feature:

You can see that result is cool as fully formatted Excel file is created without using any extra code to parse the JSON string from any source like Web API. Isn’t it? For example, if you get the following string from Web API, then output Excel file is shown in the image below:

[{“color”: “red”,”value”: “#f00”},{“color”: “green”,”value”: “#0f0”},{“color”: “blue”,”value”: “#00f”},{“color”: “cyan”,”value”: “#0ff”},{“color”: “magenta”,”value”: “#f0f”},{“color”: “yellow”,”value”:”#ff0″},{“color”: “black”,”value”: “#000”}]

Convert table to range with Options

Conversion of the table to a range was available earlier. However what if you want to control the formatting of destination range like formatting only the partial output. The good news is that this feature is available now and you don’t need to write extra code to format the output range. We have introduced a new class TableToRangeOptions where LastRow property is available to set the last row to which formatting is copied from the source table. Here is the view of a sample table and converted range which is formatted up to row 5.

Here is a sample code which is used to create the above range.

For detailed information on conversions follow this link.

Get Range with External Links

Microsoft Excel supports external links for fetching data from different sources. We have provided the option to retrieve these links from the Excel file using Name.GetRefferedAreas method. This method returns ReferredArea which has many useful properties as follows:

In the following example, an external file having named range “Names” is linked with the Excel file. We can access this named range in the linked file and display its properties mentioned above.

Keep separators for blank rows during spreadsheet to CSV

Many times you convert the Excel sheets to CSV for using it in some other environment or applications. You may need to decide yourself about the separators for blank rows in the spreadsheet while exporting it to CSV. For example, there is a blank row in the source spreadsheet and you want either a blank row in the CSV or have a row with predefined separators. We have provided this feature now and you can get details about this feature here.

For better understanding, have a look at the following image which shows the result of this feature.

Following is a sample code which demonstrates this new feature.

Autofit Rows for Merged Cells

Autofitting rows is a very common operation which you perform while working with the Excel files. This feature was already there in Aspose.Cells API however many people asked for more control over this operation. To fulfill this requirement we have provided AutoFitMergedCellsType enumerator which contains the following options:

  • NONE: Ignore merged cells.
  • FIRST_LINE: Only expands the height of the first row.
  • LAST_LINE: Only expands the height of the last row.
  • EACH_LINE: Expands the height of each row.

Here is a snapshot of this feature where the effect of one of the options EACH_LINE is shown.

You can test this feature using following sample code.

For more details on this topic please visit here.

Other enhancements in this release

  • Text extraction from cells using Cell.getDisplayStringValue() was returning different results for Ricty Diminished font. The new version returns appropriate string now.
  • Text alignment in the resultant PDF is made more accurate.
  • In some cases, the black text color was changed to red in the converted HTML, that is no more an issue.
  • Scatter chart and 2D bubble chart will be rendered to PDF without any problem.
  • Range.Copy() will copy the font settings and other objects now onward.
  • Workbook.hasExernalLinks() will return proper results for DDE links.

Note: You may download this project from GitHub to get the template files and running examples used in this blog post.

Posted in Aspose.Cells Product Family | Leave a comment

Preserve Legacy Control Characters, Font Fallback Setting for Noto fonts and Text Alignment of Axis Labels

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Hi guys! Do you want to preserve legacy control characters in Word documents? Many of you must want to work with font fallback for Google Noto fonts? You will love to export the list labels of Word document into TXT file format with specific character and change the text alignment of axis tick labels of chart. So what’s the solution?

It is Aspose.Words for .NET 19.3. You can work with these features using it.

So how to work these features? Let’s talk about these one by one.

Preserve Representation of Legacy Control Characters While Exporting Document to OOXML

Some document formats support legacy control characters. MS Word does not save these symbols to DOCX format (more accurately in OOXML formats). However, we added new property KeepLegacyControlChars in OoxmlSaveOptions class to preserve such control characters. So far only one legacy character (ShortDateTime) is supported which declared in the “DOC” format.

Here’s how you can use this property:

Predefined Font Fallback Settings for Google Noto Fonts

You may know about Noto. It is a font family comprising over a hundred individual fonts. We have added predefined font fallback settings for Google Noto fonts. These are free fonts licensed under SIL OFL.

Let me clarify two things here:

  • The predefined settings uses only Sans style Noto fonts with regular weight.
  • Aspose.Words does not support advanced typography. So, the Noto fonts that use advanced typography may be rendered inaccurately

Following code example shows how to use predefined font fallback settings.

Don’t stop reading now! There are more Aspose.Words’ features for you. Amazing, isn’t it?

Text Alignment of Axis Tick Labels

By default, MS Word aligns Chart Label to the center. However, you can change it using ChartAxis.TickLabelAlignment property. We have simple example for you here:

Sound good? Yes, it is!

Allow to Specify How List Levels are Indented When Exporting Document to Plain Text Format

Starting from Aspose.Words 19.3, you can get the ListIndentation object and specify how many and which character to use for indentation of list levels. By default, no indentation is exported to text file format.

Here’s how to work with list indentation.

Using Tab Character

Using Space Character

Using Default Indentation

Wait, there’s many other features, enhancement, and bug fixes included in this release. Here you can get the detail!

When time allows you can check out API examples at Github, talk about this release and other API related issues in our forum.

Posted in Aspose.Words Product Family | Leave a comment

Aspose.Cells for Reporting Services v19.3 supports rendering XPS format

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Aspose.Cells for SSRS iconAt least Windows users won’t deny the advantages of XPS (The XML Paper Specification) format. Forget if it is a paginated fixed-layout format that retains the look and feel of your documents. But, being a shape of electronic paper, the XPS format provides a better way in which you can easily create, share and print digital documents. And, above all, XPS documents can be neither manipulated nor edited easily and can only be viewed on computer systems that have an XPS Viewer installed.

Render your report definition file to XPS

While working in report server to transform report data and layout information into XPS, you might think why SQL Server Reporting Services did not include this format as one of their built-in rendering extension. No worries, Aspose.Cells for Reporting Services is here to cope with it and now it supports the format. Here is a document to check complete list of supported document formats.

To use this useful feature and avail other enhancements, I would recommend you to try the release Aspose.Cells for Reporting Services 19.3. And, if you have a little time, browse Developers’ Guide for your complete reference on what you can deliver using the rendering extension API. You are always welcome to share your review, concerns or feedback on forums.

Posted in Aspose.Cells Product Family | Leave a comment

Detect OOXML file format using Aspose.Cells for Java 19.2

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Wait is over, guys! The latest version of Aspose.Cells for Java is here. I’m going to walk you through all the exciting features, improvements, and fixes. Don’t worry, you’ll know where you can find everything related to this latest update in a bit, but for now, let’s talk about this new version and see what the team has been up to! Shall we?

Microsoft Excel supports a feature to insert a row using one of the three different options. The objective of these options is to adopt settings from other rows. These three options include the following:

  • Format Same as Above (copy formatting from the above row)
  • Format Same as Below (copy formatting from the row below)
  • Clear Formatting (add new row but without any formatting)

You can also see these three options in the following screenshot:

Insert a row with one of the three formatting options

The good news is, using Aspose.Cells for Java 19.2 and onwards, you can use this feature in your code as well. You can programmatically create new rows with specified formatting option. Now, you must be wandering, hmm, how exactly do I do that in my Java application? Here is a code sample for you to do just that along the documentation to insert row with formatting:

There was a high demand, from you guys, that just like Excel, Aspose.Cells supports replacing special characters while opening a CSV file. So, we’re very excited to break the news that this feature is now supported in the API. Just have a look at the below example to see how easy it is to achieve this with Aspose.Cells for Java.

As you must already have some idea that Office Open XML, which is also known as OOXML or Microsoft Open XML (MOX), is a very common format used for files. It is an XML-based format developed by Microsoft for representing office documents like spreadsheets, charts, presentations, and word processing documents. Aspose.Cells already allowed to open and detect type of this format. But now, our team has gone a step forward, and supported to detect type of encrypted OOXML files. Check out the sample code below:

3 Major Enhancements in Aspose.Cells for Java

In addition to the features highlighted above, you can now improve your products with the help of these 4 major improvements:

  • API Reference (JavaDocs) has been updated along with improving the process of attaching JavaDocs to our API in the IDEs. Now, you should be able to utilize the API upto its full capacity with the help of the updated API Reference of Aspose.Cells for Java.
  • Based on our user’s demand to access all the hyperlinks in a range of cells and delete anyone if required, we have supported this feature in this release. You can use Range.getHyperlinks() to get all the hyperlinks from a range, and then delete those using Hyperlink.delete() method.
  • Small integer variable was available to get the number of cells in the Worksheet. In the newer versions of Excel, when number of cells was increased, it was not possible to get the large number of cells. This shortcoming is corrected by providing appropriate data type which can be evaluated using sample code in this topic.

A Few Minor Improvements in the API

The following is a list of some minor changes made to the public API such as added, renamed, removed or deprecated members as well as any non-backward compatible changes made to Aspose.Cells for Java:

  • Added ListObject.AlternativeDescription and ListObject.AlternativeText properties toget and set the alternative text and description of the table
  • Added Line.ThemeColor property to get and set the theme color of the line
  • Added Mode3d and MsoModel3dFormat class which encapsulates the object that represents a single 3D model in a spreadsheet
  • Added ImageType.Gltf enum which represents the type of 3D model

Alright! by now, you must have got pretty good idea of what we have been working on, since the last release, to help you improve and speed up your development efforts. Well, where you go from here on? Choice is yours!

You can take a little break and come back for more, or if you have already taken your cup of coffee, then let’s talk further about this release in our forums. You can also check out API examples at Github, or go ahead and download latest version of Aspose.Cells for Java to play with it. And stay tuned for more exciting features and news!

Posted in Aspose.Cells Product Family | Leave a comment

Work with Chart Axis in Word Document

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

The chart is a very useful feature to graphically represent or visualize any kind of data in a way to create maximum impact on target audiences. Charts allow users to see the results of the represented data in order to better understand and predict current and future data.

In a Word document, there are various types of charts available to work with based on the needs of users. To make a chart easier to understand, the chart title and axis titles can be added to any type of chart. Axis titles are typically available for all axes that can be displayed in a chart and most commonly used chart types have two axis. The X-axis along the bottom of the chart, usually the horizontal axis and the Y-axis along the left, usually the vertical axis.

How to Hide Chart Axis

In some cases, the user may need to hide the chart axis or anyone of them. Using Aspose.Words for .NET, this can simply be achieved by setting the value of ChartAxis.Hidden property for a specific axis to false. This property gets or sets a flag indicating whether this axis is hidden or not. The default value is false.

The following code snippet shows how to hide the Y-axis of the chart.

The resulting view of the chart is given below where Y-axis is hidden:

Multi-line Label Alignment

While working with ChartAxis, Aspose.Words for .NET provides an opportunity to set user-defined label alignment for the axis of the series. Microsoft Word aligns all the axis labels to the center by default as shown below:

The TickLabelAlignment property has been introduced under ChartAxis class for setting the label alignment. The ChartAxis class represents the axis options of the chart. The TickLabelAlignment property gets or sets text alignment of axis tick labels and it has effect only in case of multi-line labels. The default value is “ParagraphAlignment.Center“.

The following code snippet shows the working of TickLabelAlignment.

The resulting view of the chart is shown below:

Posted in Aspose.Words Product Family | Leave a comment

Support of CMX Format

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Corel Metafile Exchange (CMX) is a metafile format that supports bitmap and vector information and the full range of PANTONE, RGB and CMYK colors. This format is used for data exchange in programs that work with vector graphics. It contains image data and also the metadata that describes it. The purpose of this post is to demonstrate how you can export existing CMX file to other formats (PNG, JPEG, BMP, TIFF) using Aspose.Imaging.

Convert CMX to PNG

Using Aspose.Imaging.ImageOptions.PngOptions class you can export existing CMX file to PNG format. CmxRasterizationOptions class is used to set different properties as per requirement.

Using CmxRasterizationOptions.Positioning parameter, you can set Positioning and size types of a graphics scene. CmxRasterizationOptions.Positioning parameter can take one of the following three values.

ValueDescription
DefinedByDocumentThe absolute positioning on the page that is defined by document page settings.

DefinedByOptionsThe absolute positioning on the page that is defined by options page settings.

RelativeThe relative positioning and size. Determined by the boundary of all graphics objects.

CmxRasterizationOptions.SmoothingMode parameter specifies whether smoothing (antialiasing) is applied to lines and curves and the edges of filled areas. CmxRasterizationOptions.SmoothingMode parameter can take one of the following six values.

ValueDescription
InvalidSpecifies an invalid mode.

DefaultSpecifies no antialiasing.

HighSpeedSpecifies no antialiasing.

NoneSpecifies no antialiasing

AntiAliasSpecifies antialiased rendering.

HighQualitySpecifies antialiased rendering.

The following code is loading existing CMX files using Image class and setting Positioning to DefinedByDocument and SmoothingMode to AntiAlias and exporting loaded CMX file to PNG.

Finally, after exporting the CMX file to PNG, the output PNG looks as follows:

The complete code of this post is available on GitHub.

Posted in Aspose.Imaging Product Family | Leave a comment

Create Tagged PDFs using Aspose.PDF for Java 19.2

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

PDF files contain text, images and other element of content that are combined together to make up an electronic document. In addition, there is a set of instructions which defines the logic of binding the content together known as Structure. The structure defines the correct reading order of a PDF file.

In a PDF file, the structure is known as Tags. These tags are the hierarchy of containers describing the semantics of the content inside them and are represented in an invisible layer behind the visible PDF content. A well-structured or well-tagged PDF document can help screen-reading applications, read the content easily. Furthermore, tagged PDFs can make a document accessible to Visually Impaired Individuals. These individuals can understand the content inside a PDF document using a screen reading application. Imagine using your computer with the screen turned off and you’ll get some idea of how important logical text-flow is. Similarly,
you’ll get some idea of how important well-structured tagged PDF document is for people who need screen-readers to read your PDF document.

Tags may be generated automatically for any PDF file using Acrobat Reader if the document is a very simple one. Otherwise, automated tagging does not produce correct results. In order to understand the automated tagging, we can go back to a quote from the movie Forrest Gump:

“My mama always said, life is like a box of chocolates, you never know what you’re going to get”.

Here – life is a user, the box is the PDF document and the chocolates are the Tags – you never know what tag you are going to get with the automated tagging.

This is where Aspose.PDF for Java API comes handy. The API offers functionality to create Tagged PDFs from scratch with high fidelity. ITaggedContent interface in the API helps defining the content properly and is the entry point for creating Tagged PDF Documents.

Aspose.PDF TaggedPDF Features

Following documentation articles demonstrate the functionality to create Tagged PDFs using Aspose.PDF for Java:

With Aspose.PDF for Java, you can also get content and structure of Tagged PDFs. Following articles shows the functionality along with sample code snippet(s):

Posted in Aspose.PDF Product Family | Tagged , , , | Leave a comment

Improved API Performance with Aspose.Email for Android via Java 19.1

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

aspose-email-for-android-via-javaWe are pleased to announce the release of Aspose.Email for Android via Java 19.1. This release includes enhancements and bug fixes which improve the overall functionality of the API. For a detailed note on what is new and fixed, you may visit the release notes section in the API documentation.

Enhancements in Aspose.Email for Android via Java 19.1

This release includes enhancements to the functionality of the API. These enhancements include reading OLM, MBOX, and MSG files.

Other Improvements

There are a lot more improvements made in this release. Following is a list of improvements included in this month’s release.

  • The formatting of HtmlBodyText in the output has been improved.
  • The ability to update the date in the header by using the MapiMessage class.
  • Improved MailMessage and MapiMessage classes.
  • Improved working with appointments.
  • MapiTask functionality has been improved.
  • The following conversions have been improved
    • MSG to MHTML
    • VCF to MSG
    • PST to MBOX

API Resources

Aspose.Email for Android via Java documentation section is your one-stop for learning all about the API. You can visit the documentation page of the API to know more about the API. For any of your queries, feel free to write to us over Aspose.Email forum.

Posted in Aspose.Email Product Family | Leave a comment

Improved API Performance with Aspose.Email for Java 19.1

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

aspose-email-for-javaWe are pleased to announce the release of Aspose.Email for Java 19.1. This release includes enhancements and bug fixes which improve the overall functionality of the API. For a detailed note on what is new and fixed, you may visit the release notes section of API.

Enhancements in Aspose.Email for Java 19.1

This release includes enhancements to the functionality of the API. The components improved in this release include Pop3Client, EWSClient, and ImapClient. MailMessage and MapiMessage classes have also been improved.

Other Improvements

There are a lot more improvements made in this release. Following is a list of improvements included in this month’s release.

  • The formatting of HtmlBodyText in the output has been improved.
  • The ability to update the date in the header by using the MapiMessage class.
  • Improved working with signed MSG files.
  • Improved working with MBOX files.
  • MapiTask functionality has been improved.
  • The following conversions have been improved
    • MSG to MHTML
    • VCF to MSG
    • PST to MBOX

API Resources

We have detailed information available online for getting started with the Aspose.Email for Java API. These are:

Posted in Aspose.Email Product Family | Leave a comment