ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: luckduck on April 20, 2026, 09:23:49 am

Title: pqGrid Excel Export – How to Set Cell Borders and Row Height (Headers & Data)
Post by: luckduck on April 20, 2026, 09:23:49 am
Hello,

I have a question regarding exporting pqGrid data to an Excel file.

When exporting, I would like to customize:

   - Borders for both header cells and data cells
   - Row height for headers and data

However, I’m finding it difficult to implement this using only the API documentation. It would be very helpful if you could provide a sample example demonstrating how to apply these styles during export.

Additionally, in my current implementation, I’ve noticed that when a grid cell value is null, the border is not applied in the exported Excel file. I would appreciate it if you could confirm whether this is expected behavior or if there is a way to handle it properly.

Thank you in advance for your help.
Title: Re: pqGrid Excel Export – How to Set Cell Borders and Row Height (Headers & Data)
Post by: paramvir on April 20, 2026, 06:25:21 pm
Customizing pqGrid Excel Export via Callbacks

Borders and row heights can be efficiently managed using the each* callbacks within the exportData method. This approach allows you to inject htFix for dimensions and border objects for styling directly into the export engine.

htFix: Applied to the row object to set a fixed height in pixels.
border: Applied to the cell object using a CSS-like string syntax (e.g., "1px solid #000000").
Code: [Select]
eachCell(cell, ci, ri){
if(ri==2 && ci == 2){
//debugger
cell.border = {
top: "1px dotted #ff0000",
bottom: "1px solid #ff0000",
}
}
},
eachRowHead(row, ri){
row.htFix = 100
},
eachRow(row, ri){
row.htFix = 50
}

I was able to apply borders to empty cells and it was exported correctly.