[]
        
(Showing Draft Content)

IQRCode

Interface IQRCode

All Superinterfaces:
IBarcode

public interface IQRCode extends IBarcode
Represents a barcode object created by the BC_QRCODE formula.

This interface represents the QR Code symbology result returned by BC_QRCODE. It extends IBarcode and exposes QR Code-specific settings such as ErrorCorrectionLevel, model, version, mask pattern, structured append connection, character code, and character set.


 worksheet.getRange("A1").setValue("www.example.com");
 worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"H\",1,\"auto\",\"auto\",FALSE,0,,\"UTF-8\",4,4,4,4)");
 IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
 ErrorCorrectionLevel level = qrCode.getErrorCorrectionLevel();
 int model = qrCode.getModel();
 
  • Method Details

    • getErrorCorrectionLevel

      ErrorCorrectionLevel getErrorCorrectionLevel()
      Gets the error correction level used by the BC_QRCODE formula result.

      This value specifies the level of data recovery available when the QR Code is damaged or partially obscured.

      
       worksheet.getRange("A1").setValue("1234567890");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"H\",2,\"auto\",\"auto\",FALSE,0,,\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       ErrorCorrectionLevel errorCorrectionLevel = qrCode.getErrorCorrectionLevel();
       
      Returns:
      The error correction level used by the QR Code.
    • getModel

      int getModel()
      Gets the QR Code model used by the BC_QRCODE formula result.

      The default value is 2.

      The example below explicitly sets the model to 1.

      
       worksheet.getRange("A1").setValue("1234567890");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"L\",1,\"auto\",\"auto\",FALSE,0,,\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       int model = qrCode.getModel();
       
      Returns:
      The QR Code model.
    • getVersion

      int getVersion()
      Gets the QR Code version used by the BC_QRCODE formula result.

      For Model 1, the version range is 1 to 14. For Model 2, the version range is 1 to 40. This property supports auto configuration, represented by -1, as well as explicit numeric version values.

      
       worksheet.getRange("A1").setValue("1234567890");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"L\",2,\"auto\",\"auto\",FALSE,0,,\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       int version = qrCode.getVersion();
       
      Returns:
      The QR Code version. Returns -1 if the version is configured automatically.
    • getMask

      int getMask()
      Gets the mask pattern used by the BC_QRCODE formula result.

      Specify any value between 1 and 7; auto configuration is -1.

      
       worksheet.getRange("A1").setValue("1234567890");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"L\",2,\"auto\",\"auto\",FALSE,0,,\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       int mask = qrCode.getMask();
       
      Returns:
      The mask pattern of the QR Code. Returns a value from 1 to 7, or -1 if the mask is configured automatically.
    • getConnection

      boolean getConnection()
      Gets whether connection is used for the barcode.

      This property indicates whether the QR Code uses structured append connection.

      
       worksheet.getRange("A1").setValue("1234567890");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"L\",2,\"auto\",\"auto\",TRUE,1,,\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       boolean connection = qrCode.getConnection();
       
      Returns:
      true if connection is used for the barcode; otherwise, false.
    • getConnectionNo

      int getConnectionNo()
      Gets the connection number for the barcode.

      This value identifies the structured append connection number used by the QR Code.

      
       worksheet.getRange("A1").setValue("1234567890");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"L\",2,\"auto\",\"auto\",TRUE,1,,\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       int connectionNo = qrCode.getConnectionNo();
       
      Returns:
      The connection number for the barcode.
    • getCharCode

      String getCharCode()
      Gets the character code information used by the BC_QRCODE formula result.

      This value maps to the tenth argument of the BC_QRCODE formula and is distinct from the QR Code content stored in the referenced cell.

      
       worksheet.getRange("A1").setValue("Example");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"L\",2,\"auto\",\"auto\",FALSE,0,\"1234567890\",\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       String qrContent = qrCode.getValue();
       String charCode = qrCode.getCharCode();
       
      Returns:
      The character code information used by the QR Code.
    • getCharSet

      String getCharSet()
      Gets the character set used by the BC_QRCODE formula result.

      This value specifies which charset is used to encode the QR Code. Optional charsets include UTF-8, SHIFT-JIS, and SHIFT_JIS.

      
       worksheet.getRange("A1").setValue("Example");
       worksheet.getRange("B1").setFormula("=BC_QRCODE(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",\"L\",2,\"auto\",\"auto\",FALSE,0,,\"UTF-8\",4,4,4,4)");
       IQRCode qrCode = (IQRCode) worksheet.getRange("B1").getValue();
       String charSet = qrCode.getCharSet();
       
      Returns:
      A string that represents the charset used by the QR Code.