testinginvestingapp
-
Posts
3 -
Joined
-
Last visited
Content Type
Forum
Downloads
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Events
Profiles
Posts posted by testinginvestingapp
-
-
I am generating this report based on the following:
User is required to input minesite but it is optional to input typeOfcertificate.
Below is a screenshot of JRXML code where I am using both of the highlighted parameters to generate data.
Is it possible to use either script like this in the JRXML jasperReport file:
IF (typeOfcertificate is Null)
<queryString language="SQL">
<![CDATA[sELECT FC.LAST,FC.FIRST,FL.LEVEL_DESC,
AE.EMP_DESC AS AreaOfEmploymentFROM [dbo].[FS_AREA_OF_EMPLOYMENT] AE
INNER JOIN [dbo].[MINES_CERTIFICATIONS] MC ON (AE.EMP_CODE=MC.AOE_EMP_CODE)
INNER JOIN [dbo].[FS_CLIENTS] FC ON (MC.CLI_PEOPLE_ID=FC.PEOPLE_ID)
INNER JOIN [dbo].[FS_LEVELS] FL ON (MC.SEM_LEVEL=FL.LEVEL_CODE)
LEFT join [dbo].[MINES_STATUS_LOG] MSL ON (MSL.ACTION_CERT_ID=MC.CERT_ID)
LEFT join [dbo].[FS_STATUSES] FS ON (MSL.Action_Type=FS.Status_Code)WHERE (MC.AOE_EMP_CODE= $P{minesite} AND MC.EXPIRY_DATE >= GETDATE())
ORDER BY FC.LAST, MC.SEM_LEVEL]]>
</queryString>ELSE
The below script. The changes made to SQL code is highlighted.
---------------------------------------------------------------------------------------- JRXML CODE ------------------------------------------------------------------------------------------------------------------------------------
<parameter name="minesite" class="java.lang.String"/>
<parameter name="typeOfcertificate" class="java.lang.String"/><queryString language="SQL">
<![CDATA[sELECT FC.LAST,FC.FIRST,FL.LEVEL_DESC,
AE.EMP_DESC AS AreaOfEmploymentFROM [dbo].[FS_AREA_OF_EMPLOYMENT] AE
INNER JOIN [dbo].[MINES_CERTIFICATIONS] MC ON (AE.EMP_CODE=MC.AOE_EMP_CODE)
INNER JOIN [dbo].[FS_CLIENTS] FC ON (MC.CLI_PEOPLE_ID=FC.PEOPLE_ID)
INNER JOIN [dbo].[FS_LEVELS] FL ON (MC.SEM_LEVEL=FL.LEVEL_CODE)
LEFT join [dbo].[MINES_STATUS_LOG] MSL ON (MSL.ACTION_CERT_ID=MC.CERT_ID)
LEFT join [dbo].[FS_STATUSES] FS ON (MSL.Action_Type=FS.Status_Code)WHERE (MC.AOE_EMP_CODE= $P{minesite} AND (MC.SEM_LEVEL=$P{typeOfcertificate} or $P{typeOfcertificate} is null) AND MC.EXPIRY_DATE >= GETDATE())
ORDER BY FC.LAST, MC.SEM_LEVEL]]>
</queryString> -
I am accepting two parameter from the user through a website.
- $P{first_Parameter}
- $P{second_Parameter}
<parameter name="first_Parameter" class="java.lang.String"/>
<parameter name="second_Parameter" class="java.lang.String"/>I would like the following:
- If the $P{first_Parameter) is NULL then I would like to run SCRIPT 1
- Else I would like to run SCRIPT 2
In the JRXML file:
<queryString language="SQL">
<![CDATA[IF ($P{first_Parameter)) == NULL then
SELECT lastName, firstName, Address
WHERE schoolName = $P(second_Parameter)
FROM StudentTable;ELSE
SELECT lastName, firstName, Address
WHERE schoolName = $P(second_Parameter) and country = $P{first_Parameter)
FROM StudentTable;]]>
</queryString>It would be really helpful if you guys can support me with an answer in context of JRXML file. As I didn't use the JASPERSTUDIO UI to develop the report.
USED SOLUTIONS: 1 (Not Working)
<queryString language="SQL
<![CDATA[
SELECT lastName, firstName, Address
CASE WHEN ($P{first_Parameter}=null) then (WHERE schoolName = $P{second_Parameter})
ELSE (WHERE schoolName = $P{second_Parameter} and country = $P{first_Parameter}") end
]]> </queryString>
USED SOLUTIONS: 2 (Not Working)
<queryString language="SQL
<![CDATA[
$P{first_Parameter}.equals(null)
? " SELECT lastName, firstName, Address
WHERE schoolName = $P(second_Parameter)
FROM StudentTable;"
: " SELECT lastName, firstName, Address
WHERE schoolName = $P(second_Parameter) and country = $P{first_Parameter)
FROM StudentTable;"
]]> </queryString>
How do I BOLD cell in a table based on a value
in Products
Posted
I am getting the table information from SQL Query.
How do I write the conditional for the STATUS column where if the value is EXPIRED or SUSPENDED, I want it to be bolded.
The output of the table is like this but I want EXPIRED & SUSPENDED to be bolded.