mjmapi
Members-
Posts
15 -
Joined
-
Last visited
mjmapi's Achievements
-
Converting a Total Seconds variable (summary) to DD:HH:MM:SS
mjmapi replied to mamelimail-jaspersoftyaho's topic in Products
This might not be a clean approach, but provides for your requirements, Just copy this into your text field in report and replace $V{Report_TotalDuration} with your seconds variable CONCATENATE(String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format( Math.floor($V{Report_TotalDuration}/(24*3600))))),'days:',INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60/60)% 24))<10? "0"+String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60/60)% 24))):String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60/60)% 24))),':',INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60) %60))<10? "0"+String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60) %60))):String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60) %60))),':',INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration} % 60)))<10? "0"+String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration} % 60)))):String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration} % 60))))) -
This is how i was able to resolve this issue, As stated on the above post when I define a relative field (DAY, WEEK etc) using net.sf.jasperreports.types.date.DateRange, users cannot later select a date range but are force to select a single day, if client does not want to make use of relative date e.g. WEEK instead they want stats for a specific timeline e.g 1st to 3rd of Month, net.sf.jasperreports.types.date.DateRange is not helpful in this case, unless someone knows how to get this working, to get past this Using SQL script formatting (MySQL) Create 3x parameters, startdate, enddate of java.sql.Timestamp type (is for prompt)Timeframe of java.lang.String type (At runtime this will take your relative fields e.g Today, Yesterday) (is for prompt)Include the clause below to let sql filter the data based on the users parameters where cd1._timestamp >= ( Case $P{timeframe} When 'Today' then CONCAT(CURDATE()," ", "00:00:00") When 'Yesterday' then CONCAT(date(NOW() - INTERVAL 1 DAY)," ", "00:00:00") ELSE $P{start_time} End ) And cd1._timestamp <= ( Case $P{timeframe} When 'Today' then CONCAT(CURDATE()," ", "23:59:59") -- tested When 'Yesterday' then CONCAT(date(NOW() - INTERVAL 1 DAY)," ", "23:59:59") -- tested ELSE $P{end_time} End ) Using JasperStudio Create 5x parameters in order timeframe of java.lang.String type (At runtime this will take your relative fields e.g Today, Yesterday) (is for prompt)Start_time, end_time of type java.sql.Timestamp (is for prompt)Startdt, enddt of type java.lang.String (not for prompt) Startdt (Default Value Expression): $P{timeframe} == "Today"? new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(new Date().getTime() - 0* 24 * 60 * 60 * 1000): $P{timeframe} == "Yesterday"? new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(new Date().getTime() - 1* 24 * 60 * 60 * 1000): $P{timeframe} == "Last Week"? new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(NOW()-(WEEKDAY(NOW())+7)): $P{timeframe} == "This Month"? new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(java.util.Date.parse(MONTH(NOW( )) + "/1/" + YEAR(NOW()))): $P{timeframe} == "Last Month"? new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(java.util.Date.parse((MONTH(NOW( )) - 1) + "/1/" + YEAR(NOW()))):$P{start_time} enddt(Default Value Expression): $P{timeframe} == "Today"? new SimpleDateFormat("yyyy/MM/dd"+" "+"23:59:59").format(new Date().getTime() - 0* 24 * 60 * 60 * 1000): $P{timeframe} == "Yesterday"? new SimpleDateFormat("yyyy/MM/dd"+" "+"23:59:59").format(new Date().getTime() - 1* 24 * 60 * 60 * 1000): $P{timeframe} == "Last Week"? new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(NOW()-(WEEKDAY(NOW()))): ///Lastday of last week denoted as 00:00:00, last week end day is this week start $P{timeframe} == "This Month"? new SimpleDateFormat("yyyy/MM/dd"+" "+"23:59:59").format(java.util.Date.parse(MONTH(NOW( )) + "/" + DAYSINMONTH(NOW())+ "/" + YEAR(NOW()))): $P{timeframe} == "Last Month"? new SimpleDateFormat("yyyy/MM/dd"+" "+"23:59:59").format(java.util.Date.parse((MONTH(NOW( )) - 1) + "/" + DAYSINMONTH(new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(java.util.Date.parse("01/" + (MONTH(NOW( )) - 1) + "/" + YEAR(NOW()))))+ "/" + YEAR(NOW()))):$P{end_time} MySQL date filtering/selection format in MySQL where cd1._timestamp >= DATE_FORMAT($P{startdt}, '%Y/%m/%d %H:%i:%s') and cd1._timestamp <= DATE_FORMAT($P{enddt}, '%Y/%m/%d %H:%i:%s')
-
Expression Editor: Last day of last month
mjmapi replied to danoldenkampgmail.com's topic in Products
I use the following First Day of Last Month new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(java.util.Date.parse("01/" + (MONTH(NOW( )) - 1) + "/" + YEAR(NOW()))) Last day of last month new SimpleDateFormat("yyyy/MM/dd"+" "+"23:59:59").format(java.util.Date.parse((MONTH(NOW( )) - 1) + "/" + DAYSINMONTH(new SimpleDateFormat("yyyy/MM/dd"+" "+"00:00:00").format(java.util.Date.parse("01/" + (MONTH(NOW( )) - 1) + "/" + YEAR(NOW()))))+ "/" + YEAR(NOW()))) -
Expression Editor: Last day of last month
mjmapi replied to danoldenkampgmail.com's topic in Products
/sites/all/libraries/ckeditor/plugins/smiley/images/thumbs_up.png -
Hi Guys, I have been struglling with this without success, i need to setup relative dates in my report, report should allow user to select relative dates e.g Yesterday or if not using reletive dates user must be able to select their daterange e.g June 1 (As start), June 30th as end. Using net.sf.jasperreports.types.date.DateRange i have the relative date part working e.g DAY-1, WEEK e.t.c, how do i get the Daterange working with this?, currently the calender only allows me to select a single date/day, no option to select multiple date if user does not wish to use relative dates, Any hints on how i can get this working Thanks in advance Meli
-
I use new SimpleDateFormat("dd/MM/yyyy"+" "+"00:00:00").format(java.util.Date.parse(MONTH(NOW( )) + "/" + DAYSINMONTH(NOW())+ "/" + YEAR(NOW())))
-
How to remove loading window from Jasper Server
mjmapi replied to prabuddha.kulatunga's topic in Products
Thanks fo the help , prabuddha.kulatunga For JS 7.5 i could not find the code you highlighted to be comment out however doing so on the one below helped <tx:useAttribute id="containerClass" name="containerClass" classname="java.lang.String" ignore="true"/> <tx:useAttribute id="containerID" name="containerID" classname="java.lang.String" ignore="true"/> <div id="loading" class="jr-mDialog jr-mDialogModal jr dialog loading movable centered_horz centered_vert ${containerClass}" style="position: absolute;"> <div class="jr-mDialog-header jr mover"> <h1 class="jr-mDialog-header-title jr"><spring:message code='jsp.loading'/></h1> </div> <div class="jr-mDialog-body jr-mDialog-bodyPadded jr"> <div class="jr-mOverlay jr-mOverlayClear jr"> <div class="jr-mSpinner jr-mSpinnerPlain jr"></div> </div> </div> <div class="jr-mDialog-footer jr"> <button id="cancel" class="jr-mButton jr-mButtonText jr-mButtonPrimary jr-uWidth-100pc jr" aria-label="<spring:message code="button.cancel"/> "> <span class="jr-mButton-label jr"><spring:message code="button.cancel"/></span> </button> </div> </div> -
The only way to get this working was to get the input controls setup on the JasperServer side, i had to write step by step instructions and get the vendor to setup on my behalf, It seems input controls can only be setup on the server side on deloper app
- 2 replies
-
- Jaspersoft Studio
- parameters
-
(and 1 more)
Tagged with:
-
Hi Guys, Hope i can get help on this one, i have a parameter i want changed to a dropdownlist, on Jaspersoft Studio i achieved this by changing the parameter class to 'java.util.ArrayList' and default value expression to Arrays.asList("Branch", "Province"). This works fine on studio, when i run the report i'm presented with the dropdown with Branch and provice, however when i upload report to server this dropdown is not presented to user at report runtime, they must manually enter/capture branch/province I do not have access to the Jasperserver, vendor does not allow us to access, so i have to achieve this without server input controls, any help /pointers will be appreciated Thanks, Meli
- 2 replies
-
- Jaspersoft Studio
- parameters
-
(and 1 more)
Tagged with:
-
Hi Guys, I'm having problem with this error when i run my report. My setup includes a main report which has two sub reports in it , when i run this report on PROD/Server i get this error however this report runs fine when i run it on Deleveloper/Studio, when i upload and run each of the reports seperately on the server they run fine without any issues, Anyone else experianced?, some guides i have seen online made mention of a 'Null', i have made a provision to cater for this on my scripts/fields with no success Any pointers?? Regards, Meli
-
Still could not get it to work with JasperStudio so i downloaded a copy of iReport v5.6, tested and its working fine without any issues, suppose i will be using iReport for for the MongoDB developments.
-
Hi Guys, please help, im struggling to connect to my MongoDB using jasperstudio, v 6.2, the strange thing is i have tested and can connect from the server, my connections are as below JasperStudio I have tried the variations below with no success, i keep getting the error Reason: java.lang.classnotfoundexception:tibcsoftware.jdbc.mongodb.mongodbdriver JDBC driver - tibcosoftware.jdbc.mongodb.MongoDBDriver jdbc:tibcosoftware:mongodb:////server1:27017,server2:27017;SchemaDefinition=movies jdbc:tibcosoftware:mongodb:////server1:$27017,server2:$27017;SchemaDefinition=movies jdbc:tibcosoftware:mongodb:////erver1:27017;SchemaDefinition=movies JasperServer mongodb://server1:27017,ocld-server2:27017/movies //this works fine when using Mongo DB data source Please let me know what i might be doing wrong?
-
Hi Hozawa, Yes, thats the WebURL i meant, the one used to access the servers UI. So the input controls can only be defined on the JasperServer, and the WebURL (server UI) is available for all JasperServer editions (Community, Enteprise .e.t.c) since this is the only place you can use to define the inout controls? Thanks hozawa
-
Good Day, Please accept my apologies if the following question will come out bit stupid, I’m new to the product but have wealth of dev experience using BOE/Crystal, I have the following two questions Q1:Do all deployment of JasperServer include the webURL for accessibility?, I’m doing development for a client who has no accessibility to the WebURL (I believe they are using the hosted version)? Q2:, Is there a way to define ‘Input Controls’ within JasperStudio?, I have tried this with Conditional queries using parameters but its still not the same as when using JasperServer for defining Input controls. Thanks