Hello ,
We have a table with id and a blob file that stores pdf, docx etc
We want to create a report in BI Publisher like the following
id Download-Link
---------------------------
1 Link1
2 Link2
.. Linkxx
When clicking at Link1 Link2 ..etc a download of the blob ( pdf or docx ) must start.
Although i got an answer that BI does not support this feature (only images not pdf) i found an unofficial hack at the following address.
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=357738351345703&id=2106746.1&displayIndex=7&_afrWindowMode=0&_adf.ctrl-state=165xa8gsmc_4
However i can't understand how i can achieve this. I am new to BI and i know to create data models and reports but i cannot understand how to set the following
Prefix:
<a href="" id="myLink">Download File Again</a>
Narrative:
<script>
var fname= '@2';
var hexdata= '@4';
Postfix:
var byteArray = new Uint8Array(hexdata.length/2);
for (var x = 0; x < byteArray.length; x++){
byteArray[x] = parseInt(hexdata.substr(x*2,2), 16);
}
var blob = new Blob([byteArray], {type: "application/octet-stream"});
var a=document.getElementById("myLink");
a.href = window.URL.createObjectURL(blob);
a.download = fname;
a.click();
</script>
Thank you