1 function for MDIChils

From: Arda Han (arda_at_han.com)
Date: 10/30/03


Date: Thu, 30 Oct 2003 14:43:17 +0200

Hi Everybody.

I am using MDI style application. I have a main form It is Mainmform. And I
have some special designed different forms. ProductForm, SalesForm etc. I
have a toolbar on the Mainform. It is have a button it is Export to Excel
button.I want control my Excel export requeste's with this Function. For
example If user click Export to Excel button. I must export ActiveMDIChild
dbgrid1 (all forms have a Tdbgrid and all form dbgrid names are dbgrid1) to
Excel. I try some codes but it isn't running. My code :

procedure TFRMUretim.ExportOther(AGridExportType: TGridExportType);
var
  AGrid: TcxGrid;
begin
  AGrid := TMDIChild(ActiveMDIChild).cxGrid1;
  case AGridExportType of
    exHTML:
      ExportGrid4ToHTML('Export.Html', AGrid);
    exXML:
      ExportGrid4ToXML('Export.Xml', AGrid);
    exExcel:
      ExportGrid4ToExcel('Export.Xls', AGrid);
    exText:
      ExportGrid4ToText('Export.Txt', AGrid);
  end;
end;

But I have problem with code Because this code have a compiler error.
cxGrid1 undeclared.

What is your suggestion for this.

Best regards

Mehmet


Quantcast