Free Support Forum - aspose.com

Aspose.Cells Deployment

I have upgraded to the latest version of Aspose.cells.

I have run set up and added a reference to the new version.

When i run one of the existing programs (written using the old version) I get an error saying that the new license is incorrect.

What do I have to do do to fix this.

Thank you for your help

Hi,

If you want to use the older dll, then you do not need a new license. Just use your older license with your older versions of the product. But if you want to use the new license, then please use the newer dlls that fall inside your license subscription expiry date.

Thank you.

Thank you for answering. I think I may have phrased my question incorrectly. What I need to know is how I deply the new version onto the server, and what I have to do to any existing programs to ensure it uses the new version.


Thnak you

Jonathan

deply -= deploy

Hi,


That should be pretty simple, you should copy the new Aspose.Cells.dll (new version) to place it on to your server location (replacing your older version). In your project, remove the older reference of Aspose.Cells under References node in Solution explorer. Now, Add Reference for Aspose.Cells to your new version, Rebuilt the project/solution, that is it.

Also check the documents in the section or sub-section, e.g
http://www.aspose.com/docs/display/cellsnet/Using+Aspose.Cells+component+on+32+bit+and+64+bit+Platforms
http://www.aspose.com/docs/display/cellsnet/Installation

Let us know if you have any confusion.

Thank you.

I'm sorry I know i am being stupid but im still battling. I hav euninstalled the old cell version. Installed the new version using the supplied msi.

I have copied the new license to th relevanr folders on the server and i am still getting this error

The license is not valid for this product.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The license is not valid for this product.

Source Error:

Line 80:             Dim workbook As Workbook = New Workbook()
Line 81:             Dim license As Aspose.Cells.License = New Aspose.Cells.License()
Line 82:             license.SetLicense(Server.MapPath("~/Reports/Aspose.Cells.lic"))
Line 83:             Dim myConnection3 As OleDbConnection
Line 84:             Dim myCommand3 As OleDbCommand

Hi,


Well, I suspect your license might be invalid, for example, you might be using JAVA license with .NET version or some other license with Aspose.Cells, or somebody changed the original license etc. You may open your license file into notepad and try to check if the license is valid or not.

If, you still in case, could not evaluate your issue, please mail your license, see the steps on how to send us the license file:
http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx

The license looks fine to me. See below

<?xml version="1.0" encoding="utf-8"?>


RTU
Developer Small Business
Limited to 1 developer.
121119042331
This is not a non-redistributable license

Aspose.Cells for .NET

Enterprise
9624acd1-254f-4e42-b530-054366b90433
20131119
2.2

hPRRA9rfpG3FVornybxKSleJGY5iNzIXbmaPCH4v8DaT3cBXMI/dTcq45qBcsoaBPH8DFVhAPbeiXKZQQDmiDDFLDR/nyYPIafRozJzAC9lojbiebtqIX/ABjfls58z5gv2TV0pD6l+sdPFatbMUFey6O15fJmfuaNdqpPg+aXI=

Hi,


Well, I just copied the contents of your license file by opening notepad and save it as “Aspose.Cells.lic” in it. I now tested using the following code with the saved license file, it works absolutely fine with it. Here is my sample code and you may find attached the output file which is fine tuned.

Sample code:

Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense(@“e:\test2\Aspose.Cells.lic”);
var workbook = new Workbook();
var i = workbook.Worksheets.Add();
var worksheet = workbook.Worksheets[i];
var cells = worksheet.Cells;

cells[“A1”].PutValue(“testing”);
workbook.Worksheets.ActiveSheetIndex = i;
workbook.Save(“e:\test2\outLicTest.xlsx”);

It looks strange to me why it is not working on your side. Could you create a sample “hello world” console application, zip it and post it here to reproduce the issue on our end, you don’t need to put the license file in the archive, we will check your issue soon.

Thank you.

I'm so sorry I have wasted your time - I searched each directory of my solution and finally found that the old Aspose.cells license was still in the Bin folder. Sorry.

While I am writing could you please advise how I can use the

cells[“A1”].PutValue(“testing”) command in the following code. I do not know how to intgrate a workbook designer with the worksheet.cells command.

Thank you for your help.

Dim con As OleDbConnection

Dim cmd1 As OleDbCommand

Dim da As New OleDbDataAdapter

Dim ds As New DataSet

Dim wd As WorkbookDesigner = New WorkbookDesigner()

Dim v1 = CStr(Request.Form(“Comment”))

Con =New OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0; Data Source=” & Server.MapPath("~/fpdb/passliabcapture.mdb"))

con.Open()

