Licensing

Skip to end of metadata
Go to start of metadata
You can easily download an evaluation version of Aspose.Cells from its download page. The evaluation version provides absolutely the same capabilities as the licensed version of the component. Furthermore, evaluation version simply becomes licensed when you purchase a license and add a couple of lines of code to apply the license.
Evaluation Version Limitations

Evaluation version of Aspose.Cells product (without a license specified) provides full product functionality, but it is limited to open 100 files in one program and an extra worksheet with evaluation watermark.

The limitations are shown below:

1st Limitation: Number of Opened Files – Aspose.Cells

When running your program, you can only open 100 Excel files using Aspose.Cells library. If your application exceeds this number, an exception will be thrown.

2nd Limitation: Config File Settings – Aspose.Cells.GridWeb

You can't re-specify the script path by adding the following lines of code into the configuration section (e.g in the web.config file). The acw_client is a folder that contains files and Aspose.Cells.GridWeb uses this folder to manage its internal configuration, it has scripts files, image files and other files to specify GridWeb's behavior and set other operations. The config file is used to prevent the control from using the embedded client resources (images, scripts, etc.) which is useful in some cases / scenarios. Moreover, this configuration settings in the web.config file will only take effect with the LICENSED version of the control.

[XML]
<appSettings>
<add key="aspose.cells.gridweb.acw_client_path" value="/acw_client/" />
<add key="aspose.cells.gridweb.force_script_path" value="true" />
</appSettings>
 
These settings might be compulsory in some cases / scenarios if you are utilizing Aspose.Cells.GridWeb control in File System Websites or MS Ajax extensions etc.
3rd Limitation: Worksheet with Evaluation Watermark

This worksheet will always show as the active worksheet in the generated excel file using Aspose.Cells library. Only in licensed version, you can set the active worksheet to other worksheets. Moreover, you can't hide the Evaluation Copyright Warning (the extra worksheet) in the GridWeb control too, it will always be added (at the end in the worksheet tabs) in the contro l as shown in the figure below:

Figure: Evaluation Watermark

If you want to test Aspose.Cells without evaluation version limitations, you can also request a 30 Day Temporary License.
Setting License in Aspose.Cells Component

The license is a plain text XML file that contains details such as the product name, number of developers it is licensed to, subscription expiry date and so on. The file is digitally signed, so don't modify the file. Even inadvertent addition of an extra line break into the file will invalidate it.You need to set a license before utilizing Aspose.Cells if you want to avoid its evaluation limitation. It is only required to set a license once per application (or process). The license can be loaded from a file, stream or an embedded resource.

Aspose.Cells tries to find the license in the following locations:
  • Explicit path
  • The folder that contains Aspose.Cells.dll
  • The folder that contains the assembly that called Aspose.Cells.dll
  • The folder that contains the entry assembly (your .exe)
  • An embedded resource in the assembly that called Aspose.Cells.dll

There are two common methods to set the license, these are discussed below:

1st Method (Using File or Stream)

The easiest way to set a license, is to put the license file in the same folder as that of Aspose.Cells.dll and specify just the file name without its path.

