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
PaulP
PaulP 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>...
Similar Messages
-
Download column link to SQL report
Hi ,
I am using apex 4.1.
I have a SQL report with blob image column also . And along with the image i need to add download link as a column can some one please suggest me how to do it.
Thanks
Raghavraghav1212 wrote:
I am using apex 4.1.
I have a SQL report with blob image column also . And along with the image i need to add download link as a column can some one please suggest me how to do it.
This is very simple. Reference the image column twice in the report query projection, and apply a download format mask to one column and an image mask to the other. -
Add Image column in classic sql report to open a pop page
I have sql report I want to add a new column which will have image to click, Once user clicks the image a popup page should open.
Hi Vikram,
Sorry to bother you, I am very new to apex. Here is my sql query for sql report. Can you please help me.
<xmp>select
case
when ISUPPORT_NUMBER is null or ISUPPORT_NUMBER = 'N/A' then '<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Enter SR Number</p></a>'
else '<span style="background-color:red;font-weight:bold">'
|| ISUPPORT_NUMBER
|| '</span>'
end ISUPPORT_NUMBER,
case
when ISUPPORT_NUMBER is not null and ISUPPORT_NUMBER != 'N/A' then '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#FF0000;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
else '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
end MACHINE_NAME,
FUNCTION,
VERSION,
VENDOR_CLUSTER,
case when used_by is null then '<a href="javascript:myFunc2(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc5(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || used_by || '</p></a>'
else used_by
end used_by,
case
when loaned_to is null and ( upper(used_by)=v('APP_USER') or used_by is null) then '<a href="javascript:myFunc(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc6(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || loaned_to || '</p></a>'
else loaned_to
end loaned_to,
LOANED_TO_EXPIRY_DATE,
LOAN_INFO,
decode(SCAN_NAME,null,'<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>','<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>') SCAN_NAME,
USERNAME,
VNC_PASSWORD,
LAST_UPDATED_BY , </xmp>
<b>Here I want to add a image column where I can give a link like above to open popup </b>
from install_dbqa_machines
Edited by: Sivaramaraju on Jun 19, 2012 9:06 AM
Edited by: Sivaramaraju on Jun 19, 2012 9:07 AM
Edited by: Sivaramaraju on Jun 19, 2012 9:08 AM -
Solution to allow users to specify which columns of a sql report to search
Starting Point:
1) You have an existing SQL Report.
2) You want to provide functionality to search through the result set.
Start -----
1) add a text_item for searching PX_search where X is page number
2) add a button which resubmits the page. Go
3) You modify your query by adding the following to the end of the where clause.
and (PX_SEARCH is null or instr(column_name1,PX_SEARCH) > 0 )
4) So far so good but it only allows searches on 1 column, so you add a few other columns
and (PX_SEARCH is null or instr(column_name1,PX_SEARCH) > 0 or instr(column_name2,PX_SEARCH) > 0 or instr(column_name3,PX_SEARCH) > 0 )
Now when you enter some text if it is in any of the columns that row will be displayed.
This can be good or bad depending on your requirement. lets say my users want to specify the column they are searching on.
5)further enhancement
i) add a LOV to your page which queries the all_users data dictionary view
select column_name d, column_name r from all_users where table_name = 'MY_TABLE_NAME' and column_name not in ('COLUMN_NAME1,COLUMN_NAME2) order by column_name
The idea here is to use the oracle data dictionary to get all the columns for your table(s) and ignore the columns you do not want.
ii) add an item to your page e.g. PX_select_column which gets populated from the list of values.
Now for each column you are going to allow a search on, the sql needs to be modified.
Lets pretend that my firstcolumn is called member_id, my second column is called firstname and my third column is lastname
Before we had this SQL
(select * from table where 1=1)
and (PX_SEARCH is null or instr(memberid,PX_SEARCH) > 0 or instr(firstname,PX_SEARCH) > 0 or instr(lastname,PX_SEARCH) > 0 )
Remember we have added PX_SELECT_COLUMN which should contain what we have selected from the LOV.
iii) So now we modify the query to be as follows:
and (PX_SEARCH is null or decode(:PX_SELECT_COLUMN,'MEMBERID',instr(memberid,PX_SEARCH),0) > 0 or
decode(:PX_SELECT_COLUMN,'FIRSTNAME',instr(firstname,PX_SEARCH),0) > 0 or
decode(:PX_SELECT_COLUMN,'LASTNAME',instr(lastname,PX_SEARCH),0) > 0 )
The user can now choose which column to filter their results on.Here is a basic one (http://apex.oracle.com/pls/otn/f?p=2230:1). You can select an object type and put in criteria for the object name like '%b%'. The SELECT statement is dynamically generated with only the pieces of the WHERE clause that are needed. You do not need all the DECODE and INSTR OR logic.
The main part of this example is the computation of the SQL SELECT statement:
DECLARE
v_sql VARCHAR2(2000) := 'SELECT *'||CHR(10)||' FROM USER_OBJECTS';
v_and BOOLEAN := FALSE;
v_where VARCHAR2(2000);
BEGIN
-- P1_OBJECT_TYPE has value of 'ALL' for '%'
IF (:p1_object_type != 'ALL') THEN
v_sql := v_sql || chr(10) ||
' WHERE object_type = '''||:p1_object_type||'''';
v_and := TRUE;
END IF;
IF (:p1_object_name IS NOT NULL) THEN
IF (v_and) THEN
v_sql := v_sql || chr(10) ||
' AND object_name LIKE UPPER('''||:p1_object_name||''')';
ELSE
v_sql := v_sql || chr(10) ||
' WHERE object_name LIKE UPPER('''||:p1_object_name||''')';
END IF;
v_and := TRUE;
END IF;
:p1_sql := v_sql;
RETURN (v_sql);
END;Mike -
Getting Column names from SQL report
I have a SQL report as follows:
select ename, dept, manager
from emp;
I need to be able to dynamically access the column names being displayed inside APEX so I can use in a List of Values. I can't use all_tab_columns. Is there an internal APEX table/view that I can accxess that will give me all of the columns that are eing displayed in a SQL report?Hi Bob,
Try this -
1) Give your report region a static id
2) Use the following query -
select
heading d,
column_alias r
from
apex_application_page_rpt_cols
where region_id = 'FOO';Obviously change 'FOO' to match your region id, and look at the different columns available in the apex_application_page_rpt_cols view to see what best suits you.
The APEX dictionary rocks ;)
Hope this helps,
John.
http://jes.blogs.shellprompt.net
http://apex-evangelists.com -
ORA-01821: date format not recognized Error in PL/SQL report-4.0
Hi,
I am using Apex 4.0 and i have a Classic report(function returning query) which selects a date column.
The query runs at the backend and gives the output.
But when i run the report on the page, i get the error
report error:
ORA-20001: Error fetching column value: ORA-01821: date format not recognizedThe values for the date column are like this 14-MAR-13,01-FEB-13 etc... Everything seems to be right.
But I have no idea why this error occurs.
Thanks
DivyaAren't these errors annoying! But there's a data / format mismatch for sure. What I need to see -- and what will tell you what is wrong -- is
1) exactly what the data is and
2) exactly what the format string is that is being used to convert it.
The values for the date column are like this 14-MAR-13,01-FEB-13 etc... Question: Is this the source data or the target data ( what it's supposed to look like after being converted)?
Let's start there:
What is the source? Is it a DB column? Is it type date or VARCHAR2 or what?
If VARCHAR2, then give us an example of the data that is failing.
What is the format -- I assume there is one -- being used to convert the data?
Are you doing a TO_CHAR or a TO_DATE?
Give us lots of detail, please. Then it should be easy to solve.
Regards,
Howard -
Sorting report columns for PL/SQL report
I have created a report of type "Pl/Sql function body returning Sql query" in which I am generating the column names within the query. I would now like to make the first three of these columns sortable. But when I click on the "sort" box for the first three columns, all my column names suddenly switch to "Col 1", "Col 2" etc.
As you can see by the following snippet from the PL/SQL that generates the query, the column names are data driven, so I'm not in a position to declaratively rename each column. As it happens, the first three columns names are fixed, but all the subsequent column names are data driven.
Suggestions on how to make the first three columns sortable while preserving the generated column names of the remaining columns?
thanks
susan weber
declare
query varchar2(4000); -- query
begin
query := 'select first_name "First Name", last_name "Last Name", encounter_date "Encounter Date" ';
for c1 in (select distinct attr_src, attr_code, attr_text, sequence_number from finding_vt)
loop
query := query || ', (select val_text from finding_vt vt where vt.encounter_id = e.encounter_id and vt.attr_src = ''' || c1.attr_src || ''' and vt.attr_code = ''' || c1.attr_code || ''' and sequence_number = ' || c1.sequence_number || ') "' || substr(c1.attr_text,0,30) || '"';
END LOOP;
query := query || ' from patient pat, encounter e where pat.patient_id = e.patient_id';
return query;
end;This turns out to be related to the choice of "use generic column names" v. "use query specific column names".
I had chosen "use generic column names" just to get past the initial creation page. I then debugged the query creation sql, but never changed that setting back to "use query specific column names". The fix is to choose "use query specific column names". -
How to suppress column names in SQL-report
What I want is just the data, without any column names.
COLUMN LDATE OFF;
SELECT SYSDATE LDATE
FROM DUAL;
LDATE
07.11.11
This example doesn't work. There is still LDATE above column. Any idea?user5116754 wrote:
Great, it's so simple. Im sure there is a way to omit this result statement: "531 rows selected" at the end of report!There is, and it's also in the documentation...
SQL> set feedback off
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20
7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
SQL> -
How to create alternate color columns in MS SQL reporting services (rdl)
I found something related to row coloring at ::
http://weblogs.sqlteam.com/joew/archive/2008/08/20/60691.aspx
i went through all the properties for column but none that would help me achive me goal.
SO in my case .. the no of rows are fixed .. but columns vary .. so i wnat the alternate columns to be of different color (say white and silver)Hi,
Once my no of data sets (mine is 3 columns per data set) changes, the highlighting 'shifted' like below. Any idea how this happen? -
Maximum number of columns for a SQL report
I am trying to pull a single report for approx 180 - 360 columns per row from a table with 30 columns (6 to 12 months data). The report is then to be exported to csv and then merged into a Word document. Due to the limitation of 100 columns in html db this cannot be done.
We cannot merge direct from the database. Is there another method to get data into Word or out of the database that I have not thought of?Hi Arvind,
You are correct in saying that only 50 columns can be shown in the BW report at a time. It will allow you to place more than 50 fields in the query definition but the query will not execute.
If you want to show more than 50 columns, you can add those extra columns in the FREE CHARACTERISTICS of the query definition. So at the time of execution of the query user will see the 50 columns by default and if he wants to see those additional columns, he can replace the already existing columns by the fields in the free characteristics. This can be achieved by DRILL DOWN and DRILL ACROSS.
This is the way to go about it. We also did the same thing in our case.
Regards,
Yogesh -
Modify Template to show columns like a SQL report
Hi All,
Really urgent. We have a procedure and we are using a pl/sql block to get the query. The layout is not nice so they want me to look at the template and change it so the result look like a sql query.
Thanks.Hi,
OK - if you are using the htp package to output the entire report, then firstly you should have a look at: [http://download.oracle.com/docs/cd/B14099_19/web.1012/b15896/pshtp.htm]. You will see that you have many more options than htp.p or htp.prn - there are htp.tableOpen, htp.tableRowOpen, htp.tableHeader and htp.tableData options for example. Using these, you can add in table/row/cell attributes that will include the styling that you need to get your report to display as you need.
The best thing to do would be to look at the defintion of a report template that matches the style you need and then make a note of the attributes that are used for the TABLE, TR, TH and TD tags.
For example, on my Theme 18, "Standard" report template, the Column Template 1 setting (which is for the data within the table) is:
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data">#COLUMN_VALUE#</td>so, in your code, when you want to output the data, you can use:
htp.tableData(columnname, 'LEFT', null, null, null, null, 'headers="' || columnname || '" class="t18data"');Anything on the report template that does not have a corresponding parameter in the htp function, needs to be added into the final parameter - in the above example, the headers and class attributes do not match parameters in the htp.tableData() function, so become a single string in the final parameter.
You just need to identify the attributes you need for each TABLE, TR, TH and TD tag and construct them in a similar way in your output.
Andy -
Breaking report layout by column grouping in sql report
Hello All,
I have a strange requirement where I have a query which needs to o/p data in the following manner:
Status Exp. Type Class Entered By Expenditure Group Control Total Running Total
Submitted Miscellaneous XXXX, Mrs. YYYYY DESAF130501-001 0 .00
Transaction
AAAA, Mrs. BBBBBB DEAMK070509-07 77.05 77.05
CCCCC, Mr. DDDDDDDD B9MM080509-06 0 .00
B9MM070509-04 0 .00
B9MM110509-01 0 .00
B9MM080509-03 0 .00
B9MM070509-05 0 .00
B9MM080509-07 0 .00
B9MM080509-04 0 .00
B9MM080509-01 0 .00
B9MM130509-01 0 .00
B9MM070509-03 0 .00
B9MM080509-02 0 .00
B9MM110509-02 0 .00
B9MM070509-07 0 .00
B9MM110509-04 0 .00
B9MM070509-02 0 .00
B9MM070509-01 0 .00
B9MM120509-01 0 .00
B9MM110509-03 0 .00
FFFFF, Miss WWWW DEARM110509-01 0 142.78
GGGGG, Mr. HHH ALPM080509-1 0 .00
LLLLL, Mrs. KKKKKKK JKDTest070709-1 20 20.00
Total for Expenditure Type Class: 23 97.05 239.83
So basically the sql query groups by status,exp type class,enteredby,expenditure group.My problem is the user does not want the column values to be repeated for every record inside the group.For Eg: if you see under the group by the entered by : CCCCC, Mr. DDDDDDDD
The value CCCCC, Mr. DDDDDDDD is displayed only once for the group even though there are more than several records under the group(due to unique records in expenditure group).
It is pretty straight forward to do in Oracle Reports or in SQL* Plus using Columns BREAK,but iam struggling to do the same thing in plain sql...Any suggestions?Oh .Got you..thanks..This is the o/p i require...
Status Exp. Type Class Entered By Expenditure Group Control Total Running Total
Submitted Miscellaneous XXXX, Mrs. YYYYY DESAF130501-001 0 .00
Transaction
AAAA, Mrs. BBBBBB DEAMK070509-07 77.05 77.05
CCCCC, Mr. DDDDDDDD B9MM080509-06 0 .00
B9MM070509-04 0 .00
B9MM110509-01 0 .00
B9MM080509-03 0 .00
B9MM070509-05 0 .00
B9MM080509-07 0 .00
B9MM080509-04 0 .00
B9MM080509-01 0 .00
B9MM130509-01 0 .00
B9MM070509-03 0 .00
B9MM080509-02 0 .00
B9MM110509-02 0 .00
B9MM070509-07 0 .00
B9MM110509-04 0 .00
B9MM070509-02 0 .00
B9MM070509-01 0 .00
B9MM120509-01 0 .00
B9MM110509-03 0 .00
FFFFF, Miss WWWW DEARM110509-01 0 142.78
GGGGG, Mr. HHH ALPM080509-1 0 .00
LLLLL, Mrs. KKKKKKK JKDTest070709-1 20 20.00
Total for Expenditure Type Class: 23 97.05 239.83 -
How to set up a column link to the column attribute in a report
Hi All
I have 6 column in a sql report in a page, column names are (Devicename devicerole,from etc).
Now i need to set a link to this column and this need to link to the another page
Thanks & Regards
Srikkanth.M
Edited by: Srikkanth.M on Apr 6, 2011 6:17 PMHi
Read this and follow it...
>
Go to the report attributes, then click on the edit link button by the side of the column you want to be a link to get to the column attributes.
>
So...
1. Go to edit the page that contains your report.
2. Click on the report region as if you were going to edit the report query.
3. Click the Report Attributes tab.
4. Click the button at the side of the column in question.
5. Scroll down to the Column Link section and fill in the details.
I really can't put it much more simply than that...
Cheers
Ben -
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. -
most css text formatting options can be found under the font or text family of properties
(ie font-size, font-family, text-align, text-shaddow ect)
but there are a few which do not fall under the text or font properties
letter-spaceing, line-height and colour are some examples
why are these not covered under font/text
it would be usefull if i knew that environments such as dreamweaver would hint at all avaliable options when i typed in text or font
and are there any other stand alone ones which i didnt mention.Because that's the way the CSS 2.1 standard was written. They are not listed under font/text because they are not listed that way under the CSS 2.1 spec. Reading through the spec will let you see how the authors of the spec organized things: http://www.w3.org/TR/CSS21/.
Dreamweaver does hint at them when you start typing in code-view (via autocomplete). But you have to know at least the first letters of the CSS code you're trying to write.
The issue you're experiencing lies more with the organization of the CSS 2.1 specification then with Dreamweaver. Could Dreamweaver maybe make it easier to discover the other CSS attributes (like line height) that impact font/text? Probably. But it may just be easier to learn the language.
Maybe you are looking for
-
Errors not appearing in alert file
Hi, Just getting my first experience of Oracle on Windows. The application I am supporting is getting ORA-04030 errors, which we are now investigating, but my question is why these errors were not written to the alert file for that database? My usual
-
Printing fails on a Samsung, but ok on others
I am using RReport, and tested Elixir Report using a Samsung ML 1710. It's a budget USB laser printer. When using RReport, you have to print the same thing twice, and one copy will come out. With Elixir Report, nothing comes out. Printing is fine on
-
Is it possible to make the approvals process sequential with multiple approvers? For example, get approved by a Product Manager before being passed to a VP for final approval to avoid putting unnecessary approvals in front of senior people (as they m
-
Dynamic tabs like the one on Developer Center
I'm looking to learn how to build the dynamic tabs like on the link below: http://www.adobe.com/devnet/ When you hit each tab the content comes up on the same html document....layers maybe? thanks for helping, Sasha
-
PC Companion & Bluetooth troubles
I have the SE Cedar phone, i can sync with Outlook if i plug in my phone via USB cable.I want to use bluetooth to do ithis, it will work on my desktop computer but it wont on my laptop with integrated bluetooth, I click Sync and the screen hangs on "