1 (edited by rjkantor 2015-03-03 22:32:38)

Topic: Export to Excel Action

I would like the ability to not have the button enabled, until the table that is being used for the export has records selected into it.

Otherwise, the resulting excel sheet is empty and it appears nothing happened.


Thank you,
  Rob

Re: Export to Excel Action

Example:

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
     Form1.ButtonExcel.Enabled := Form1.TableGrid1.RowCount>0;
end;
Dmitry.

Re: Export to Excel Action

This does not work, if the user click on the export button  when the TableGrid is first displayed and is empty.  We need an onshow event for this to fire.

Rob

Re: Export to Excel Action

Yes, in the event OnShow of main form, you should put code

Form1.ButtonExcel.Enabled := False;
Dmitry.