Example:
[C#]
//Instantiate an instance of license and set the license file through its path
Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense("Aspose.Cells.lic");
 
[VB.NET]
'Instantiate an instance of license and set the license file through its path
Dim license As Aspose.Cells.License = New Aspose.Cells.License()
license.SetLicense("Aspose.Cells.lic")
 
When you call SetLicense method, the license name should be same as that of your license file name. For example, you may change the license file name to "Aspose.Cells.lic.xml". Then in your code, you should use the modified license name (that is Aspose.Cells.lic.xml) for the SetLicense method.

It is also possible to load a license from a stream.

Example:
[C#]
//Instantiate an instance of license and set the license through a stream
Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense(myStream);
 
[VB.NET]
'Instantiate an instance of license and set the license through a stream
Dim license As Aspose.Cells.License = New Aspose.Cells.License()
license.SetLicense(myStream)
 
2nd Method (Using Embedded Resource)

Another neat way of packaging the license with your application and making sure it will not be lost, is to include it as an embedded resource into one of the assemblies that calls Aspose.Cells. To include the license file as an embedded resource, perform the following steps:

In Visual Studio .NET, include the license (.lic) file into the project using the File | Add Existing Item... menu
Select the file in the Solution Explorer and set Build Action to Embedded Resource in the Properties window




To access the license embedded in the assembly (as embedded resource), it is not needed to call GetExecutingAssembly and GetManifestResourceStream methods of System.Reflection.Assembly class of Microsoft .NET Framework. All is needed to do, is to just add the license file as an embedded resource to your project and pass the name of the license file into SetLicense method. The License class will automatically find the license file in the embedded resources.Please review the example given below to understand this method of setting license (embedded) in your applications.

Example:
[C#]
//Instantiate the License class
Aspose.Cells.License license = new Aspose.Cells.License();

//Pass only the name of the license file embedded in the assembly
license.SetLicense("Aspose.Cells.lic");
 
[VB.NET]
'Instantiate the License class
Dim license As Aspose.Cells.License = New Aspose.Cells.License()

'Pass only the name of the license file embedded in the assembly
license.SetLicense("Aspose.Cells.lic")
 
Setting License in Aspose.Cells Grid Controls

In Aspose.Cells Grid Suite, license can be loaded from a file, stream or an embedded resourceAspose.Cells.GridDesktop / Aspose.Cells.GridWeb tries to find the license in the following locations: 1). Explicit path 2). The folder that contains the dll of the component (included in Aspose.Cells.GridDesktop or Aspose.Cells.GridWeb) 3). The folder that contains the assembly that called the dll of the component (included in Aspose.Cells.GridDesktop or Aspose.Cells.GridWeb) 4). The folder that contains the entry assembly (your .exe) 5). An embedded resource in the assembly that called the dll of the component (included in Aspose.Cells.GridDesktop or Aspose.Cells.GridWeb)

If you are using Aspose.Cells.GridDesktop control then the license class will be used as Aspose.Cells.GridDesktop.License but if you are using Aspose.Cells.GridWeb control then Aspose.Cells.GridWeb.License class will be used to set the license.

There are two common methods to set the license, which are discussed below:

1st Method (Using File or Stream)

The easiest way to set a license, is to put the license file in the same folder as that of the dll of the component (included in Aspose.Cells.GridWeb) and specify just the file n ame without its path.

