We were unable to observe this issue with the latest version: Aspose.Cells for .NET v16.11.6. Please download and try the latest version and see if it makes any difference in sorting out this issue.
If your issue still occurs with the latest version, then please provide us some simple console application project which we could run at our end and replicate the issue. We will look into it and update you asap.
Please provide us your simple console application with your older version. We will look into it. If there is any error in your code or if there is some workaround for you, we will update you asap.
Please check the following workaround and see if it works good for you. The idea is to find the last maximum cell using the max display range and then check if that cell is empty. If that cell is empty then add empty string inside it so that cell gets instantiated inside the worksheet. I have attached the output csv generated with this workaround and also displayed it in this post for your reference. Besides. I have also provided the full sample code and the smart marker excel file used inside it.
Workaround:
#region CELLSTEAM //Find your last maximum cell and check if it is null, then add empty string inside it
Worksheet sh = workbookDesigner.Workbook.Worksheets[0];
Range r = sh.Cells.MaxDisplayRange;
Cell c = sh.Cells[r.RowCount-1, r.ColumnCount-1];
if (c.StringValue == “”)
c.PutValue(""); #endregion
Here is the full sample code which you can execute at your end.
Full Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aspose.Cells;
using System.Data;
namespace TestCSV
{
class Program
{
static void Main(string[] args)
{
String templatePath = “…\…\Test.xlsx”;
WorkbookDesigner workbookDesigner = new WorkbookDesigner();
//Open a designer spreadsheet containing smart markers
workbookDesigner.Workbook = new Workbook(templatePath);
workbookDesigner.SetDataSource(GetTestData());
workbookDesigner.Process();
</font><font color="#0000ff">#region CELLSTEAM</font><font color="#800080">
//Find your last maximum cell and check if it is null, then add empty string inside it
Worksheet sh = workbookDesigner.Workbook.Worksheets[0];
Range r = sh.Cells.MaxDisplayRange;
Cell c = sh.Cells[r.RowCount-1, r.ColumnCount-1];