Jump to content
We've recently updated our Privacy Statement, available here ×

testinginvestingapp

Members
  • Posts

    3
  • Joined

  • Last visited

testinginvestingapp's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. 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. Last NameFirst NameStatus DateLeeRobertExpiredDec 15, 2021Water JacobActiveJan 1, 2024DoeJohnSuspendedDec 31, 2022
  2. 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 AreaOfEmployment FROM [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 AreaOfEmployment FROM [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>
  3. 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 1Else I would like to run SCRIPT 2In 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>
×
×
  • Create New...