We are able to reproduce the issue. The issue has been logged into our Issue Tracking System with ID CELLSNET-19619. We will update you as soon as possible.
We have looked into the issue in detail and investigated. The code is working. Sparkline is the feature of Excel 2010. We created an Xlsx file and tried to open it in Excel 2010. It all worked fine.
yes, the sample works fine, but the problem is if the worksheet name contains a space char (ie. New Sheet). To reproduce, please use the attached sample.
Regards
Rale
ps. following code will throw exception with msg "Invalid formula:"=!A1:A1"." when adding a sparkline group
Workbook wb = new Workbook(FileFormatType.Xlsx); // specify the dest file type
wb.Worksheets.Clear();
Worksheet ws = wb.Worksheets.Add("New Sheet");
ws.Cells["A8"].PutValue(34);
ws.Cells["B8"].PutValue(50);
ws.Cells["C8"].PutValue(34);
CellArea ca = new CellArea();
ca.StartColumn = 9;
ca.EndColumn = 9;
ca.StartRow = 6;
ca.EndRow = 6;
int idx = ws.SparklineGroupCollection.Add(Aspose.Cells.Charts.SparklineType.Column, ws.Name + "!A8:C8", false, ca);
Aspose.Cells.Charts.SparklineGroup group = ws.SparklineGroupCollection[idx];
We are working on this issue. We will update you as soon as possible. The issue has been logged into our Issue Tracking System with ID CELLSNET-19722. Thank you for your endurance.
Please use the updated version of Aspose.Cells.dll v5.1.2.5 attached. Please verify that if the sheet name contains some special char such as space char, it should have quotes around it when setting the sparkline data range. For example:
int idx = ws.SparklineGroupCollection.Add(Aspose.Cells.Charts.SparklineType.Column, "New Name" + "!A8:A10", true, ca); // invalid
int idx = ws.SparklineGroupCollection.Add(Aspose.Cells.Charts.SparklineType.Column, "'" + "New Name" + "'!A8:A10", true, ca); // valid
Furthermore, the following function may help you to check if the sheet name needs quotes:
just tryied out your change and it seems to be working. But I have another problem in case there has been insterted rows after group has been created. see code below for more details
regards
Rale
The sparkline group is not visible in this case
Workbook wb = new Workbook(FileFormatType.Xlsx); // specify the dest file type
Please accept my apologies on behalf of Salman Shakeel for the delay. Support developers of Aspose.Cells team were on holidays for few days which caused this delay but they are back to work from today so, please expect a reply today from our support team.
Moreover, our forum support is absolutely free which means whether your subscription has expired or not, our support team will always help you and answer your inquiries.
I ve got the fix but unfortunatelly I am unable to use it since my license has expired 10 days ago. Does this mean that I have to renew yearly subscription to get the bug fix?
You have to renew your yearly subcription in order to use the latest version.
Before renewing you can get a temporary 30 days license which will allow you to use the latest version with out any restrictions for 30 days free of charge. You can use this temporary license for testing purpose and once you have confirmation that the problem is fixed then you can renew your subscription.