In this article, we will try to generate pipe-delimited output from BI Report by using a dummy template
Normally, we will create an etext template and explicitly mention the pipe delimiter after each column and then upload the etext template to generate the pipe delimited output.
Let’s consider a simple data set to pull the action information
SELECT B.ACTION_TYPE_ID,B.ACTION_TYPE_CODE,T.MEANING,B.BUSINESS_GROUP_ID
FROM PER_ACTION_TYPES_B B, PER_ACTION_TYPES_TL T
WHERE B.ACTION_TYPE_ID = T.ACTION_TYPE_ID
Let’s create a report with a dummy template.
Dummy Template – It could be blank or anything. We will be just using it as a medium to generate output file and we will not get the content of this template on the output.
Now, lets go to the Report properties > formatting tab
Search for the CSV and modify the attributes like below:
Click OK and then save it.
Now, go to the view list and select the “Data (CSV)” as output format and then select it as default output format.
Now click on save.
Click on View Report.
Here is how the output will look like with pipe delimiter:
Attributes with values having a space character will be enclosed in double quotes.
We are using the seeded CSV functionality over here to generate comma-separated text, however, we are overriding the delimiter to pipe.
Advantage with this approach is it is very easy to generate the pipe delimited output.
Drawbacks using this approach is like we cannot modify the sequence of fields, add header, etc. If there are any input parameters, then those would also get added to the output at the beginning of the file for each row.
Based on your requirement you can use this approach if the file format is straightforward, else go with the etext template and customize the output as per the need.
We can also use similar delimiter Semicolon(;), Tab(\t), Pipe(|), Comma(,)