format() function inside a memo
I have memo control that contain value like this
[fdataset."field_name"]
This produce numbers like 1, 2, 3 so I want it to format it to be like this 001, 002, 003 . I tried to use format but I always get error, please advise what syntax I should use for format
function ?
Another question I tried to write in the code script syntax like that
I am trying to get numbers like this 2-3 but I always get error Could not convert variant of type (UnicodeString) into type (Double) although both fields has numbers.
please advise
[fdataset."field_name"]
This produce numbers like 1, 2, 3 so I want it to format it to be like this 001, 002, 003 . I tried to use format but I always get error, please advise what syntax I should use for format
function ?
Another question I tried to write in the code script syntax like that
var
vNo3: string;
procedure ReportTitle1OnBeforePrint(Sender: TfrxComponent);
begin
vNo3 := <frdsMain."DAY_SEQ"> +'-'+ copy (<frdsMain."SQ_ID">, 1, 2);
end;
I am trying to get numbers like this 2-3 but I always get error Could not convert variant of type (UnicodeString) into type (Double) although both fields has numbers.
please advise
Comments
in the first case leave the content of the memo empty
2 in the obp event of the band containing the memo get the value of the datafield and convert to a string
and add that string to your tempstringvariable then set the memo text to the tempstring value
3 in the second case turn allow expressions for the memo off
Thanks but when I tried to write the format function inside the memo I get error , here is what I tried:
Second way: [Format('000', [<dataset."field_name">])]
This way result in printing 000 although [dataset."field_name"] alone print 2
[Format('%3.3d', [Round(<dataset."field_name">)])]
Thanks formatfloat work fine
Thank you so much this comment has saved my life watered my crops and thatched my roof.
I spent forever pulling my hair out about this error but I had accidentally set a random Memo box to Time/Date Format and didn't even think to check that