Standard Report Column in Oracle APEX - oracle-apex

What's the difference between a Standard Report Column and one that is set to Display as Text (escape special characters)?.How can you ensure that the data displayed in a Standard Report Column is safe?

A standard report column does not escape special characters. So if you have data in the column that contains HTML like <script>alert('hello');</script> then a standard report column will cause a browser alert to appear saying "hello", whereas the display as text columns would just display the text <script>alert('hello');</script>.
You should only use s Standard Report Column when you need the column to render some HTML (rather than display it as text) - for example, to display an image in a report, or an input field etc. In those cases you need to ensure that you are in control of the data that is being displayed in that column - which you typically will be. If any data that appears in the column is entered into the database by users then you need to ensure it does not contain anything special - e.g. use htf.escape() function to make it safe.

Related

Is there a way to create a char(13) delimited string that can be used in Power BI?

I am creating a report in Power BI and would like to create an client address string that is formatted as a standard line-delimited postal address in the United States.
I tried creating a DAX measure, but could not get around the error:
A single value for column 'ServiceAddress1' in table 'pbiCoverPage' cannot be determined.
This error occurs if I try to use the DAX TRIM function on any TEXT column for a Measure.
As a workaround, I created a SQL View that returns a CHAR(13) delimited string with a postal address.
However, if I display the field in a card visual, the CHAR(13) do not create separate lines. The postal address is displayed on a single line with the CHAR(13) interpreted as a spaces.
My questions are:
Can text fields be used at all in DAX Functions such as TRIM in a Measure?
Is there a Power BI Visual, other than 'Card' that can display text on a report?
Displaying a postal address should not be a difficult task. Is there a simple way to do this in Power BI?'
Is there any way to use a Text Box in Power BI to show a field value? I think this would allow me to left-justify the address string.
If I try to add a Value to a text box, I get a message:
To turn of Q&A, we need to create a local index of your data. If you publish the report, we'll one in the service as well.
I am researching this message. It seems like I am driving a tack with a sledge hammer. Is there an easier way to display a formatted text string in Power BI?
I tested the following approaches:
Use a Button. The button supports text alignment and has word-wrap. However, it does not support line delimiters such as CHAR(10) or CHAR(13).
Use the HTML Content Custom Visual from:
https://www.html-content.com/
The HTML Content control allows you to write SQL Queries that return HTML that includes the <br> line-break tag.
Thus far, the HTML Content visual is the only way (short of a custom R or Python visual) to display a string (such as a postal address) with multiple delimited lines in Power BI.

PowerBI Embedded - Formatting disappears on render

I have a PowerBI report built in PowerBI desktop and displaying in a .net app using javascript. We have basic cards with decimal values formatted as currencies or percentages (in the formatting ribbon in PowerBI desktop). When the embedded report first displays in the web app, the formatting symbols ($, %) show for a split second and then disappear. I've removed layout and any extra style sheets and javascripts from the page, but still get the behavior. Have also set the localSettings in the JS config. Any ideas?
It's not a great solution, but a potential workaround would be to format the values using the FORMAT function which changes them to be text strings in the format you define rather than numeric values that get formatted however it decides.
For example, if you have a [measure] you can define another one like this:
measure_formatted = FORMAT ( [measure], "$ #,0.00")

How do I make Power bi show all data as is and not as error?

I have a set of data ~36 000 rows from which in one column there are numbers and numbers with text (100567563; WT1632366; 3275-2422 etc.) I need it to show the data as it is. It's not an error and I have tried changing what the data is (text numbers general in excel and in Power bi with no success. Any tips?
In power bi ensure that you have the datatype of that column as text, It works absolutely fine for me.
Power Query previews the dataset, and determines the datatype from the first 1000 rows. From your question I'm going to assume that the first lot of previewed rows are numerical.
You can order your Excel file to have the first rows as 'WT1632366' then when it loads the data it will convert it to the text/string type, and load the numerical columns as text.
If you look in the query editor, you will see a 'changed type', you can see the column name and the format. In the below image I have a column called 'Data' you can change it from:
"Data", Int64.Type
to
"Data", type text
And it should load.
Note: If you insert a step after it that does this, it may still not load and error
In the image, the first 1200 rows are the number 1, the 1201 row is the text 'ABC' this will fail on load unless you change formating to text. You can do this by clicking on the column and clicking on the '123' and change it from the selection to text. If it asked to replace current step use that option.
Once the datatypes are set it will not reavelate them on later loads, so you don't have to worry about data type changes

Is there a way that POWERBI does not agregate all numeric data?

so, I got 3 xlsx full of data already treated, so I pretty much just got to display the data using the graphs. The problem seems to be, that Powerbi aggregates all numeric data (using: count, sum, etc.) In their community they suggest to create new measures, the thing is, in that case I HAVE TO CREATE A LOT OF MEASURES...Also, I tried to convert the data to text and even so, Powerbi counts it!!!
any help, pls?
There are several ways to tackle this:
When you pull a field into the field well for a visualisation, you can click the drop down in the field well and select "Don't summarize"
in the data model, select the column and on the ribbon select "don't summarize" as the summarization option in the Properties group.
The screenshot shows the field well option on the left and the data model options on the right, one for a numeric and one for a text field.
And, yes, you never want to use the implicit measures, i.e. the automatic calculations that Power BI creates. If you want to keep on top of what is being calculated, create your own measures, and yes, there will be many.
Edit: If by "aggregating" you are referring to the fact that text values will be grouped in a table (you don't see any duplicates), then you need to add a column with unique values to the table so all the duplicates of the text values show up. This can be done in the data source by adding an Index column, then using that Index column in the table and setting it to a very narrow with to make it invisible.

Power BI Desktop doesn't honor percentage column type

I've imported data (approximately 200 columns) into Power BI desktop (latest version as of 2017-08-02) and have explicitly told the app to treat a number of columns as being percentages. Within the query editor, I can verify that my values are treated as such:
When I put my data into a table, they show up as normal floats, not percentages. When I click on the exact same column as in the above picture and view it in the Modeling tab, Power BI shows it as being "General" format:
While I can go through and change the formatting here to have them all be percentages, I have already done so in the query editor! Is there a way to make PBI recognize my already specified format?
Short answer: No.
Explanation:
In the query editor, you didn't actually specify any format. What you specified is the data type, so that the source data can be read correctly. Say you have a column with data like 001, you can specify it as text type so you can retain the leading zero.
However, the actual formatting (i.e. data presentation) is done in your second step, because even if it's a (decimal) number, you can still format it as a percentage, with different decimal places, etc. (vice versa)