|
窗体添加UniHTMLFrame控件
html属性为
[mw_shl_code=javascript,true]<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Web报表(B/S报表)演示 - 最简单例子,用插件在网页中展现报表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="CreateControl.js" type="text/javascript"></script>
</head>
<body style="margin:0">
<script type="text/javascript">
CreatePrintViewerEx("100%", "100%", "files/simple.grf", "files/simple.xml", true, "");
</script>
</body>
</html>[/mw_shl_code]
simple.grf simple.xml 放到files目录下
server模块初始化添加mime定义,解决权限问题
[mw_shl_code=delphi,true]procedure TUniServerModule.UniGUIServerModuleCreate(Sender:TObject);
begin
MimeTable.AddMimeType('grf','grf report');
end;[/mw_shl_code]
server模块中cutomfiles添加CreateControl.js文件,ok
实际引用时,替换files/simple.grf为应用的grf模板,程序生成对应的xml文件,替换files/simple.xml
|
|