内存异常。导出的Word文件太大了 [英] Out of Memory Exception. Exported Word Files are too big

查看:264
本文介绍了内存异常。导出的Word文件太大了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我编写了一个使用Crystal Reports XI的应用程序。我目前有两个问题,希望有人可以帮助我:



第一个问题是,当以Word格式导出文档时,水晶报表会创建近200 Mb的单词文档,例如PDF文档只有1-2 Mb。有没有办法减少Word中导出文档的大小,因为首先程序崩溃,其次我想将这些文档作为电子邮件中的附件发送。



我们所起的代码示例如下:


PdfRtfWordFormatOptions word_export_opts = ExportOptions.CreatePdfRtfWordFormatOptions();



word_export_opts.UsePageRange = false ;



oReportDoc.ExportOptions.FormatOptions = word_export_opts;


oReportDoc.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;


oReportD oc.ExportOptions.ExportFormatType = ExportFormatType.WordForWindows;



//磁盘文件目的地选项


< p class = MsoNormal style ="margin:0cm 0cm 0pt"> DiskFileDestinationOptions dOpt = ExportOptions .CreateDiskFileDestinationOptions();



dOpt.DiskFileName = SPATH + QUOT; \\tmp_" + sFile;


oReportDoc.ExportOptions.DestinationOptions = dOpt;



oReportDoc.Export();




第二个问题是我安装了应用程序在具有OS Windows 2000终端服务器的计算机上,其中甚至没有任何报告在我们的应用程序中加载。报告无法加载时,我们收到"内存不足异常"。有没有其他人有这个问题。我已经安装了所有最新的服务包;我还将系统临时目录放在D:那里有足够的空间。



< span lang = EN-GB> 非常感谢


Bleddyn



< span lang = EN-GB>


解决方案

 我们遇到了同样的问题......


 


你有解决方案吗?


&NBSP;


您可以发送电子邮件至 mstassen@datamex.nl


Currently I have written an application that uses Crystal Reports XI. I currently have two issues, which hopefully someone can help me with:

 

The first issue is that when exporting documents in Word Format, crystal reports creates word documents of nearly 200 Mb, where for example a PDF document is only 1-2 Mb. Is there a way of reducing the size of an exported document in Word, as first of all the program is crashing and secondly I want to send these documents as attachments within emails.

 

An example of the code we are suing is as follows:

PdfRtfWordFormatOptions word_export_opts = ExportOptions.CreatePdfRtfWordFormatOptions();

                       

                        word_export_opts.UsePageRange = false;

 

                        oReportDoc.ExportOptions.FormatOptions = word_export_opts;

                        oReportDoc.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;

                        oReportDoc.ExportOptions.ExportFormatType = ExportFormatType.WordForWindows;

 

                        // Disk File destination options

                        DiskFileDestinationOptions dOpt = ExportOptions.CreateDiskFileDestinationOptions();

 

                        dOpt.DiskFileName = sPath + "\\tmp_" + sFile;

                        oReportDoc.ExportOptions.DestinationOptions = dOpt;

 

                        oReportDoc.Export();

 

 

The second issue is that I have installed the application on a machine with OS Windows 2000 Terminal Server, where none of the Reports are even being loaded within our application. We are receiving an 'Out of memory exception' when the report fails to load. Has anyone else had this problem. I have installed all the latest service packs; I have also placed the System Temp Directories on the D: where there is plenty of space.

 

Many Thanks

Bleddyn

 

 

 

解决方案

 We have the same problem...

 

Do you have a solution already ??

 

You can mail me at mstassen@datamex.nl


这篇关于内存异常。导出的Word文件太大了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