fastexcel icon indicating copy to clipboard operation
fastexcel copied to clipboard

Adding information about the author of the comment.

Open CamilYed opened this issue 4 months ago • 2 comments

Hi, could you extend the fast-excel API with the ability to add, also, information about the author of the comment?

After generating the excel file, I unfortunately have a rather ugly comment.

image

The current implementation as you can see is quite flawed.

    void writeComments(Writer w) throws IOException {
        w.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        w.append("<comments xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">");
        w.append("<authors><author/></authors>");
        w.append("<commentList>");
        for (Map.Entry<Location, String> entry : cache.entrySet()) {
            Location location = entry.getKey();
            w.append("<comment ref=\"");
            w.append(location.toString());
            w.append("\" authorId=\"0\"><text><t>");
            w.appendEscaped(entry.getValue());
            w.append("</t></text></comment>");
        }
        w.append("</commentList></comments>");
    }

https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.comments?view=openxml-3.0.1

CamilYed avatar Mar 18 '24 14:03 CamilYed