We are using Aspose.cells in one of our application and we are having issues to get the non-contiguous ranges. Please let us know how we can get these ranges using Aspose.
Attaching the sample excel in which we have 3 named ranges. Range name ‘one’ is identified by the Aspose but not
other two. Please help
Hi, The above post regarding non continuous range we posted in 2013 and we have implemented successfully as you suggested but very recently we are using the same code but with latest version of aspose version=18.5.1, it stopped working. Any idea what are we doing wrong here? oXRngs count gives zero. Let me know if you need any other details.
foreach (Name namedRange in oXWb.Worksheets.Names)
{
if (namedRange.Text.ToUpper() == oDSWorksheet.SheetRange.ToUpper())
{
Range[] oXRngs = namedRange.GetRanges();
if (oXRngs != null)
{
//throw new ArgumentNullException("Worksheet is missing Contiguous Ranges - " + oDSWorksheet.Name);
}
}
}
Please share your sample file and runnable code snippet with us for our testing. We will reproduce the problem and provide our feedback after analysis.
I have tried your sample project with versions 18.4, 18.5, 18.5.1, 18.6 and 19.1. I am afraid that no difference is observed in the output of all these versions. Could you please have a look at the output of all these versions and identify the issue? Provide details along with the images for our analysis.
Hi
As I mentioned it could find the range that I am looking for but its not able to find we ask for GetRanges which gives the count zero, same template worked with old versions and used to return all the range values. I have attached the screen shots for your referenceUntitled.png (74.2 KB) Untitled1.png (92.8 KB)
.
@Cnu,
You may please download the output file from the following link:
Also please provide us the detailed steps to reproduce this issue as no difference is observed using your sample project with different versions mentioned above. We will analyze your information and provide feedback accordingly.
I am afraid that these images are not clarifying the exact issue. As mentioned above, I have executed your code with different versions, but could not observe any difference among the outputs created by them. Please provide us comparison of old versions and new versions using images and detailed description. Also mention the exact versions which are used for those comparisons. We will analyze information in detail and provide our feedback.
We have investigated your scenario a bit, for the “namedRange” object which gives zero length of ranges, the range references are all external. For external data it is not possible to create Range object. Maybe it is a bug for old versions which can create ranges for this defined Name and we think the generated Range object may reference to an incorrect sheet. So, for the external references, Name.GetRanges() is not the proper way to get the “range”. If you do need to get the similar “range” information for it, we may make further investigation to provide a solution.
Hi
Thank you for doing further investigation on this. Problem here is the previous version is ignoring the external range references, considering only the range referenced within the same excel and process was working as expected. Newer version of the aspose with the same template is considering the external range and returns zero length. So in our production system its failing do the required business functionality. is this something bug in older or newer I am not sure. Let me know if you need any more information.
For a detailed investigation, please share the exact version which was working as per your expectation. It will help us to observe the issue and provide assistance.
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation. Once, we will have some news for you, we will update you in this topic.
This issue has been logged as
CELLSNET-46598 - Name.GetRanges() behavior difference in old and new versions