首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

RCP中打开一个rptdesign的表格

2012-08-28 
RCP中打开一个rptdesign的报表String id org.eclipse.birt.report.designer.ui.editors.ReportEditorI

RCP中打开一个rptdesign的报表

String id =  "org.eclipse.birt.report.designer.ui.editors.ReportEditor";  IProject project = null;IPath location = null;    project = FileHelper.getReportPath();location = project.getLocation();location = location.append(reportName+ ".rptdesign");File file = location.makeAbsolute().toFile();String absultePath = file.getAbsolutePath();                             IFile iFile = project.getFile(location.lastSegment());FileEditorInput fileEditorInput = new FileEditorInput(iFile);PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(fileEditorInput, id);



它需要调用的方法:
 FileHelper.getReportPath(){ //导出产品xxx[默认为eclipse]目录下的文件夹ReportIWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();IProject project = root.getProject("Report");if (!project.exists()) {project.create(null);}if (!project.isOpen()) {project.open(null);}return project; }

热点排行