Example:
[C#]
//Instantiate an instance of license and set the license file through its path
Aspose.Cells.GridWeb.License license = new Aspose.Cells.GridWeb.License();

license.SetLicense("MyLicense.lic");
 
[VB.NET]
'Instantiate an instance of license and set the license file through its path
Dim license As Aspose.Cells.GridWeb.License = New Aspose.Cells.GridWeb.License()

license.SetLicense("MyLicense.lic")
 
When you call SetLicense method, the license name should be same as that of your license file name. For example, you may change the license file name to "MyLicense.lic.xml". Then in your code, you should use the modified license name (that is MyLicense.lic.xml) for the SetLicense method.

It is also possible to load a license from a stream.

Example:
[C#]
//Instantiate an instance of license and set the license through a stream
Aspose.Cells.GridWeb.License license = new Aspose.Cells.GridWeb.License();

license.SetLicense(myStream);
 
[VB.NET]
'Instantiate an instance of license and set the license through a stream
Dim license As Aspose.Cells.GridWeb.License = New Aspose.Cells.GridWeb.License()

license.SetLicense(myStream)
 
2nd Method (Using Embedded Resource)

Another neat way of packaging the license with your application and making sure it will not be lost, is to include it as an embedded resource into one of the assemblies that calls the dll of the component (included in Aspose.Cells.GridDesktop). To include the license file as an embedded resource, perform the following steps:

In Visual Studio .NET, include the license (.lic) file into the project using the File | Add Existing Item... menu



Select the file in the Solution Explorer and set Build Action to Embedded Resource in the Properties window




To access the license embedded in the assembly (as embedded resource), it is not needed to call GetExecutingAssembly and GetManifestResourceStream methods of System.Reflection.Assembly class of Microsoft .NET Framework. All is needed to do, is to just add the license file as an embedded resource to your project and pass the name of the license file into SetLicense method. The License class will automatically find the license file in the embedded resources.Please review the example given below to understand this method of setting license (embedded) in your applications.

Example:
[C#]
//Instantiate the License class
Aspose.Cells.GridDesktop.License license = new Aspose.Cells.GridDesktop.License();

//Pass only the name of the license file embedded in the assembly
license.SetLicense("Aspose.Total.lic");
 
[VB.NET]
'Instantiate the License class
Dim license As Aspose.Cells.GridDesktop.License = New Aspose.Cells.GridDesktop.License()

'Pass only the name of the license file embedded in the assembly
license.SetLicense("Aspose.Total.lic")
 
Special Notes of Setting a License in Aspose.Cells.GridDesktop for a WinForm Application

It's recommended that you should put your licensing code before your application starts and place it only one time. For example, for a windows C# application, you may put the licensing code in the Main method.

Example:
[C#]
public class Form1 : System.Windows.Forms.Form
{
private Aspose.Cells.GridDesktop.GridDesktop gridDesktop1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// The main entry point for the application.
/// </summary>
.
.
.
.
[STAThread]
static void Main()
{
Aspose.Cells.GridDesktop.License lic = new Aspose.Cells.GridDesktop.License();

//Use this line if you are using an explicit path for the license file.
lic.SetLicense(@"C:\MyLicense.lic");

//Or use the line below if you are using the license file as an embedded resource.
//lic.SetLicense("MyLicense.lic");
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
Aspose.Cells.GridDesktop.Worksheet sheet = this.gridDesktop1.Worksheets.Add("MySheet");
sheet.Cells["A1"].SetCellValue("Hello");
gridDesktop1.ActiveSheetIndex = 1;
}
}
 
[VB.NET]
Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()

        MyBase.New()

        Dim lic As Aspose.Cells.GridDesktop.License = New Aspose.Cells.GridDesktop.License

        'Use this line if you are using and explicit path for the license file.
        lic.SetLicense("C:\MyLicense.lic")

        'Or use the line below if you are using the license file as an embeded resource.
        'lic.SetLicense("MyLicense.lic");

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
    End Sub

.
.
.

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim sheet As Aspose.Cells.GridDesktop.Worksheet = Me.GridDesktop1.Worksheets.Add("MySheet")
        sheet.Cells("A1").SetCellValue("Hello")
        GridDesktop1.ActiveSheetIndex = 1

    End Sub
End Class
 
Special Notes of Setting a License in Aspose.Cells.GridWeb

It's recommended to put the licensing code in the Global.asax.cs of your web application(this license file is assumed to be put on the " d:\ "):

Example:
[C#]
protected void Application_Start(Object sender, EventArgs e)
{
    Aspose.Cells.GridWeb.License lic = new Aspose.Cells.GridWeb.License();
    lic.SetLicense(@"d:\Aspose.Cells.GridWeb.lic.xml");
}
 
[VB.NET]
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    Dim lic As Aspose.Cells.GridWeb.License = New Aspose.Cells.GridWeb.License()
    lic.SetLicense("d:\Aspose.Cells.GridWeb.lic.xml")
End Sub
 
The following example shows how to load a license from a stream:
[C#]
protected void Application_Start(Object sender, EventArgs e)
{
    Aspose.Cells.GridWeb.License lic = new Aspose.Cells.GridWeb.License();
    lic.SetLicense(myStream);
}
 
[VB.NET]
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    Dim lic As Aspose.Cells.GridWeb.License = New Aspose.Cells.GridWeb.License()
    lic.SetLicense(myStream)
End Sub
 
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.