我是新手,今天要做一个CXGRID导出到excel,只见网上的人都用cxExportGrid导出EXCEL,所以我下载了安装了!
但是怎么也没有看到cxExportGrid这个控件!请大家指教!这东东在什么地方?

解决方案 »

  1.   

    估计是控件没有正确安装不如下载全套DevExpress VCL,
    里面应该有你要的
      

  2.   

    1.首先你要确保你的cxgrid控件都正确的安装完毕
    2.uses cxExportGrid4Link 这个单元
    3.相关的导出函数,进行调用就行了
    procedure ExportGrid4ToHTML(const AFileName: string; AGrid: TcxGrid;
      AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'html');
    procedure ExportGrid4ToXML(const AFileName: string; AGrid: TcxGrid;
      AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'xml');
    procedure ExportGrid4ToExcel(const AFileName: string; AGrid: TcxGrid;
      AExpand: Boolean = True; ASaveAll: Boolean = True; AUseNativeFormat: Boolean = True;
      const AFileExt: string = 'xls');
    procedure ExportGrid4ToText(const AFileName: string; AGrid: TcxGrid;
      AExpand: Boolean = True; ASaveAll: Boolean = True; const ASeparator: string = '';
      const ABeginString: string = ''; const AEndString: string = '';
      const AFileExt: string = 'txt');
      

  3.   

    需要 USE cxExportGrid4Link 导出过程: procedure ExportGrid4ToExcel(const AFileName: string; AGrid: TcxGrid; 
      AExpand: Boolean = True; ASaveAll: Boolean = True; AUseNativeFormat: Boolean = True; 
      const AFileExt: string = 'xls'); 
      

  4.   

    DevExpress 好是好但是太复杂了,而且编译后目标文件会很大