Hi, we wanted to populate data horizontally for a specific array. So we used a horizontal parameter, but it is not working as expected. Please check the attachment. Thanks
horizontal.zip (15.8 KB)
It seems you’re experiencing issues with populating data horizontally in your Excel worksheet using Aspose.Cells. To assist you effectively, please ensure that you are correctly implementing the logic for setting data horizontally in your code.
Here’s a basic example of how to populate data horizontally in a worksheet:
using Aspose.Cells;
public void PopulateDataHorizontally(Workbook workbook, string[] data)
{
Worksheet worksheet = workbook.Worksheets[0];
for (int i = 0; i < data.Length; i++)
{
worksheet.Cells[0, i].PutValue(data[i]); // Populate data in the first row
}
}
Ensure that the data array is correctly populated and that you are referencing the correct worksheet. If the issue persists, please provide more details about how you are using the horizontal parameter, and I can help troubleshoot further.
Feel free to share any specific code snippets or error messages for more targeted assistance!
Thanks for the template Excel file and JSON data.
I tested your scenario/case and I reproduced the issue as you mentioned by using your template Excel file with JSON file. I found “horizontal” parameter of Smart Markers is not working as per expectation when using with specific array in JSON data. If we remove the parameter, it works fine.
Workbook workbook = new Workbook("d:\\files\\horizontal\\matrix_placement1.xlsx");
WorkbookDesigner workbookDesigner = new WorkbookDesigner(workbook);
String jsonData = new String(Files.readAllBytes(Paths.get("d:\\files\\horizontal\\matrix-placement.json")));
workbookDesigner.setJsonDataSource("node", jsonData);
workbookDesigner.process();
workbook.save("d:\\files\\horizontal\\out1.xlsx");
We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSJAVA-46503
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
We are pleased to inform you that your issue (Ticket ID: “CELLSJAVA-46503”) has been resolved. The fix/enhancement will be included in the upcoming release (Aspose.Cells v25.10) that we plan to release in the first half of October 2025. You will be notified in this thread once the new version is published.
The issues you have found earlier (filed as CELLSJAVA-46503) have been fixed in Aspose.Cells for Java 25.10.
Hi Team,
Could you please check and help me with this issue? The Aspose tags placed in horizontally corresponding cells are not fetching data, whereas the vertically corresponding tags are working correctly.
Could you please zip and attach the template Excel file, the JSON data file, your sample runnable code, and the output Excel file to help us reproduce the issue. We will check your issue soon.
You’ll find the required documents attached below, please review them
Horizontal_File.7z (15.1 KB)
Below are the code,
private void testExcelTemplate2() {
try {
// String baseDir = "C:\\work\\centric\\repos\\generation-service-document";
String baseDir = "C:\\work\\centric\\issues";
// String baseDir = "C:\\work\\centric\\aspose_queries\\excel";
String fileDirPath = baseDir + "\\DCMNT-Horiz";
// String filename = "\\valid-template-array-direct-access-using-index-with-range-1.xlsx";
// String filename = "\\employees-001.xlsx";
String filename = "\\matrix_placement.xlsx";
String filePathname = fileDirPath + filename;
Workbook workbook = new Workbook(filePathname);
// ReplaceOptions replaceOptions = new ReplaceOptions();
// replaceOptions.setCaseSensitive(true);
// replaceOptions.setMatchEntireCellContents(false);
// workbook.replace("_DGAAS_ARRAY", "-", replaceOptions);
sanitizeWorkbook(workbook);
// WorkbookDesigner designer = new WorkbookDesigner();
WorkbookDesigner designer = new WorkbookDesigner(workbook);
//designer.setContainsVariables(hasContainsVariables(workbook));
designer.setCalculateFormula(true);
// designer.setSortDataSource(true);
// designer.setWorkbook(workbook);
// String dataFilePath = "\\employees-data.json";
String dataFilePath = "\\matrix-placement.json";
// String dataFilePath = "\\template-nested-index-data.json";
String data = new String(Files.readAllBytes(Paths.get(fileDirPath + dataFilePath)));
System.out.println(data);
prepareExcelDataSources(designer, data);
processRangesByWorksheet(designer, workbook, "test");
System.out.println("smart markers: " + Arrays.toString(designer.getSmartMarkers()));
designer.process();
final String outPath = fileDirPath + "\\out" + "_" + System.currentTimeMillis() + ".xlsx";
workbook.save(outPath);
System.out.println("Saved file: " + outPath);
} catch (Exception e) {
throw new RuntimeException(e);
}
@pgcentric
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSJAVA-46530
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The result will be same as res.zip (7.2 KB) if this issue is fixed. Does it fit your need?
@simon.zhao
Thank you for the update and for creating the ticket CELLSJAVA-46530.
We confirm that the result matching res.zip (7.2 KB) would fully meet our requirements.
We appreciate your efforts and will await the fix in accordance with the Free Support Policies.
Please take your time.
@rupali14
Thank you for your feedback. You are welcome. We will notify you immediately once there are any updates.
Moreover, please note, the fix will be included in the upcoming release (Aspose.Cells v25.11) that we plan to release in the first half (approximately between the 10th and 15th) of November 2025. You will be notified when the next version is released.
Thank you for the update. We appreciate your prompt assistance and look forward to the upcoming release.