Categories
- All Categories
- Oracle Analytics Learning Hub
- 25 Oracle Analytics Sharing Center
- 17 Oracle Analytics Lounge
- 233 Oracle Analytics News
- 45 Oracle Analytics Videos
- 15.9K Oracle Analytics Forums
- 6.2K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 87 Oracle Analytics Trainings
- 15 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
Create download link for Blob fields in OBIEE report,
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.
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
Answers
-
The syntax you posted isn't for BI Publisher but for an analysis in OBIEE.
When you create an analysis you have various kind of visualizations (table, pivot, bar chart, pie chart etc.), one is called "narrative" and support the syntax you posted. It's a way to generate content with the result of the query of the analysis.
The narrative view will output the result of Prefix + looping over every row of result applying Narrative + Postfix.
With the code you posted you must be sure to have only 1 row of result because it isn't meant to work for multiple rows (it can, but you will need to adapt things quite a bit.
@2 and @4 are used to reference the 2nd and 4th column of the row of result being looped over.
0 -
By the way, you were asking for BI Publisher in a MOSC forum, and now you posted this in a public forum with content of a MOS document: it's borderline with the rules, MOS documents content can't be posted in the public forum (because MOS documents are a resource you need to pay support to have access).
If you have questions for OBIEE you can post them in the OBIEE category in the MOSC Forum: https://community.oracle.com/mosc/categories/obiee (it's named Oracle Analytics Server because that's the new name of OBIEE, but the you can clearly see from the link that's just OBIEE).
0 -
Thank you Gianni for your response.
I get it.
I will create a technical SR instead.
0
