AX与CrystalReport接口

void ViewCrystalReport() 

Com comapp; 
Com reporting; 
str paramwhole; 
str paramfilename; 
str paramCond; 
str ViewYesNo; 
int ret; 
COMVariant variant; 



variant = new COMvariant(COMVariantInOut::OUT,COMVariantType::VT_BOOL) ; 
paramwhole = this.args().parm(); 
comapp = new COM("CrystalRuntime.Application.11"); 

ret = strfind(paramwhole,"|",2,strlen(paramwhole)); 

paramfilename = substr(paramwhole,2,ret-2) ; 
ViewYesNo = substr(paramwhole,1,1); 
reporting = comapp.openreport(paramfilename); 
reporting.discardsaveddata(); 
reporting.readrecords(); 

paramcond = substr(paramwhole,ret+1,strlen(paramwhole)); 

reporting.RecordSelectionFormula(paramCond); 

if(ViewYesNo == 'N') 

variant.boolean(false); 
reporting.PrintOut(variant); 

else 

ActiveX.ReportSource(reporting); 
ActiveX.width(1200); 
ActiveX.height(750); 
ActiveX.DisplayToolbar(true); 
ActiveX.DisplayGroupTree(false); 
ActiveX.Refresh(); 
ActiveX.ViewReport(); 
ActiveX.Refresh(); 



}
 
 
 
 

posted on 2015-04-27 11:44  Kobe.Zhang  阅读(219)  评论(0编辑  收藏  举报

导航