cmd1 = New OleDbCommand(“SELECT * FROM [Brokerrecon] WHERE [Comment] = Comment ORDER BY Comment, Rdate”, con)

cmd1.Parameters.Add(New OleDbParameter("@Comment", OleDbType.VarChar, 10))cmd1.Parameters("@Comment").Value = CStr(Request.Form(“Comment”))

da.SelectCommand = cmd1

ds = New DataSet()

da.Fill(ds, “Brokerrecon”)

Dim dt As DataTable = ds.Tables(“BrokerRecon”)

wd = New WorkbookDesigner() wd.Open(Server.MapPath("~/reports/brokerecon.xls"))

wd.SetDataSource(dt)


wd.Process(True)Dim name As String = Server.MapPath("~/reports/recon/" & v1 & “.xls”)

wd.Workbook.Save(“Report.xls”, FileFormatType.Default, Aspose.Cells.SaveType.OpenInExcel, Response)con.Close()

Hi,


Good to know that your issue is resolved.

Regarding integrating the WorkbookDesigner with Workbook and its sub-objects, please see the following sample that may help you for your reference:

[#C]

WorkbookDesigner designer = new WorkbookDesigner();
Workbook workbook = new Workbook(“e:\test2\Book1.xlsx”);
designer.Workbook = workbook;

Cells cells = workbook.Worksheets[0].Cells;
Aspose.Cells.Cell cell = cells[“A1”];
cell.PutValue(“Testing”);


[VB.NET]

Dim designer As WorkbookDesigner = New WorkbookDesigner()
Dim workbook As Workbook = New Workbook(“e:\test2\Book1.xlsx”)
designer.Workbook = workbook

Dim cells As Cells = workbook.Worksheets(0).Cells
Dim cell As Aspose.Cells.Cell = cells(“A1”)
cell.PutValue(“Testing”)


Hope, this helps.

Thank you.

Thank you for your help, Unfortunately Im sorry I'm still battling.

I have an existing designer worksheet.

Dim designer As WorkbookDesigner = New WorkbookDesigner()

Dim workbook As Workbook = New Workbook

which already displays data from an existing OLEDB

connection con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("~/fpdb/passliabcapture.mdb"))

con.Open()cmd1 = New OleDbCommand("SELECT * FROM [Brokerrecon] WHERE [Comment] = @Comment ORDER BY Comment, Rdate", con)

cmd1.Parameters.Add(New OleDbParameter("@Comment",OleDbType.VarChar, 10))

cmd1.Parameters("@Comment").Value = v1

da.SelectCommand = cmd1

ds = New DataSet()

da.Fill(ds, "Brokerrecon")

Dim dt As DataTable = dsTables("BrokerRecon")

designer = New WorkbookDesigner()

        designer.Open(Server.MapPath("~/reports/brokereconind.xls"))
        designer.SetDataSource(dt)

designer.Process(True)

Dim name As String = Server.MapPath("~/reports/recon/" & v1 & “.xls”)
designer.Workbook.Save(“Report.xls”, FileFormatType.Default, Aspose.Cells.SaveType.OpenInExcel, Response)
con.Close()

The existing smart markers on the spreadsheet are referenced by @BrokerRecon.Fieldname

All I want to do is add the value of three input fields - which will form part of the headings/references on the sheet - from the .aspx form - into three cells on the spreadsheet generated by the existing code.

Dim designer As WorkbookDesigner = New WorkbookDesigner()

Dim workbook As Workbook = New Workbook(Server.MapPath("~/reports/brokereconind.xls"))

designer.Workbook = workbookDim v1 = CStr(Request.Form(“Comment”))

Dim start As Date = CDate(Request.Form(“From”))

Dim Finish As Date = CDate(Request.Form(“To”))

Dim cells As Cells = workbook.Worksheets(0).Cells

Dim cell As Aspose.Cells.Cell = cells(“B3”)

cell.PutValue(v1)

Dim cell1 As Aspose.Cells.Cell = cells(“B5”)

cell1.PutValue(start)

Dim cell2 As Aspose.Cells.Cell = cells(“B6”)

cell2.PutValue(Finish)


into cells B3, B5 and B6. I can do each seperately, but do not know how to combine the two sets of code to reproduce both the out pt on one sheet.

Hi,


Well, I could not understand your issue. For your information, when you use designer.Process, now rows are inserted and values are pasted into the cells of the rows autocratically based on your markers in the sheet. So, if you need to modify any value or insert new values into your desired cells, you have to put your code under designer.Process line and before your Workbook.Save() line.

If you still could not evaluate, kindly create a sample console (runnable) application, zip it and post it here with all the files. We will check your issue soon.

Thank you.