You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2013/07/17 13:15:35 UTC

[Bug 55275] New: HSSF - createCellComment seems limited to 1000 cell comments by sheet

https://issues.apache.org/bugzilla/show_bug.cgi?id=55275

            Bug ID: 55275
           Summary: HSSF - createCellComment seems limited to 1000 cell
                    comments by sheet
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: minor
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: truciops@gmail.com

hello,

It seems there is a limitation (approximately 1 000) of the number of 'cell
comments' on a sheet with POI-Excel.

But why ? 
With OpenOffice, and Excel, we can, manually, more than 1 000. 
So can we make more, cell comment on a sheet, than 1 000 ? Like 3 000-4 000 :)

Regards

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 55275] HSSF - createCellComment seems limited to 1000 cell comments by sheet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55275

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 OS|                            |All

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
What happens if you try to add more? Does POI object? Office? OpenOffice? Can
you write a unit test that shows the issue? Does the limit change from file to
file? Does it vary based on the length of text in the comment?

If you create several thousand comments in Excel or OpenOffice, does it use a
different kind of record/records to what POI does? (BiffViewer may help you
work that out)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 55275] HSSF - createCellComment seems limited to 1000 cell comments by sheet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55275

zhibin fang <si...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.9-FINAL                   |3.10-FINAL

--- Comment #3 from zhibin fang <si...@gmail.com> ---

hello,

Our project will need to import the excel for some data init. cell will be
added the comment about the reasons of error, so there may be add more than
1024 comments, but will only display the last 1024.

Regards

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 55275] HSSF - createCellComment seems limited to 1000 cell comments by sheet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55275

nb <tr...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #2 from nb <tr...@gmail.com> ---
Hello,

If i try to add more : there is only the last comments on my sheet. :'(

See below my little test to view that it's not fine :

import java.awt.Desktop;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.Comment;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

public class truc {

    private static File FILERESULT;

    private Workbook ExcelPlanDeTravail;
    //private CreationHelper ExcelPlanDeTravailFactory;
    private Sheet mafeuille;
    private Row laligne;
    private Cell lecellule;
    private ClientAnchor commentairepanel;
    private Drawing commentairedessin;

public truc(){
    try{
    //============================================
    ////////////// - \\\\\\\\\\\\\\\\
    //============================================
    FILERESULT = File.createTempFile("ExtractXLS",".xls");
     FILERESULT.deleteOnExit();

     //============================================
    ////////////// - \\\\\\\\\\\\\\\\
    //============================================
    ExcelPlanDeTravail = new HSSFWorkbook();
    mafeuille = ExcelPlanDeTravail.createSheet("test");
    //ExcelPlanDeTravailFactory = ExcelPlanDeTravail.getCreationHelper();


    if(commentairedessin==null){        
        commentairedessin = mafeuille.createDrawingPatriarch();
    }


    int m = 1;
    for (int i=0;i<30;i++){

        laligne = mafeuille.createRow(i);

        for (int u=0;u<50;u++){

            lecellule = laligne.createCell(u);
             lecellule.setCellValue(m);
            setCellComment(lecellule, i+"="+u);
            m++;
        }

    }



    } catch (Exception monerreur) {
        monerreur.printStackTrace();
    } finally {
        try {
            FileOutputStream fichiersorti = new
FileOutputStream(FILERESULT.getAbsolutePath());
            ExcelPlanDeTravail.write(fichiersorti);
            fichiersorti.close();
        } catch (Exception monerreur) {
            monerreur.printStackTrace();
        } finally {
            //============================================
            ////////////// OUVERTURE FICHIER \\\\\\\\\\\\\\
            //============================================
            if(FILERESULT.exists()==true){
                if(Desktop.isDesktopSupported()){
                   
if(Desktop.getDesktop().isSupported(java.awt.Desktop.Action.OPEN)){
                    try {
                        Desktop.getDesktop().open(new
File(FILERESULT.getAbsoluteFile().toString()));

                    } catch (IOException monerreur) {
                        //
                    }
                    } else {
                        //
                    }
                }else {
                    //
                    }
            }
        }
    }

}
protected void setCellComment(Cell cell, String message) {
    commentairepanel =
ExcelPlanDeTravail.getCreationHelper().createClientAnchor();
    commentairepanel.setCol1(lecellule.getColumnIndex() + 2);
    commentairepanel.setCol2(lecellule.getColumnIndex() + 9);
    commentairepanel.setRow1(lecellule.getRowIndex() + 2);
    commentairepanel.setRow2(lecellule.getRowIndex() + 9);

    Comment comment = commentairedessin.createCellComment(commentairepanel);
    RichTextString str =
ExcelPlanDeTravail.getCreationHelper().createRichTextString(message);
    comment.setString(str);
    comment.setAuthor(System.getProperty("user.name"));

    cell.setCellComment(comment);
}


}

Rgds

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org