Determines whether or not the Crystal Report Engine can be closed. Use this function before calling PECloseEngine to verify that the engine is no longer processing print jobs. If the Crystal Report Engine closes while a print job is still running, an error can occur in your application or on the user's system.BOOL CRPE_API PECanCloseEngine (void); Return Value TRUE (1) if the Engine can be closed; FALSE (0) if the Engine is busy.
我把报表对象动态的卸掉了都不行,一定要把应用程序停下来才可以 您能给出具体的代码吗?
我尝试过,但内存没释放
Frmmain.CrystalReport1(1).PrintFileType = crptCrystal
Frmmain.CrystalReport1(1).PrintFileName = App.Path & "\" & "rpt\" & outfilename & ".rpt"
Frmmain.CrystalReport1(1).ReportFileName = App.Path & "\" & programname
Frmmain.CrystalReport1(1).connect = connect
Frmmain.CrystalReport1(1).SelectionFormula = SelectionFormula
Frmmain.CrystalReport1(1).ProgressDialog = False
Frmmain.CrystalReport1(1).Action = 1
我不太明白你说的
那怎样关闭报表引擎呢?
能给出关闭引擎的原码?
好像是crystal report本身的问题,升级到8.0会不会好一点呢?
关于报表对象释放问题,连crystal report教称本身也没有提到这样释放是不是有效。
:(
但可能用不行CrystalReport1控件
我也用过CrystalReport1控件,控件过多连VB都打不开,一直报内存不足
后来我改用了CrystalReport的API函数来编程就没问提了
CrystalReport的API函数的帮助在CrystalReport的安装目录下有
好像是DEVELOP目录
还有两个模块文件
用CrystalReport的API函数时要添加到工程中
试试吧.祝好运
关于我提出的几个函数,crystal report 6.0 的帮助中有详细说明
yell(飞空草)说的方法没有效果,
关于您用的方法,能否再说清楚点,
您用了哪几个CrystalReport的API函数,
能否发一份详细说明到 谢谢
(如果您能帮我度过难关,150分一定如数奉上)
-------------------------------------------------------------------------
调用crystal report控件打印两百来张报表后,系统内存会被耗尽,将应用程序重启后,
内存才能被释放。
打开windows的资源监视器,添加监视物理内存占用的项目,然后单步执行你的程序,观察到底那些语句占用内存不释放,然后再考虑解决方法~
Frmmain.CrystalReport1(1).Action = 1
Frmmain.CrystalReport1.PrintFileType = crptPagedText
Frmmain.CrystalReport1.PrintFileName = App.Path & "\" & "temp\" & outfilename & ".txt"
Frmmain.CrystalReport1.ReportFileName = App.Path & "\" & programname
Frmmain.CrystalReport1.connect = connect
Frmmain.CrystalReport1.SelectionFormula = SelectionFormula
Frmmain.CrystalReport1.ProgressDialog = False
Frmmain.CrystalReport1.Action = 1
If PECanCloseEngine Then
PECloseEngine
PEOpenEngine
End Ifyell(飞空草) ,我关了引擎,内存还是会涨,怎么办,怎么办!!
不过我找到一段代码
是我做的日本项目的代码发给你
重要步骤如下
1.将CrystalReport的API函数要用到的两个模块文件
添加到工程中
2.用CrystalReport工具做一个报表文件(.RPT)
重要函数如下
PEOpenEngine打开引擎
PEOpenPrintJob设定打印文件
PESetNthTableLogOnInfo设定ODBC名
PESetFormula设定报表文件参数值
PEDiscardSavedData使报表文件重新取数据
PEOutputToWindow报表文件以Window打开
PEOutputToPrinter报表文件输出到打印机
PEStartPrintJob打印报表
PEClosePrintJob关闭打印文件
PECloseEngine关闭引擎
祝早日完工.
ps:我发的SOURCE收到了吗
我收到了你的信,但还看不太懂,很多函数都要输入参数,
不知道要输入些怎样的参数,
还要多分析分析,
谢谢!
另外我现在在CrystalReport6.0的应用中也遇到了一个问题:我的程序在windows98下一切正常,但到了win2kServer下却打印不了.具体表现为:打印机提示有一个文档待打印,但却没有文件在打印队列中.如何解决呢
我也要用到打印,但我在WIN2000下没遇到你说得问题。
不过我用的是8.0
研究了数天,我还是不会用你说的那些CrystalReport的API函数,
不知道要输些什么参数进去,
我知道这强人所难了,但我也被逼无奈,
您能帮我把下面这些代码用CrystalReport的API函数翻译一下吗?
不胜感激Frmmain.CrystalReport1.Destination = crptToFile
Frmmain.CrystalReport1.PrintFileType = crptPagedText
Frmmain.CrystalReport1.PrintFileName = App.Path & "\" & "temp\" & outfilename & ".txt"
Frmmain.CrystalReport1.ReportFileName = App.Path & "\" & programname
Frmmain.CrystalReport1.connect = connect
Frmmain.CrystalReport1.SelectionFormula = SelectionFormula
Frmmain.CrystalReport1.ProgressDialog = False
Frmmain.CrystalReport1.Action = 1