Hi. Thanks for a great product. I'm using Aspose.Cells v3.9.1.2. I'm trying to set a row's style and it does not seem to apply to the row. I have tried saving the output out as SpreadSheetML and the style does not appear within the document, although the cell do refer to it. Attached is the designer spreadsheet I have been using. I have also included the code I have used to generate this issue and the saved SpreadsheetML. Thanks for all your help.
-- Joel
Code
using System.IO; using Aspose.Cells;namespace ClassLibrary1
{
[TestFixture]
public class Class1
{
[Test]
public void SetRowStyle()
{
Workbook workBook = new Workbook();
using (FileStream templateStream = new FileStream(“MediaPlanStyleBugTest.xls”, FileMode.Open, FileAccess.Read, FileShare.Read))
{
workBook.Open(templateStream);
}int curRow = 1; for (int setCounter = 0; setCounter < 2; setCounter ++) { for (int rowCounter = 0; rowCounter < 2; rowCounter++) { workBook.Worksheets[0].Cells[curRow, 0].PutValue("Test"); if (rowCounter == 0) { workBook.Worksheets[0].Cells.Rows[curRow].Style = workBook.Styles["Shaded"]; } curRow++; } } workBook.Save("MediaPlanStyleBugTest_Output.xls"); } }
}
SpreadsheetML
<?xml version="1.0" encoding="utf-8"?><?mso-application progid="Excel.Sheet"?>
<?xml:namespace prefix = x /> 3 <?xml:namespace prefix = o /> Joel Baranick AtlasDMT <?xml:namespace prefix = ss /> Test Test Test Test TESTA0 TESTA1 TESTA2 TESTB0 TESTB1 TESTB2 TESTC0 TESTC1 TESTC2 1 600 600 9 1280 1280 9 0 0 EVALUATION COPYRIGHT WARNING This file is created using EVALUATION VERSION of Aspose.Cells. Evaluation Limitations: 1 This EVALUATION LICENSE WARNING worksheet will be added to all worksheets created with Aspose.Cells. 2 The usage of this Evaluation Version in any Commercial Application is strongly PROHIBITED. 3 Any Violation to the Usage Policies of this Product shall require a mandatory purchase of pay license as well as expose the user to other legal recourse for collection and punitive damages. 9 0 0