dear support
Hi,
attached you have a very simple project.
ay feedback on this - I was planning to work on this in the weekend…
Hi Guido,
Thanks for your posting and using Aspose.Cells for GridWeb.
We were able to replicate this issue with the latest version. It works fine with the older version though.
I have attached the following files for a reference
- GridWeb-OlderVersion-Test.zip - This is a test project with the older version which works fine.
- GridWeb-NewerVersion-Test.zip - This is a test project with newer version that does not work fine.
- source1.xlsx - This is the source Excel file used inside the projects.
- readme.docx - This highlights the issue of loading new Excel file
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
- CELLSNET-43174 - Loading a new excel file does not work anymore in latest gridweb
Hi Guido,
Thanks for using Aspose.Cells for GridWeb.
The basic internal logic is changed, however it will not affect customer so much. Before the import file, you do not need to call clear function anymore.
If your code is below:
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
GridWeb1.WebWorksheets.Clear()
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
The instance of the workbook is kept, after you call clear, there is
no sheets left in the workbook instance, the next time you import the instance, all the sheets is already clear.
Your code shall change to:
Dim ms1 As New System.IO.MemoryStream(System.IO.File.ReadAllBytes("D:\grid_project\form_attachments\CELLSNET-43174.xlsx"))
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
End Sub
I just appended the multiple clear and importExcelfile statements in the testing phase, as to debug the problem.
End Sub
End Sub
Hi Guido,
Thanks for your posting and using Aspose.Cells for GridWeb.
Actually, we are suggesting you not to call clear method. Just import your Excel file inside the GridWeb without calling GridWeb1.WebWorksheets.Clear() method. GridWeb will automatically clear the web worksheets in second import excel file.
So your following code
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
GridWeb1.WebWorksheets.Clear()
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
will be like this
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
the problem is still there.
Hi Guido,
Thanks for your feedback and using Aspose.Cells for GridWeb.
We will look into these issues further and fix them and update you asap.
Hi Guido,
Thanks for using Aspose.Cells for GridWeb.
I have tested this issue with another sample project which I have attached for development team reference and was able to replicate this issue.
I tested this issue with the following sample code. Initially, it loads source1.xlsx file, then on clicking button1, it should load source2.xlsx file and on clicking button 2, it should load source3.xlsx file. But on clicking button 1 and button 2, it does nothing as you have said.
I have logged these findings against this issue. Please spare us some time. Once, there is some further update for you, we will let you know asap.
VB.NET
Partial Class _Default
Inherits System.Web.UI.Page
'Public Shared asposecellslicense As String = My.Computer.Registry.GetValue(“HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MWorks”, “AsposeCellsLicense”, “”)
Public Shared licenseweb As New Aspose.Cells.GridWeb.License
Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles form1.Load
If GridWeb1.IsPostBack Or Page.IsPostBack Then Exit Sub
licenseweb.SetLicense(“F:\Shak-Data-R\Aspose\License\Aspose.Total.lic”)
'licenseweb.SetLicense(asposecellslicense)
GridWeb1.Width = New Unit(1000, UnitType.Point)
GridWeb1.Height = New Unit(600, UnitType.Point)
Dim ms1 As New System.IO.MemoryStream(System.IO.File.ReadAllBytes(“F:\Shak-Data-RW\Downloads\source1.xlsx”))
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
GridWeb1.WebWorksheets.RunAllFormulas()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim ms1 As New System.IO.MemoryStream(System.IO.File.ReadAllBytes(“F:\Shak-Data-RW\Downloads\source2.xlsx”))
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
Dim ms1 As New System.IO.MemoryStream(System.IO.File.ReadAllBytes(“F:\Shak-Data-RW\Downloads\source3.xlsx”))
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
End Sub
End Class
Hi Guido,
Thanks for using Aspose.Cells for GridWeb.
Please use GridWeb1.ImportExcelFile(ms1) instead of GridWeb1.WebWorksheets.ImportExcelFile(ms1)
webworksheets is obsolete now.
you do not need to call calculateformula after import file
Please see the following code below
Partial Class _Default
Inherits System.Web.UI.Page
'Public Shared asposecellslicense As String = My.Computer.Registry.GetValue(“HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MWorks”, “AsposeCellsLicense”, “”)
Public Shared licenseweb As New Aspose.Cells.GridWeb.License
Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles form1.Load
If GridWeb1.IsPostBack Or Page.IsPostBack Then Exit Sub
licenseweb.SetLicense(“F:\Shak-Data-R\Aspose\License\Aspose.Total.lic”)
'licenseweb.SetLicense(asposecellslicense)
GridWeb1.Width = New Unit(1000, UnitType.Point)
GridWeb1.Height = New Unit(600, UnitType.Point)
Dim ms1 As New System.IO.MemoryStream(System.IO.File.ReadAllBytes(“F:\Shak-Data-RW\Downloads\source1.xlsx”))
GridWeb1.WebWorksheets.ImportExcelFile(ms1)
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim ms1 As New System.IO.MemoryStream(System.IO.File.ReadAllBytes(“F:\Shak-Data-RW\Downloads\source2.xlsx”))
GridWeb1.ImportExcelFile(ms1)
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
Dim ms1 As New System.IO.MemoryStream(System.IO.File.ReadAllBytes(“F:\Shak-Data-RW\Downloads\source3.xlsx”))
GridWeb1.ImportExcelFile(ms1)
End Sub
End Class
Ok, thank you.
I have another problem now, related to the use of worksheets and webworksheets
Hi,GuidoDeBouver:
Ok, thank you.That works fine !! thanks for pointing me to the solution.However, I am a liitle bit worried that Aspose changes the object model without notification. I now have to go,edit and retest all my programs. What other changes have been implemented without me knowing ? The release notes of version 8.3 says nothing about this change. Something to consider for next release !Anyway, thank you for your help and this wonderfull product !guido
Thanks for your posting and using Aspose.Cells.
I have logged your concern and comment in our database against this issue. We will look into it and update you asap. Once, there is some news for you, we will let you know.
So how to get the seteditablerange working in version 8.3 ( see my above post ??? )
Hi Gudio,
Thanks for your posting and using Aspose.Cells for GridWeb.
I tested your first issue related to webworksheets getting 0 but was unable to replicate it. However, I noticed some different issue. When the new file is loaded with import excel file method, it shows the worksheets count of previously loaded workbook.
Could you please provide me seteditablerange which works with previous version? I will test the code with latest version and in case of some error, I will log it in our database for a fix.
Thanks for your cooperation.
yes, indeed, the problem I was seeing was because webworksheets is not properly updated.
Hi Guido,
Thanks for using Aspose.Cells for GridWeb.
I have attached the sample web project that illustrates this issue. WebWorksheets are not updated after calling GridWeb.ImportExcelFile method.
When you run this project and click the buttons, you will see the count of web worksheets are not correct sometime
I have also attached all the source Excel files used in this project.
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
- CELLSNET-43195 - WebWorksheets are not updated after calling GridWeb.ImportExcelFile
GuidoDeBouver:
yes, indeed, the problem I was seeing was because webworksheets is not properly updated.Seteditablerange works properly, it is the update of webworksheets that is the problem.If you could raise this as an issue and get it fixed in the next version - that would be great.