문제

Hello I came across this problem a few months back and had time today to check out how to do it. I have a TDbgrid in which I apply a filter to filter contents of a Firebird database. I would like to print out the content after filtering it. I had researched and studied and this what I came up so far:

I put a Tprintdialog component on the page along with a Tbutton and had this code on it:

procedure Tviewrecord.Button3Click(Sender: TObject);
begin
 with PrintDialog1.Create(nil) do
    try
      if Execute then
        Dbgrid4.print;
    finally
      Free;
    end;

Problem is that when I am compiling, there is an error on the "print: part of the code.

Thanks.

도움이 되었습니까?

해결책

Your code fails to compile for the rather prosaic reason that the TDBGrid control does not have a Print method. You'll need to write the printing code yourself, or find a third party component with printing capabilities.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top