Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

String Problem

edited February 2010 in General
Hi,

while generating code128 Barcodes i found a bug in Reportbuilder 11.07:

If you use a string concatenation in the form

s:= CHR(208)+'Value';

inside a Reportbuilder event, the char-code 208 is APPENDED to the Value,
whereas

s:= CHR(208);
s:= s+'Value';

gives the correct value.

The following Procedure generates the Error "The barcode must begin with
#208 ..."

procedure BarCode1OnPrint;
var s:string;
begin
s:= CHR(208)+'F1000273';
BarCode1.Data := s;
end;


Greetings

Stefan Kirchhoff
HS-Media GmbH
Germany

Comments

  • edited February 2010
    Hi Stefan,

    In my testing with your exact code below, I was unable to recreate the issue
    (with AutoEncode set to True or False). Which version of Delphi are you
    using? Note that if you are using the AutoEncode feature, you should not
    need to manually encode the barcode. This will be done automatically.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2010
    Hi Nico,

    I use Delphi 7. Autoencode is Disabled.

    It has nothing to do with the Barcode component.
    Simply put a Label on a report with the following Reportbuilder-Procedure
    (RAP):

    procedure Label6OnPrint;
    begin
    Label6.caption:= CHR(65)+'Hallo';
    end;

    CHR(65) is 'A' - on the preview the label is printed as "HalloA"!

    If i use
    Label6.caption:= 'A'+'Hallo';
    everything is ok - "AHallo" is printed.

    Greetings
    Stefan Kirchhoff
    HS-Media GmbH


  • edited February 2010
    For future reference, please either let us know you are using RAP before
    asking a question, or post RAP questions in the RAP newsgroup.

    There is now a patch available for RB 11.07 that solves this issue. Send an
    email to support@digital-metaphors.com to receive the patch.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.