Adding new Aspose Licenced product

Hi

I've just purchased Aspose.Chart and want to set the licence in VB.Net, currently I have the following for Aspose.Grid -

Public Sub New()
Dim license As License = New License()
license.SetLicense("Aspose.Grid.lic")
InitializeComponent()
End Sub

How do I now add a reference for Aspose.Chart?

Regards

Bob Hamill

Hi Bob,

Thanks for considering Aspose.

Well, Normally you will set the license of Aspose.Chart in the same way as you did with Aspose.Grid or other Aspose components.

http://www.aspose.com/Wiki/default.aspx/Aspose.Chart/Licensing.html

And Aspose.Chart component (Aspose.Chart.dll) does not get registered rather copied to your machine. For adding reference to the component, you need to Add Reference.... to Browse to Select the Aspose.Chart.dll (Normally Aspose.Chart.dll file is copied to ....\Program Files\Aspose\Aspose.Chart\Bin folder.... i.e. net1.1 and net2.0 sub folders when using its MSI) in Solution Explorer in VS.Net. So kindly set to the .dll file and use the component in your project.

Thank you.

Hi Amjad

Sorry I don't understand - I have tried below and get error? Can you help please..

Public Sub New()

Dim license As License = New License()

license.SetLicense("Aspose.Grid.lic")

license.SetLicense("Aspose.Chart.lic")

' This call is required by the Windows Form Designer.

InitializeComponent()

' Add any initialization after the InitializeComponent() call.

End Sub

Hi,

Could you tell me which portion of my last post you did not understand. Please do follow the last paragraph of my previous post and use the following code after adding reference to Aspose.Grid.Desktop and Aspose.Chart to your project.

'Set the license for Aspose.Grid.Desktop
Dim griddesktopLicense As Aspose.Grid.Desktop.License = New Aspose.Grid.Desktop.License()
griddesktopLicense.SetLicense("Aspose.Grid.lic")

'Set the license for Aspose.Chart
Dim chartLicense As Aspose.Chart.License = New Aspose.Chart.License()
chartLicense.SetLicense("Aspose.Chart.lic")

For setting licensing for Aspose.Grid you may also check:

If you still find some problem, do let us know what is the error description you find.

Thank you.

Hi,

I am getting an error message - 'The license is not valid for this product'
I downloaded Chart this afternoon with new license

This is my code -

Public Sub New()

'Set the license for Aspose.Grid.Desktop

Dim griddesktopLicense As Aspose.Grid.Desktop.License = New Aspose.Grid.Desktop.License()

griddesktopLicense.SetLicense("Aspose.Grid.lic")

'Set the license for Aspose.Chart

Dim chartLicense As Aspose.Grid.Desktop.License = New Aspose.Grid.Desktop.License()

chartLicense.SetLicense("Aspose.Chart.lic")

' This call is required by the Windows Form Designer.

InitializeComponent()

End Sub

Hi,

Thanks for considering Aspose.

Do you get this error for Aspose.Chart or Aspose.Grid.Desktop or both.

On our side we will also check and figure out the issue soon.

Thank you.

Hi

Only Aspose.Chart - Grid works fine

Hi,

Could you attach your license file for Aspose.Chart here.

Thank you.

Please find attached file

Hi,

Well, It looks odd to me. I tested the license file with a winform application and it works absolutely fine, no problem at all. I put the Aspose.Chart.lic in the ...bin\debug folder and following is my testing code and attached is the output chart image.

Aspose.Chart.License chartLicense = new Aspose.Chart.License();
chartLicense.SetLicense("Aspose.Chart.lic");
Chart c = new Chart();

c.Titles.Add(new Title());
c.Titles[0].Text = "Bubble 2D, Color Current Date";

c.ChartArea.AxisX.DefaultLabel.Format = "MM/dd/yy";
c.ChartArea.AxisX.MajorGrid.IsVerticalLinesVisible = false;
c.ChartArea.AxisY.MajorGrid.IsHorizontalLinesVisible = true;

AxisLabel l1 = new AxisLabel();
l1.IsCustomLabelGridVisible = true;
l1.Color = Color.Red;
l1.Text = "Current date";
l1.FromValue = (new DateTime(2005, 1, 4)).ToOADate();
l1.ToValue = l1.FromValue;
c.ChartArea.AxisX.CustomLabels.Add(l1);

Series s = new Series();
s.ChartType = ChartType.Bubble;
s.CustomAttributes.BubbleMinSize = 8;
s.CustomAttributes.BubbleMaxSize = 100;
s.CustomAttributes.BubbleWeightColor = Color.Red;
s.DataPoints.Add(new DataPoint("Point 1", new DateTime(2005, 1, 1), 64, 64));
s.DataPoints[0].Color = Color.Red;
s.DataPoints[0].BorderColor= Color.SeaGreen;
s.DataPoints.Add(new DataPoint("Point 2", new DateTime(2005, 1, 2), 32, 32));
s.DataPoints[1].Color = Color.Green;
s.DataPoints[1].BorderColor= Color.Red;
s.DataPoints.Add(new DataPoint("Point 3", new DateTime(2005, 1, 3), 16, 16));
s.DataPoints[2].Color = Color.Blue;
s.DataPoints[2].BorderColor= Color.Pink;
s.DataPoints.Add(new DataPoint("Point 4", new DateTime(2005, 1, 4), 8, 8));
s.DataPoints[3].Color = Color.Black;
s.DataPoints[3].BorderColor= Color.SeaGreen;
s.DataPoints.Add(new DataPoint("Point 5", new DateTime(2005, 1, 5), 4, 4));
s.DataPoints.Add(new DataPoint("Point 6", new DateTime(2005, 1, 6), 2, 2));
//Border around chart
c.FrameBorder.BorderType = BorderType.Bump;
c.FrameBorder.BackColor = Color.Black;
//Make the color sharp....Sets the transparence value of chart area. The value of 1 indicates 100% transparency, the value of 255 indicates 0% transparency. The default value is 128.
c.ChartArea.Transparence = 255;


c.SeriesCollection.Add(s);


c.Save("d:\\imagechart1.png", System.Drawing.Imaging.ImageFormat.Png);

Where you place the license file, you may put it in the application folder or please try to add an embeded resource.

Thank you.

Bob,

Change this line:
Dim chartLicense As Aspose.Grid.Desktop.License = New Aspose.Grid.Desktop.License()

To this:
Dim chartLicense As Aspose.Chart.License = New Aspose.Chart.License()


Then your code should work fine.