Hi,

Here is the fix for ranges parsing: (TableTable.java)

   /**
    * Sets the value of the tablePrintRanges property.
    *
    * @param value allowed object is {...@link String }
    *
    */
   public void setTablePrintRanges(final String value) {
       if (value == null || !value.contains(":")) {
           throw new IllegalArgumentException("ranges is null");
       }
       this.tablePrintRanges = value;

       final int s = value.indexOf(':');
       final String l = value.substring(0, s);
       final String r = value.substring(s + 1);

       String vl = l.substring(l.indexOf('.') + 1);
       String vr = r.substring(r.indexOf('.') + 1);
       vl = removeDollars(vl);
       vr = removeDollars(vr);

       {
           int j = 0;
           for (int i = vl.length() - 1; i >= 0; i--) {
               final int c = vl.charAt(i);
               if (Character.isLetter(c)) {
                   final int val = c - 'A' + 1;
                   this.printStartCol += val * Math.pow(26, j);
                   j++;
               } else {
                   this.printStartRow = i;
               }
           }
final String substring = vl.substring(vl.length() - this.printStartRow);
           this.printStartRow = Integer.valueOf(substring) - 1;
           this.printStartCol--;
       }
       {
           int j = 0;
           for (int i = vr.length() - 1; i >= 0; i--) {
               final int c = vr.charAt(i);
               if (Character.isLetter(c)) {
                   final int val = c - 'A' + 1;
                   this.printStopCol += val * Math.pow(26, j);
                   j++;
               } else {
                   this.printStopRow = i;

               }
           }
final String substring = vr.substring(vr.length() - this.printStopRow);
           this.printStopRow = Integer.valueOf(substring) - 1;
           this.printStopCol--;
       }
   }

   private final String removeDollars(String s) {
       final int length = s.length();
       final StringBuilder t = new StringBuilder(length);
       for (int i = 0; i < length; i++) {
           char c = s.charAt(i);
           if (c != '$') {
               t.append(c);
           }
       }
       return t.toString();
   }


I'm looking at fixing the renderer.
Stay tuned :)

Regards,
Guillaume

thanks for your quick response. I had a search on your source file,
and I think there is a little mistake on the
Tabletable.setTablePrintRanges :
           final String substring = vr.substring(vl.length() -
this.printStopRow);
Shouldn't you use
           final String substring = vr.substring(vr.length() -
this.printStopRow);

cause when I specify a range that stays in the "one letter", it works
fine. But it's not working with a $A$1:$AK$11


To specify a "right" range don't solve my printing problem. Still,
nothing happen when I click OK from the print dialog.
can be really cool of you if you can help me with that.
thanks



Reply via email to