Changing font color in a report using SQL query for APEX 5.0
Hello,
I am testing APEX 5.0 in my testing environment to see if I can migrate my internal apps from 4.2 to 5.0.
How can I change the font color in a field based in the SQL query? I know how to do it in 4.2 but I can't find the same in 5.0.
Thanks,
Well, I used to put the html tags in the select as text getting the color value depending a CASE , then I had to change the Display attribute for the column in the report as "Display as text (espace special characters...)".
I found an old post here: https://tylermuth.wordpress.com/2007/12/01/conditional-column-formatting-in-apex/ and this method still worked for me in APEX 5.0
Thanks anyways
Similar Messages
-
Generate dynamic reports using sql query and send via mail
Can anyone provide me the links to dynamically generate the sql query based reports and send it to Mail. it should be called from the scheduler program using PL/SQL
suppose you have the query as
spool myrep.txt
select * from emp where rowid<3;
spool off
write the query in the emp.sql query at any directory like d:\sqljobs\emp.sql
the call make a batch file like sndml.bat and write the following codes
sqlplus scott/tiger@orcl @d:\sqljobs\emp.sql
explorer mailto:[email protected] d"\sqljobs\myrep.txt
or if you are using any mailing software then you can use that.. -
Using SQL Query for page item source does not insert populated value
Hi All,
Following are the attribute details of a certain page item on an edit form:
Display As: Text Field
Page Item Source Type: SQL Query
Source value Expression: SELECT a from tab where id = 'ABC'
Although the field appears populated on the screen, but the value is not inserted in the table.
Can anyone help on this?
Thanks in advance,
AnnieAnnie:
One solution is to define a pl/sql function that given a date will return the 'run-date'. Something like create or replace function get_prod_date(p_date in date) return date is
retval date;
begin
select run_date into retval from tab_x where run_date=p_date;
return retval;
end;Change the Source Type for the page-item back to 'Database Column'
Set Source value or expression to the 'database column name'
Set 'Post calculation computation' to be
get_prod_date(:pxx_date)
Varad -
Generating Customized Compliance Report using SQL Query in SCCM 2007
In the query , I am wondering how to add a leading zero or 2 to the State Name field. So if I sort the report by State Name it will be in proper numerical order.
Thanks,
Peter
select
CS.Name0,
CS.UserName0,
case
when (sum(case when UCS.status=2 then 1 else 0 end))>0 then ('Needs '+(cast(sum(case when UCS.status=2 then 1 else 0 end)as varchar(10))+ ' Patches'))
else 'Good Client'
end as 'Status',
ws.lasthwscan as 'Last HW scan',
FCM.collectionID--,
from
v_UpdateComplianceStatus UCS
left outer join dbo.v_GS_COMPUTER_SYSTEM CS on CS.ResourceID = UCS.ResourceID
join v_CICategories_All catall2 on catall2.CI_ID=UCS.CI_ID
join v_CategoryInfo catinfo2 on catall2.CategoryInstance_UniqueID = catinfo2.CategoryInstance_UniqueID and catinfo2.CategoryTypeName='UpdateClassification'
left join v_gs_workstation_status ws on ws.resourceid=CS.resourceid
left join v_fullcollectionmembership FCM on FCM.resourceid=CS.resourceid
Where
UCS.Status = '2'
and FCM.collectionid = 'SMS00001'
Group by
CS.Name0,
CS.UserName0,
ws.lasthwscan,
FCM.collectionID
Order by
CS.Name0,
CS.UserName0,
ws.lasthwscan,
FCM.collectionID -
How to get tax break up of TDS using SQL query ?
Hi all,
We are developing a TDS report using SQL query
Report will contain VendorCode,Date(ap inv date),Vendor name,
Bill value,TDS Amount,
Bill Value 100.000,
TDS (2%) - 2.000,
TDS Surcharge(10% on TDS) - 0.2,
TDS Cess(2%(TDS+TDS Surcharge)) - 0.044,
TDS HeCess(1%(TDS+TDS Surcharge)) - 0.022.
We have developed this report which displays upto
VendorCode,Date(ap inv date),Vendor name,
Bill value,TDS Amount.
How to show tax break up of TDS in SQL query ?
Thanks,
With regards,
Jeyakanthan.Hi gauraw,
Thank for your reply.
I modified the query , pasted the query
as below in query generator,
Select T0.DocNum,T0.DocDate,T0.CardCode as 'Ledger',T1.TaxbleAmnt As 'Bill value',T1.WTAmnt as 'TDSAmt',(TDSAmt * 0.1) as 'TDS_Surch',
(((TDSAmt0.1) + TDSAmt)0.02) as 'TDSCess',
(((TDSAmt0.1) + TDSAmt)0.01) as 'TDSHCess'
FROM OPCH T0 INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry
WHERE (T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]')
on clicking execute its showing error message invalid column
name 'TDSAmt'.
With regards,
Jeyakanthan -
Change font color in reports depending on condition
I have an application that generates a number of new records at
the click of a button, which the user can then modify through
several report-form links. My users have requested that the data
appear in one color in the reports if they have not yet updated
the records, and that they change color, permanently, when
updated. I'm not sure how to accomplish this. I do well with
PLSQL, but I think this is probably a Javascript issue(?) - or
is it possible to specify font color of a report when you call a
URL?
Any ideas anyone?Thank you, both Michaels. I was excited. I was sure this would
work, so I added the updated_by fields to all my reports (they
should be useful anyway). I worked on a couple of other issues
related to this, and returnred this morning to add the HTML font
tags to my report queries. I CAN'T MAKE IT WORK! I've attached
my code, and error message. Any thoughts on what I'm doing
wrong? Thanks.
(Note: The query works fine without the HTML tags.)
My code:
select '<font color=red>'||activity.act_text||'</font>' act_text,
from Activity, survey, temp
where activity.survey_id = survey.survey_id and
survey.survey_id = temp.survey
Error message:
Unable to describe SQL statement. Please correct it (WWV-13010)
Invalid SQL statement: SELECT '<FONT
COLOR=RED>'||ACTIVITY.ACT_TEXT||'</FONT>' ACT_TEXT, FROM
ACTIVITY, SURVEY, TEMP WHERE ACTIVITY.SURVEY_ID =
SURVEY.SURVEY_ID AND SURVEY.SURVEY_ID = TEMP.SURVEY (WWV-13005)
ORA-01001: invalid cursor (WWV-11230)
ORA-00936: missing expression (WWV-11230)
Failed to parse as MCHBGA - SELECT '<FONT
COLOR=RED>'||ACTIVITY.ACT_TEXT||'</FONT>' ACT_TEXT, FROM
ACTIVITY, SURVEY, TEMP WHERE ACTIVITY.SURVEY_ID =
SURVEY.SURVEY_ID AND SURVEY.SURVEY_ID = TEMP.SURVEY (WWV-08300)
I appreciate your help. I'm tearing my hair out.
Karli -
Change font color in Report Code causes font size to change.
I am trying to dynamically change the font color in a report, red for negative, green for positive and blue for 0. I have created a report region and here is my code:
select city_name,
py_re_taxable,cy_re_taxable,
decode(sign(re_chg),-1,'<font color="red">'||re_chg||'</font>',
0,'<font color="blue">'||re_chg||'</font>',
1,'<font color="green">'||re_chg||'</font>','') RE_CHG
from rc_dashboard_recap a, lk_city_code b
where b.tax_year = :CURRENT_TAX_YEAR
and a.city_code = b.city_code
and userid = :GLOBAL_USER
order by 1
This code works great except it overrides my css text size and shows up as a page default size. I can't seem to figure out why this happens. This also happens when I try to sum a column. I've set my font size to 11 in my css and it is calling it correctly, however with the above code, my font size shows up at 12 or so.
I am looking at the code (view source from my page and it shows the correct class
<td class="t3dataalta" align="right" ><font color="red">-13.98</font>
in my css:
td.t3dataalta{font-size:11px;padding:2px;padding-left:5px;padding-right:5px;}
If I remove the decode statements with the font color then my font size is correct, but I need to figure out how to make the colors work.
Does anyone have any ideas?
Thank Youselect city_name,
py_re_taxable,cy_re_taxable,
decode(sign(re_chg),-1,'font color="red"'||re_chg||'/font',
0,'font color="blue"'||re_chg||'/font',
1,'font color="green"'||re_chg||'/font','') RE_CHG
from rc_dashboard_recap a, lk_city_code b
where b.tax_year = :CURRENT_TAX_YEAR
and a.city_code = b.city_code
and userid = :GLOBAL_USER
order by 1
Here is my query, I removed the < and > signs in the code so that you could see what I have done. -
SAP Crystal Report using SQL Server Authentication and Windows Authenticati
I'm a SAP Crystal Report, version for Visual Studio 2010 Beginner
my ingredients are
1.windows 7 ultimate service pack1
2.sql server 2008 standard edition
3.visual studio 2010 pro
4.SAP Crystal Report, version for visual studio.net
I was created a report named customersByCity.rpt using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> I'm supply Server, User ID, Password and Database. I assume me using SQL Server Authentication for my report
Then, my ASP.NET files as following
//ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewCustomersByCity.aspx.cs" Inherits="viewCustomersByCity" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div><asp:Label ID="lblMsg" runat="server" BackColor="Yellow" ForeColor="Black"></asp:Label>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>
</div>
</form>
</body>
</html>
//code-behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public partial class viewCustomersByCity : System.Web.UI.Page
private const string PARAMETER_FIELD_NAME = "city";
private ReportDocument customersByCityReport;
private void ConfigureCrystalReports()
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = @"WKM1925-PCWKM1925";
connectionInfo.DatabaseName = "Northwind";
connectionInfo.UserID = "sa";
connectionInfo.Password = "sysadmin25";
SetDBLogonForReport(connectionInfo);
private void SetDBLogonForReport(ConnectionInfo connectionInfo)
TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
tableLogOnInfo.ConnectionInfo = connectionInfo;
private void SetCurrentValuesForParameterField(ReportDocument reportDocument, ArrayList arrayList)
ParameterValues currentParameterValues = new ParameterValues();
foreach (object submittedValue in arrayList)
ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
parameterDiscreteValue.Value = submittedValue.ToString();
currentParameterValues.Add(parameterDiscreteValue);
ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions[PARAMETER_FIELD_NAME];
parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
protected void Page_Load(object sender, EventArgs e)
customersByCityReport = new ReportDocument();
string reportPath = Server.MapPath("customersByCity.rpt");
customersByCityReport.Load(reportPath);
ConfigureCrystalReports();
ArrayList arrayList = new ArrayList();
arrayList.Add("paris");
arrayList.Add("Madrid");
arrayList.Add("Marseille");
arrayList.Add("Buenos Aires");
arrayList.Add("Sao Paulo");
ParameterFields parameterFields = CrystalReportViewer1.ParameterFieldInfo;
SetCurrentValuesForParameterField(customersByCityReport, arrayList);
CrystalReportViewer1.ReportSource = customersByCityReport;
1st scenario
When in a runtime, it's keep appear a dialog box. This dialog box ask me to suppy Server, User ID, Password and Database. Once all information is supplied, my report display the data as expected
2nd scenario
I change my report using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> checked on Integrated Security. I just choose Server, and Database. I assume me using Windows Authentication
When in a runtime, there's no dialog box as above. My report display the data as expected. really cool
Look's like, when report using SQL Server Authentication there's some problem. but, when report using Windows Authentication, it's fine.
I'm looking for comment. Please help meHello,
MS SQL Server 2008 requires you to install the MS Client Tools for 2008.
Once install then update all of your reports to use the SQL Native 10 as the OLE DB driver.
The try again, if it still fails search, lots of sample log on code in this forum.
Don -
Hi,
Does anyone know if it is possible to change the font color on a jsp page with a condition.
example: if qty1 > qty2
change font color to red
else
font color black
end if;
Is there anywhere I can put a condition like this?
Thanks,
MaryHi Mary,
You have to create a format trigger for your condition. Then you can reference the format trigger inside your JSP report in the <rw:field> tag. From the Reports Builder Help, the syntax is:
<rw:field id="field_id" src="object_name" [breakLevel="level"]
[breakValue="break_value"] [nullValue="null_value"] [containsHtml="HTML_value"]
[formatMask="format_mask"] [formatTrigger="format_trigger"] [urlEncode="encode_value"] >
[tag body]
</rw:field>
You need to populate the formatTrigger attribute. Pl see Reports Builder Help for more information.
Navneet. -
How to Custom Report using sql server report builder for SCCM 2012 SP1
Hi ,
I am new to database, if i want to create a manual report using sql server report builder for SCCM 2012 SP1, what step should i take.
i want to create a report in which computer name, total disk space, physical disk serial no come together. i already added class (physical disk serial no.) in hardware inventory classes. refer snapshotHi,
Here is a guide on how to create custom reports in Configuration Manager 2012, it is a great place to start, change to the data you want to display instead.
http://sccmgeekdiary.wordpress.com/2012/10/29/sccm-2012-reporting-for-dummies-creating-your-own-ssrs-reports/
Regards,
Jörgen
-- My System Center blog ccmexec.com -- Twitter
@ccmexec -
Create statspack report using sql*developer
Hello,
While connecting with PERFSTAT user I can not create statspack report using SQL*Developer:
@?/rdbms/admin/awrrpt
Error starting at line 1 in command:
@?/rdbms/admin/awrrpt
Error report:
Unable to open file: "?/rdbms/admin/awrrpt.sql"
Actually, my problem or question is that how can PERFSTAT user can generate statspack reports from a Client side. What is the other way a non-dba can see the snapshots histroy and generate report (by using perfstat user ) while joing tables or using views?
Thanks a lot.
Best RegardsHi,
for awr reports @?/rdbms/admin/awrrpt (you need EE+Diagnostic Pack) there is a solution.
Grant execute dbms_workload_repository to <user>;
Grant select_catalog_role to <user>;
get all SNAP_IDs
SELECT TO_CHAR(s.startup_time,'YYYY.MM.DD HH24:MI:SS') INSTART_FMT,
di.instance_name INST_NAME,
di.db_name DB_NAME,
s.snap_id SNAP_ID,
TO_CHAR(s.end_interval_time,'YYYY.MM.DD HH24:MI:SS') SNAPDAT,
s.snap_level LVL
FROM dba_hist_snapshot s,
dba_hist_database_instance di
WHERE di.dbid = s.dbid
AND di.instance_number = s.instance_number
AND Di.Startup_Time = S.Startup_Time
ORDER BY snap_id desc;
Select * From Table(Sys.Dbms_Workload_Repository.Awr_Report_Html(DBID, 1, BEGIN_SNAP_ID, END_SNAP_ID));
For statspack i don't know a solutuion. I think the best idea is, create a job to make the statspack report on the server side and access it via external tables or mail them forward to you.
Best regards
Thomas -
Can Portal Report from SQL Query use where column IN (:bind_variable)
I would like to create a portal report from sql query with IN (:bind_variable) in the where clause. The idea is that the user would enter comma-separated or comma-quote-separated values for the bind_variable. I have tried this several ways but nothing seems to work. Can this be done?
TrentonHi,
Which version of portal are you using. This is a bug. It has been fixed in 30984.
Thanks,
Sharmila -
Report from sql query invalid date condition
Hi, I created a Reports From SQL Query. My sql is like
"select column1, column2
from myschema.tablename
where mydate > :p_date1 and mydate < :p_date2"
I am using portal with turkish and english option. If I pass p_date paramaters 'dd-MON-yyyy' format
(for example p_date1 = 23-MAR-2003 p_date2 = 26-APR-2003) in english mode portlet is return correct result,
in turkish mode 'No Row Returned'. I changed my sql statement with
"select column1, column2
from myschema.tablename
where to_date(mydate,'dd/mm/yyy') > to_date(:p_date1,'dd/mm/yyy') and to_date(mydate) < to_date(:p_date2,'dd/mm/yyyy')"
and I pass p_date parameters 'dd/mm/yyyy' format (for example p_date1 = 23/03/2003 p_date2 = 26/04/2003)
but now turkish and english mode No row returned.
How may I write correct sql statament. My database NLS_DATE_FORMAT=DD/MM/YYYY and NLS_LANGUAGE=TURKISH.
thanks.Hi,
Try this for turkish mode:
Case 1: the 'mydate' column has a kind of a char data type (like char, varchar or varchar2)
and a value like '30/03/2003'
"select column1, column2
from myschema.tablename
where
to_date(mydate,'DD/MM/YYYY') > :p_date1
and
to_date(mydate,'DD/MM/YYYY') < :p_date2"
Case 2: the mydate column has a date type:
"select column1, column2
from myschema.tablename
where
mydate > :p_date1
and
mydate < :p_date2"
In both cases use the following parameter values:
p_date1 = 23/03/2003
p_date2 = 26/04/2003
This should work
Thanks
Peter -
Query based Report (Reports From SQL Query)
Hi All,
I am facing a problem with a report. I need your help.
I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
Can i increase a timeout of portal page, how i can do this?
The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
Please help me to find appropriate reasone for the failure?Can you post the URL that is giving you the page not found error ? I am not sure if I can be of much help though.
In order to increase your chances to get a reply you should also post your question in the Portal Forum - Oracle Application Server Portal
Edited by: Rodolfo Ferrari on Jun 16, 2009 3:49 PM -
Adding update and delete buttons to a Report from SQL Query
There is an option when creating a QBE to add update and delete
links which i find quite useful, but this option doesn't seem to
be possible on a Report from SQL Query. Do i need to do
something special to add them? is the option located in a
different place?Hi,
You can only add Update ,Delete in QBE Reports,
there is no option in Portal which can be used to
have these buttons in the Reports from Query Wizard or
Report from SQL Query.
Thanks
Vineet
Maybe you are looking for
-
my macbook pro is connected to internet via my time capsule but my iPad and iPhone won't. it shows wifi connection to the time capsule but when i go on to the internet on the iPad or iPhone, it comes up with network error. can anyone help?
-
CS3.2 crashes on MPEG4 import and I've tried everything! Help!
Hi there I have a wealth of footage in mpeg4 format with the file data as I've included below (file property info from CS3.2) and I for the life of CAN NOT find a way of getting the files in without the program crashing for editing. They are large fi
-
How do i save all the colors from the swatch palette?
Hi, I would like to save each and every color by their own name (for example: TRUMATCH 1-a) as individual jpg files, through photoshop scripting. Could you please help me? thanks, rajiv.s
-
Reduce the tab height in pixels for FF29
I have read all the threads her eon the forums. I have tried the addons. I have googled, and googled and googled. Is there a way to reduce the height of the tabs in terms of pixels or not? I have edited my css file. I have tried the classic theme res
-
Help fitting project on single layer DVD.
A little confused on how this adds up. My DVD size is 395.4MB with all my menus, and AC3 audio with NO VIDEO. When I add my video, which is 4.08GB to the timeline, my project goes up to 4.9 GB. Shouldn't it be around 4.5 total? Does DVD studio only a