ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: luckduck on April 20, 2026, 12:55:50 pm

Title: pqGrid Excel Export – replace parameter
Post by: luckduck on April 20, 2026, 12:55:50 pm
I have an additional question regarding the exportData function in pqGrid.

The `replace` option does not seem to work as expected. I’m not sure if I am using the syntax incorrectly or if there is another issue.

Here is a sample of my code:

Code: [Select]
var blob = await grid.exportData({
    // url: "exportData.do",
    format: format,
    nopqdata: true, // applicable for JSON export
    render: false,
    sheetName: "Example",
    replace: [/<br\/>/g, '\r\n']
});

if (typeof blob === "string") {
    blob = new Blob([blob]);
}

saveAs(blob, excelNm + "." + format);

The goal is to replace <br/> tags with line breaks (\r\n) in the exported file, but it does not seem to be applied.

Could you please confirm whether:
1. The `replace` option syntax is correct?
2. There are any limitations or conditions where `replace` does not work?
3. There is an alternative way to handle line breaks during export?

Any help would be appreciated.
Title: Re: pqGrid Excel Export – replace parameter
Post by: paramvir on April 20, 2026, 07:14:21 pm
Code: [Select]
<br>
Code: [Select]
var blob = await grid.exportData({
  format: format,
  nopqdata: true,
  render: false,
  sheetName: "Example",
  eachCell: function(cell) {
     //examine cell.value
  }
});