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

CaPsLoCkEr

Members
  • Posts

    12
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by CaPsLoCkEr

  1. This might help: https://community.jaspersoft.com/wiki/creating-percent-field#In_iReportJasperReports
  2. Have you simply tried to restart the jasperreport server?
  3. Hello You can also use a subdata set in the same report. This allows you to use another query on another database in the same report. Look at this tutorial: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v640/datasets-and-subdatasets
  4. Hello Santhosh: firstdayoflastmonth: ( $P{cal}.set($P{runDate}.getYear()+1900, $P{runDate}.getMonth(), $P{runDate}.getDate()) || $P{cal}.add(Calendar.MONTH, -1) || $P{cal}.set(Calendar.DAY_OF_MONTH, 1) ) ? null : $P{cal}.getTime() lastdayoflastmonth: ( $P{cal}.set($P{runDate}.getYear()+1900, $P{runDate}.getMonth(), $P{runDate}.getDate()) || $P{cal}.add(Calendar.MONTH, -1) || $P{cal}.set(Calendar.DAY_OF_MONTH, $P{cal}.getActualMaximum(Calendar.DAY_OF_MONTH)) ) ? null : $P{cal}.getTime()
  5. Hello I want to use a $V variable in my query. As i have already found out this does not work. So I created a parameter that refers to the variable but unfortunately my output is null. This is how i'am trying to create my query: I have 2 variables: 1, firstDayOfLastMonth and 2, lastDayOfLastMonth And I have 2 parameters: 1, start_date and 2, end_date. In the parameters start_date the default value expression is $V{firstDayOfLastMonth} and in end_date it is $V{lastDayOfLastMonth}. My query is: SELECT count(*) 'Total Alarms', from alarminfo where alarminfo.set_time>=$P{start_date} AND alarminfo.set_time<$P{end_date} There are no compiling errors, but somehow everything stays NULL Does anyone have an idea what I am doing wrong?
  6. I have read a few of articles on the community but I fail to implement them. For now I have 2 variables: firstdayoflastmonth and lastdayoflastmonth for firstdayoflastmonth I am using this code: ( $P{cal}.set($P{runDate}.getYear()+1900, $P{runDate}.getMonth(), $P{runDate}.getDate()) || $P{cal}.add(Calendar.MONTH, -1) || $P{cal}.set(Calendar.DAY_OF_MONTH, 1) ) ? null : $P{cal}.getTime() I aslo created 2 parameters: runDate with value expression new Date() and cal with value expression Calendar.getInstance() When I run the report, I get this error: net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ( $P{cal}.set($P{runDate}.getYear()+1900, $P{runDate}.getMonth(), $P{runDate}.getDate()) || $P{cal}.add(Calendar.MONTH, -1) || $P{cal}.set(Calendar.DAY_OF_MONTH, 1) ) ? null : $P{cal}.getTime() at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:548) at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$20(ReportControler.java:523) at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:404) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ( $P{cal}.set($P{runDate}.getYear()+1900, $P{runDate}.getMonth(), $P{runDate}.getDate()) || $P{cal}.add(Calendar.MONTH, -1) || $P{cal}.set(Calendar.DAY_OF_MONTH, 1) ) ? null : $P{cal}.getTime() at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:290) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:616) at net.sf.jasperreports.engine.fill.JRCalculator.initializeVariable(JRCalculator.java:490) at net.sf.jasperreports.engine.fill.JRCalculator.initializeVariables(JRCalculator.java:313) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:237) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:115) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:582) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123) at java.lang.Thread.run(Thread.java:745) Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.getYear() is applicable for argument types: () values: [] Possible solutions: getChars(), getChars(int, int, [C, int), getAt(groovy.lang.EmptyRange), getAt(groovy.lang.IntRange), getAt(java.lang.String), getAt(int) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58) at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:49) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) at Engie_Total_Alarms_1511272037717_2640.evaluate(calculator_Engie_Total_Alarms_1511272037717_2640:191) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:276) ... 8 more
  7. Hello I am currently creating a report in jaspersoft studio which will eventually be published on the jaspersoft server. For the report I would like it to prompt for a date. The option I want to include are previous week, previous month and just date tot date. The date to date part is already workin. I made 2 parameters (start_date and end_date) and made them work in my query. The query is looking something like this: SELECT count(*) 'Total Alarms', sum(case when condition_id like '1' then 1 else 0 end )as 'Total Minor Alarms', sum(case when condition_id like '2' then 1 else 0 end )as 'Total Major Alarms', sum(case when condition_id like '3' then 1 else 0 end )as 'Total Critical Alarms' from alarminfo where alarminfo.set_time>=$P{start_date} AND alarminfo.set_time<$P{end_date} You can see in the last line my 2 parameters. Now I also want the report to prompt a previous week and previous month option. I already searched and read quite a lot artikels and topics, but i still cannot implement it to what I need. Does anyone have an idea?
  8. Hello thanks for your answer. But i am not using a sub report. I just added a new data set. I followed this tutorial: https://community.jaspersoft.com/wiki/creating-charts-and-datasets-jaspersoft-studio I also need to make a chart, but like I said in the OP the data in the chart needs to be using the same date parameters in the main report.
  9. Hello Using JasperSoft Studio I am try to create a report in Jasper Soft were I need 2 data sets. In the main dataset I have created 2 parameters start_data and end_data. This make the report first to prompt for a date. I am using this as $P{start_date} and $P{end_date} in my main query. This is working fine! Now I have added a second data set (no subreport) with another query I need to make a chart. I would like to user the same $P{start_date} and $P{end_date} in the query as parameter but somehow this does not work. When compiling the report It states "query parameter not found" I simply added the same start_data and end_data in the second dataset parameter field. This triggers no error but the output is empty. Anyone an idea how I can make the second query use parameters from the main data set?
  10. Hello I have created a select query with about 25 lines of code. This work perfect in jasper studio. Now i need to have a total "count" of the result of my query in the same report in another field. How can I do this in JasperStudio ? I am a total newbie in JasperSoft, so forgive me for this maybe stupid question.
×
×
  • Create New...