qq1210974091
未安、
采纳率42.9%
2017-08-07 03:29 阅读 2.0k

求助! C# winform GridControl 导出Excel出现内存溢出的问题!

使用的是DevExpress 15.1 的版本导出的是2007的xlsx格式的Excel
代码中使用的是CompositeLink类的ExportToXlsx()方法

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • qq_23126581 郭老师的小迷弟雅思莫了 2017-08-07 03:40

    你这么问我们怎么回答?最起码代码贴上

    点赞 评论 复制链接分享
  • qq1210974091 未安、 2017-08-07 04:14

    具体代码:
     DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem()
     DevExpress.XtraPrintingLinks.CompositeLink link = new DevExpress.XtraPrintingLinks.CompositeLink(ps); 
    ps.Links.add ( link );
    link.Links.Add ( CreatePageForEachLink() );
    link.Landscape= true;
    DevExpress.XtraPrinting.XlsxExportOptions optio具体代码:
     DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem()
     DevExpress.XtraPrintingLinks.CompositeLink link = new DevExpress.XtraPrintingLinks.CompositeLink(ps); 
    ps.Links.add ( link );
    link.Links.Add ( CreatePageForEachLink() );
    link.Landscape= true;
    DevExpress.XtraPrinting.XlsxExportOptions options = new DevExpress.XtraPrinting.XlsxExportOptions();
    link.ExportToXlsx(FileName, options); 

                        public PrintableComponentLink( IPrintable printable )
                        {
                               CharControl char printable as ChartaControl;
                                    if ( chart !=null )
                                    {
                                         chart.OptionPrint.SizeMode = DevExpress.XtraCharts.Printing.PrintSizeMode.Stretch;
                                    }
                                    PrintableComponentLink printableLink = new PrintableComponentLink () { Component = printable };
                                    return printableLink;
                        }ns = new DevExpress.XtraPrinting.XlsxExportOptions();
                        link.ExportToXlsx(FileName, options); 
    
    
    
                        public PrintableComponentLink( IPrintable printable )
                        {
                               CharControl char printable as ChartaControl;
                                    if ( chart !=null )
                                    {
                                         chart.OptionPrint.SizeMode = DevExpress.XtraCharts.Printing.PrintSizeMode.Stretch;
                                    }
                                    PrintableComponentLink printableLink = new PrintableComponentLink () { Component = printable };
                                    return printableLink;
                        }
    
    点赞 评论 复制链接分享
  • qq_16514611 MR丨Snowice 2017-12-14 04:00

相关推荐