Hi,
I am exporting the data from dhtmlxgrid to Excel. Everything works fine. Now I want to add static text “This data is confidential” at the end/bottom of the exported spreadsheet. How can I do that?
Thanks
Hi,
I am exporting the data from dhtmlxgrid to Excel. Everything works fine. Now I want to add static text “This data is confidential” at the end/bottom of the exported spreadsheet. How can I do that?
Thanks
Hi,
there is no public api for this, but you can modify the sources.
check ExcelWriter.cs
you can manipulate cells contents with sheet.cells[row, coll].Value property
following code should work
sheet.cells[headerOffset + 1, 1].Value = "This data is confidential";
sheet and headerOffset are private variables
Which method can I set the static text in ?
footerPrint(), rowsPrint() or headerPrint()
Thanks
If you adding static text at the bottom of the page, you need to do it after all rows are rendered so the headerOffset will be pointing to the empty cell.
You can replace watermarkPrint code(which currently does nothing) with the followingprivate void watermarkPrint(ExcelXmlParser parser){
sheet.Cells[(uint)(headerOffset + 1), 1].Value = watermark;
}