SQL Report columns formatting
Hi Everyone,
I've got a basic report with a column that is a concatenation of other columns (used for break formatting), and I want to give the effect that there are still separate 'columns' in the concatenation. I've tried using CHR(9) and RPAD in the SQL query to add the 'whitespace' but as soon as Apex gets hold of it, the extra spaces are removed and I'm left with only a single space.
It does the same thing when the "Display As" value is changed to either "standard report column", or any of the "Display as text" types.
Any ideas? This is apex 4.0.0
Thanks!
I've got a basic report with a column that is a concatenation of other columns (used for break formatting), and I want to give the effect that there are still separate 'columns' in the concatenation. I've tried using CHR(9) and RPAD in the SQL query to add the 'whitespace' but as soon as Apex gets hold of it, when the browser renders the output in accordance with the HTML spec the extra spaces are removed and I'm left with only a single space.The HTML specification instructs user agents to collapse white space characters, so spaces and ASCII tabs in options will be treated as a single space.
In a standard report use
<li><tt>white-space: pre</tt> in the CSS Style property for a CSS approach
or
<li>The HTML Expression property for a <tt><pre></tt> HTML wrapper (ensuring the Display Text As column attribute is Standard Report Column rather than the default Display as Text (escape special characters) ):
<pre>#COLUMN_NAME#</pre>Better still, create a custom report template using suitable mark-up so that there are "separate columns" in the report.
Similar Messages
-
What are valid values for the reports column format field?
Can't find it in the help, searched the forum and looked in a selection of the pre-defined reports. Very few of the reports seem to have columns defined, and the one I did find was something like {0,date,medium}.
It would make more sense to use something like SQL*Plus column formats,I am familiar with the to_char(number) function. I just tried it in the report as suggested. It does not format the columns in the user defined report. I tryed the same statement using a number in sqlplus and it worked fine.
This is what I'm trying to do, I copied the free space report so I could get a %free and i'm trying to format the numbers.
to_char(kbytes_alloc,'999G999G999G999D99) "Allocated MB".
I want the numbers to have 2 decimal places.
There is a column tab when creating a user defined report that would imply it formats that column.
Thank you in advance for help. By the way, I'm using the 1.1.0.21 build MAIN 21.7 -
Changing Sql Report Column width
Hi,
I am using Apex 4.1
Can anyone tell me how we can change the width of Sql report. For IR report we can do it using the following code,
<style>
table.apexir_WORKSHEET_DATA td[headers="Col Name"] {
_width: 500px;
min-width: 400px;</style>
Please help me with Sql Report.
Thanks,
Shoaib
Edited by: Shoaib581 on Jan 21, 2013 3:05 AMShoaib581 wrote:
Hi,
I am using Apex 4.1
Can anyone tell me how we can change the width of Sql report. For IR report we can do it using the following code,Always post code using <tt>\...\</tt> tags:
<style>
table.apexir_WORKSHEET_DATA td[headers="Col Name"] {
_width: 500px;
min-width: 400px;</style>
Please help me with Sql Report.Either use the same CSS approach by adding a static region ID to the report region and adding the style sheet to the page HTML Header:
<style>
#static-region-id td[headers="COL_ALIAS"] {
width: 400px;
<style>OR
Use the Column Definition > Column Width column attribute to set the width in pixels (note that this value is just the number of pixels "400", no unit is specified as in CSS).
OR
Use the Column Formatting > CSS Class column attribute to set the width of the column contents:
display: block; width: 400px; -
Report column format specification
I know, I can use TO_CHAR function in the SQL query to specify the column format for a user defined report. But, there is a separate tab for formatting columns when you creating a new report.
Does anyone know how to specify the column format in the "Create Report Dialog" box?
I tried with "999,999.99" and "###,###.##", doesn't seem to work.
Thanks,
Senthil.Itt appears that on Vista/11G/SQLDev 5440 in the Create report dialog ..
report child query column formatting is lost (not saved)
report parent query column formatting according to java formats detailed here http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html
such as ###,### do not take effect -
Dynamic Selection of Report Column Format
Is it possible to dynamically set the number format on a report column? I thought it would be as easy as setting the 'Number/Date Format' to a session state variable such as &NUMBER_FORMAT. However, when I tried this the column returned the following value ##########.
Any ideas?
Thanks,
DavidOK, this is a favorite hack of mine combined with Sergio's suggestion. Essentially, we select the column twice, display it with one column using Sergio's idea and sort it on another hidden and unformatted copy of the column (hope I didn't lose you yet):
1) Add another column of the same source to the query and give it an alias:select ename,to_car(sal,'&NUMBER_FORMAT.') sal,sal sal_sort
from emp2) Edit the report > report attributes > sal_sort column attributes. In the HTML Expression field, type #SAL#.
3) On the report attributes page, unclick the "Show" column for sal.
Now you are displaying the SAL column in the SAL_SORT column allowing the reporting engine to properly sort the column based on the unformatted SAL_SORT. I use this technique a lot for quarters. I'll show Q105, but it's sorting on an actual date behind the scenes.
Happy hacking!
Tyler -
I've created quite a wide SQL report (over 20 columns) and for some reason the data in some columns is being wrapped which looks quite scruffy. Is there any way to set all the column widths to automatically expand to accommodate the contents?
Hi ,
You can make a copy of the report template that you are using and modify it to unwrap columns. To do so go to the report page and on right hand side under Templates you would see Report template name that you are currently referencing. click on the copy icon next to the template and give it a new name. Now edit the new template and add no wrap to the Column template 1 section.
sample code
<td headers="#COLUMN_HEADER_NAME#" #ALIGNMENT# class="t20data" nowrap>#COLUMN_VALUE#</td>Now all you have to do is reference this template in your report. Click on report and under Layout and Pagination -> Report Template , select new template from drop down list and click on apply changes.
Hope this helps.
Thanks,
Manish -
In 9.0.2, I need to make 1 of my report column headings print as the system date.
ie.
Purchases on 05-SEP-02.
BALLS
BATS
Is there any way to do this in the column formatting page of reports?Hi,
You cannot have sysdate in the column heading. You can put only in the additional plsql code section.
Thanks,
Sharmila -
How to make the column heading bold / apply color to the column heading when Heading type used is PL/SQL ?
SanjayLavanya,
The report column attributes page has a radiogroup of column heading types. One lets you specify a PL/SQL function that returns the headings.
Scott -
Interactive Report Column Formating '%' symbol
Hi,
I have an intercative report that shows a column displaying a number and and the sysmbol %. The source query is similar to:
SELECT my_number||'%' as display_percentile
FROM dual;
Because of this the interactive report will only show this column as a string type and not number type, therefore my math filtering options are not available. Is there a way that I can display the column as a number type and still have it display as 50%
I am using Application Express 4.1.0.00.32
Thanks in advance.
Edited by: 968358 on 05-Dec-2012 02:09
Edited by: 968358 on 05-Dec-2012 02:10968358 wrote:
Thank you fac586,
Forgive me, I am a newbie at this and I am still at a loss. Where can I change the report column attributes to reflect css and alike. Do I need to do this on the report template or in the column attributes. When I have looked in the column attributes I cant see anywhere other than on the column link.Add a style sheet using the page HTML Header property attribute:
<style>
/* Replace COLUMN_ALIAS with the alias of the % column in your report */
td[headers="COLUMN_ALIAS"]:after {
content: "%";
</style> -
How to update the sql report column create using Htmldb_item
Hi,
I have a updateable sql report,which consist of htmldb_item like
htmldb_item.hidden(1,a.id) "ID",
htmldb_item.display_and_save(2,a.question,2,100) "Question",
htmldb_item.text(3,b.answer,20,1000) "Answer"
now in the report 'answer' coloumn i have made updateable,but my question is how to create the valdiation on the answer coloumn of the report.
As i been to page source and for all the record of the answer coloumn the array id is f03, so how to identify the particular 'answer' on the report and give the validation for them...
ThanksValidations in Apex are designed to operate upon individual page items that you have defined on the page, not tabular form elements.
Search the forum for other techniques you can use
http://forums.oracle.com/forums/search.jspa?objID=f137&q=tabular+form+validate+declaratively+javascript -
Display Image in Report Colum, ORA-06502: PL/SQL whe column format is set
Hi @all
i created a small table
CREATE TABLE my_sal201 (
grafikdid VARCHAR2(38) NULL,
grafik BLOB NULL,
mimetype VARCHAR2(255) NULL
then i inserted one column with a page process
BEGIN
IF (:p6_filename IS NOT NULL)
THEN
INSERT INTO my_sal201
(grafikdid, grafik, mimetype)
SELECT meb_ora.mkdid(), blob_content, 'image/gif'
FROM wwv_flow_files
WHERE NAME = :p6_filename;
DELETE wwv_flow_files
WHERE NAME = :p6_filename;
:p6_filename := NULL;
END IF;
END;
after that i want to show the columns and the image in a report. so i created a report in a new region quite similar to the example in the obe
it works fine, the image columns is shown as "[datatype]"
whenever i change the format of the image colum of the report to
DOWNLOAD:MY_SAL201:GRAFIK:GRAFIKDID::::::inline:Herunterladen
(just one example, IMAGE:... does not work as well)
no more rows are shown but the error h3. "ORA-06502: PL/SQL: numerischer oder Wertefehler: Fehler beim Konvertieren von Zeichen zu Zahl"
what did i do wrong?
gretz
peteri'm to silly to work with images :-ß
i did copy ur example to another app on http://apex.oracle.com/pls/otn/. fine->igames are shown.
on a new page in my local app, i did exactly the same (create a table, procedure, ect) it does not work.
rows are shown inthe report, but no images, instead the icon for a broken/missing image is displayed.
i tried to debug using firebug:
in the sample app on otn, when i point the mnouse over the procedure call, the image appears in a tool-tip
in my app, the code is quite simmilar, nothing happens. no icon
>
<img width="50" height="50" src="WMF_GL_INTMAN001.DISPLAY_IMAGE?inID=1"/>
>
help!!!
maybe this is important: i'm using apex 3.2.0.00.27 on db version 11g
Edited by: yeti on 28.08.2009 13:37 -
Oracle SQL Developer 3.2, SQL*Plus COLUMN FORMAT bug
SQL*Plus command COLUMN truncates output result in SQL Developer.
Script in Worksheet:
column nn format 999
select level nn from dual connect by level<=10;The Run Script (F5) result contains only 8 lines in Script Output window:
NN
1
2
3
4
5
6
7
8
Changing column alias:
select level nn2 from dual connect by level<=10NN2
1
2
3
4
5
6
7
8
9
10
10 rows selected
The output can contain no data for more formatted columns.
===============================================================
About
Oracle SQL Developer 3.2.09
Version 3.2.09
Build MAIN-09.30
Copyright © 2005, 2012 Oracle. All Rights Reserved.
IDE Version: 11.1.1.4.37.59.48
Product ID: oracle.sqldeveloper
Product Version: 11.2.0.09.30
Version
Component Version
========= =======
Java(TM) Platform 1.7.0_02
Oracle IDE 3.2.09.30
Versioning Support 3.2.09.30sqldeveloper64-3.2.09.30-no-jre.zip.
My jdk now is 1.7.07 x64, Windows 7 x64.
C:\Java\jdk17\bin>java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
Gary Graham wrote:Also, I don't understand what you mean by
The output can contain no data for more formatted columns.
Sript:
col owner format a10
col table_name format a20
col column_name format a20
col comments format a50
select
row_number() over(order by column_name) r11,
count(*) over() c11,
owner ow,
table_name tn,
column_name cn,
comments co
from all_col_comments t
where owner='SYS' and table_name='INDEX_STATS';
select
row_number() over(order by column_name) r,
count(*) over() c,
owner,
table_name,
column_name,
comments
from all_col_comments t
where owner='SYS' and table_name='INDEX_STATS';
select 1 from dual;
prompt abcThe output truncated after headers of second queryR11 C11 OW TN CN CO
1 25 SYS INDEX_STATS BLKS_GETS_PER_ACCESS Expected number of consistent mode block gets per row. This assumes that a row chosen at random from the table is being searched for using the index
2 25 SYS INDEX_STATS BLOCKS blocks allocated to the segment
3 25 SYS INDEX_STATS BR_BLKS number of branch blocks in the b-tree
4 25 SYS INDEX_STATS BR_BLK_LEN useable space in a branch block
5 25 SYS INDEX_STATS BR_ROWS number of branch rows
6 25 SYS INDEX_STATS BR_ROWS_LEN sum of the lengths of all the branch blocks in the b-tree
7 25 SYS INDEX_STATS BTREE_SPACE total space currently allocated in the b-tree
8 25 SYS INDEX_STATS DEL_LF_ROWS number of deleted leaf rows in the index
9 25 SYS INDEX_STATS DEL_LF_ROWS_LEN total length of all deleted rows in the index
10 25 SYS INDEX_STATS DISTINCT_KEYS number of distinct keys in the index
11 25 SYS INDEX_STATS HEIGHT height of the b-tree
12 25 SYS INDEX_STATS LF_BLKS number of leaf blocks in the b-tree
13 25 SYS INDEX_STATS LF_BLK_LEN useable space in a leaf block
14 25 SYS INDEX_STATS LF_ROWS number of leaf rows (values in the index)
15 25 SYS INDEX_STATS LF_ROWS_LEN sum of the lengths of all the leaf rows
16 25 SYS INDEX_STATS MOST_REPEATED_KEY how many times the most repeated key is repeated
17 25 SYS INDEX_STATS NAME name of the index
18 25 SYS INDEX_STATS OPT_CMPR_COUNT optimal prefix compression count for the index
19 25 SYS INDEX_STATS OPT_CMPR_PCTSAVE percentage storage saving expected from optimal prefix compression
20 25 SYS INDEX_STATS PARTITION_NAME name of the index partition, if partitioned
21 25 SYS INDEX_STATS PCT_USED percent of space allocated in the b-tree that is being used
22 25 SYS INDEX_STATS PRE_ROWS number of prefix rows (values in the index)
23 25 SYS INDEX_STATS PRE_ROWS_LEN sum of lengths of all prefix rows
24 25 SYS INDEX_STATS ROWS_PER_KEY average number of rows per distinct key
25 25 SYS INDEX_STATS USED_SPACE total space that is currently being used in the b-tree
25 rows selected
R C OWNER TABLE_NAME COLUMN_NAME COMMENTS
- - ---------- -------------------- -------------------- -------------------------------------------------- -
Interactive report column formatting
When control break is applied for any column in interactive report then the color applied to any column does not get applied.
.apexir_WORKSHEET_DATA td[headers="ABC"] {color: RED;}Sanjayuser12957777 wrote:
When control break is applied for any column in interactive report then the color applied to any column does not get applied.
.apexir_WORKSHEET_DATA td[headers="ABC"] {color: RED;}
With the control break the IR generates different mark-up, so you need to add another selector to the rules so there's a match on the column cells in both the standard and break report views.
See +{message:id=9208685}+
(Please update your forum profile with a real handle instead of "user12957777".) -
Help with report column formatting
Hi,
Simple question .... I have a report that has some fairly large text columns, and I want to fit the report onto one screen. Does anybody know how you can change the width of the column of a report, and get the text to wrap round within that cell ?
thanks
TimTim,
You could change the display type of the longer fields to be text areas.
You may also want to look at Carl AJAX app which has a feature which hides/shows detail data without the page being refreshed.
http://htmldb.oracle.com/pls/otn/f?p=11933:22
Select the HTMLDB and Javascript -> AJAX and DHTML -> AJAX -> Show Report with Detail option.
Hope this helps
Chris -
CSS to format a textarea column in an SQL report
I'm using the following CSS class called "fixed" to format a multi-line column (textarea) in a standard SQL report (Column Formatting Attribute: CSS Class). Each row is now hard coded to a height of 40px or about 4 rows with a scrol bar. If the row has no data in it I'd like to default the row to a height of 1. Is it possible to do that?
<style type="text/css">
.fixed {display:inline-block; width:150px; height:40px; overflow-y:scroll; font-size:9px;}
</style>
regards
PaulPPaulP wrote:
I'm using the following CSS class called "fixed" to format a multi-line column (textarea) in a standard SQL report (Column Formatting Attribute: CSS Class). Each row is now hard coded to a height of 40px or about 4 rows with a scrol bar. If the row has no data in it I'd like to default the row to a height of 1. Is it possible to do that?
<style type="text/css">
.fixed {display:inline-block; width:150px; height:40px; overflow-y:scroll; font-size:9px;}
</style>Try <tt>max-height:40px</tt> instead.
For a less speculative response, provide complete information on the environment and any restrictions therein:
<li>Full APEX version
<li>Full DB version and edition
<li>Web server architecture (EPG, OHS or APEX listener)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region type(s)
and a reproduction of the issue on apex.oracle.com that we can experiment with.
Is this just to limit the size of an actual report or is the <tt>textarea</tt> editable within a tabular form ? If the former I'd just use a <tt>div</tt>...
Maybe you are looking for
-
Help! - Installing Oracle 8.1.7 on Linux on Pentium 4
I believe the installation bug also occurs when trying to install 8.1.7 on Linux. Can anyone advise how to get round the problem please?
-
Premiere CC constant crashing on MBP Retina with latest updates
I've had this problem in the past with Premiere and I suspect it's to do with their poor GPU support for the Retina, but this morning my Premiere has decided to crash approximately every 10 minutes, citing a "serious problem" Here is the log report:
-
[JS, CS3] How to find text that is NOT a paragraph return
Hi all, This is probably an easy one, but I can't seem to get the idea. I want to search within some text and find everything EXCEPT the paragraph return. What would be the way to build that expression? Thanks for any response. Regards, Len Swierski
-
I'm having trouble un-installing my quicktime. When I try to remove it, my installshield won't do it, and trying to update leads to an error 1714, and an error 1603. The first one say it can't find my .msi file for quciktime, and the other says i nee
-
Hello, i need to replace MSDN license key by a commercial key. I used "TFSConfig License" command line, it reply :"There was an error registering Product Key XXXX-..." thks in advance