|
XML Publisher实现动态打印图片,大容量的也可以
/*图片转码*/
function cux_getlogo(p_ou_id number) return CLOB is
l_result CLOB;
begin
select cux_getbase64string(cl.IMAGE_BLOB) into l_result
from cux_logo cl
where cl.IMAGE_ID=p_ou_id;
RETURN l_result;
END;
b.主程序打印报表
Procedure xxx_name is
l_logo CLOB;
l_org_id NUMBER;
l_length NUMBER;
BEGIN
Fnd_File.Put_Line(Fnd_File.Output,
'<?xml version = ''' || '1.0' || ''' encoding = ' ||
'''UTF-8' || '''?>');
Fnd_File.Put_Line(Fnd_File.Output, '<MODULE1>');
Fnd_File.Put_Line(Fnd_File.Output, '<LIST_G_SORT_SEQ>');
取主组织org_id及LOGO
BEGIN
SELECT ood.OPERATING_UNIT
INTO l_org_id
FROM org_organization_definitions ood
WHERE ood.ORGANIZATION_ID = c1.organization_id
AND rownum = 1;
l_logo := cux_common_pkg.cux_getlogo(l_org_id);
--看大小
l_length := length(l_logo);
--循环put
EXCEPTION
WHEN OTHERS THEN
l_logo := NULL;
END;
Fnd_File.Put_Line(Fnd_File.Output, '<COMP_LOGO>');
FOR i IN 1 .. ceil(l_length / 255) LOOP
fnd_file.Put(fnd_file.OUTPUT, substr(l_logo, 255 * i - 254, 255));
Fnd_File.Put_Line(Fnd_File.Output, '</COMP_LOGO>');
Fnd_File.Put_Line(Fnd_File.Output, '</LIST_G_SORT_SEQ>');
Fnd_File.Put_Line(Fnd_File.Output, '</MODULE1>');
END;
word 输出需要添加以下代码
<fo:instream-foreign-object content-type="image/gif"><xsl:value-of select="COMP_LOGO"/></fo:instream-foreign-object> |
|