really basic question. how to use the checkbox?

Hello,
Sorry but I am new to fast report.

I have a firebird3 query with IBX and some boolean fields. the database recognize the boolean type and display checkbox correctly.

in my report, the text fields are print fine but the checkbox are always empty. I have tried to use the OnBeforePrint event to force the value to true, but it is still blank

what can go wrong?

procedure CheckBox1OnBeforePrint(Sender: TfrxComponent);
begin
Checkbox1.Checked:=true;
end;

Thanks.

Comments

  • edited March 2018
    Hello,

    You dont have to check the Checkbox manually. Try to use Checkbox's Dataset and Datafield option in Checkbox properties or from code section like :

    Checkbox1.DataSet
    Checkbox1.DataField


    and use report start event from tfrxreport.

    Pictures attached.

    Regards,
    boakoms.
    kccheng wrote: »
    Hello,
    Sorry but I am new to fast report.

    I have a firebird3 query with IBX and some boolean fields. the database recognize the boolean type and display checkbox correctly.

    in my report, the text fields are print fine but the checkbox are always empty. I have tried to use the OnBeforePrint event to force the value to true, but it is still blank

    what can go wrong?

    procedure CheckBox1OnBeforePrint(Sender: TfrxComponent);
    begin
    Checkbox1.Checked:=true;
    end;

    Thanks.
  • edited 1:30PM
    Thanks for your information.
    But I found the problem. in CheckStyle, only csLineCross and csPlus are actually printing. csCheck and csCross are printing as empty.
    I am using Lazarus, maybe it is a bug.
  • edited 1:30PM
    please check the attachment. 4 different checkbox with 4 different checkstyle.
    only csLineCross and csPlus is printing.
  • edited 1:30PM
    I found the problem.

    I changed variable S to widestring and use TextOut() instead of ExtTextOut() to draw for both checked and unchecked handler.

    The API ExtTextOut() doesn't support unicode. The value 251 and 252 is above 0x7F and they conflicts with DBCS. I don't know how to access ExtTextOutW() in Lazarus so I replaced it with TextOut() instead.

    the code is in frxChBox.pas, function procedure TfrxCheckBoxView.DrawCheck(ARect: TRect);

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.