Jump to content
Changes to the Jaspersoft community edition download ×

tugrul083

Members
  • Posts

    15
  • Joined

  • Last visited

tugrul083's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Hi, I have added many users before without any problem but when I try to add a new user now, I get the following error: "Expected a decrypted password in request attribute, but found none." I am logged in as Jasper Admin. I haven't changed any settings since last time I added a user with success. I have tried different browsers, network connections and OS but no luck. I have also set 'Allowuserschangepassword' property to true but it doesn't help. Please have a look at the screenshot below and advice. Many thanks. Tugrul
  2. Hi, I have several reports that use weekly Start date and End date parameters. The goal is to have these reports scheduled and emailed to clients on weekly basis whilst allowing them to login and select their own dates when necessary. Default dates are calculated by Groovy scripts. Date calculations work fine; when you login to Jasperserver and open the report, they are always correct and reports run fine manually. However the reports scheduler gets stuck. I set the scheduler to start on a specific date (next Monday 00:05) and set the recurrence as Calendar type to repeat evert month, every Monday at 00:05. The problem is that although the scheduler works, it will ONLY use the current date parameters and will not refresh them on the second run. For example if I set the scheduler now, next Monday I will have the reports sent to my email with date inputs startdate: 3-11-14, enddate: 10-11-14. This is correct for the first run. However, all the upcoming weeks, it will use these specific parameters and will not refresh the dates. I believe what I am looking for is VERY simple. I have my report calculate everything correctly and all I need from Jasperserver is to run it every Monday WITHOUT storing the input parameters. If it ONLY runs it, on cheduled time, all would be great but somehow scheduler stores the parameter values which are correct only at the date the scheduler is set! I have been working on this for ages and am really annoyed I can't find a permanent, reliable solution. Any help would be greatly appreciated. Regards, Tugrul
  3. Additional note: Changing the default value expression of the say startdate parameter on a "Stuck" report as described above has no effect. For example change the default value expresion of the startdate from 2 weeks ago to now, upload the report to the exact same folder with exact same name (main.jrxml i.e) and the dates will still show 2 weeks ago by default. As explained above the dates can be changed by the user and the report runs fine but this error completely destroys my report schedules. Many thanks.
  4. Hi, All my reports require start and enddate parameters to run. Each parameter has a default value to ebable scheduling but these parameters are also visible / changeable by users. For example a weekly report has default values Startdate: Sunday before and Enddate: Last Sunday. The problem is that these parameters aren't refreshing by date. That is, when a report is first created the Start and Enddate parameters are calculated AND displayed correctly. Reports run without problem, users can see / change the default dates, reports can be scheduled. However the week after when I open the same report I see that the parameters haven't changed at all. This is causing many problems becauseI can't schedule any of my reports as they keep running for the same start / enddate parameters! Publish the report on a new folder, set the input parameters and the dates are calculated perfectly well but a week after the dates are still the same! I have tried different ways of calculating the dates but none could solve this issue. I thought the parameters would be initialised and run from beginning each time a report is opened on the server but this doesn't seem to be the case? I have data snapshots enabled, could it be causing this problem somehow? Are the parameter values saved somewhere in the server and if so is it possible to disable this property? Many thanks in advance, Tugrul
  5. Thank you so much Hugo! Using date range parameters I've solved the issue with most of my reports! :-) I'd like to ask another question if I may; Date range parameters worked fine for both SQL queries run on the report AND on a stored procedure which has only date inputs. ie. CALL Stored_Procedure $X(startdate, enddate). This works fine. However the "$X()" syntax doesn't seem to work with stored procedures that have more than 2 paramater inputs such as CALL Stored_Procedure $X(startdate, enddate, ID1, ID2. ID3, ID4, ID5, ID6) Any ideas? Many thanks and regards, Tugrul
  6. Hi, I have been stuck with this for a long time now and would really appreciate any help to get me going. I want to add default values for my startdate and enddate parameters such that they are set to "Last Sunday" and "Sunday before" by default. This will enable me to schedule weekly reports while still giving the users to change the report dates on their convenience. I am not proficient with Java and the fact that Jasper Studio allows only 1 expression in a paramater doesn't help. I have tried using the following expressions. They did work for a couple of reports but didn't give the correct dates for others. Also with reports that use stored procedures, it simply won't work. There's something wrong and it's unreliable. Startdate: new SimpleDateFormat("yyyy-MM-dd").format(NOW()-(WEEKDAY(NOW())+7)) Enddate: new SimpleDateFormat("yyyy-MM-dd").format(NOW()-(WEEKDAY(NOW()))) The sql equivalent of what I'm trying to write would be the following. Startdate: DATE_SUB(DATE(NOW()), INTERVAL DAYOFWEEK(NOW())+6 DAY) Enddate: DATE_SUB(DATE(NOW()), INTERVAL DAYOFWEEK(NOW())-1 DAY) Any help would be greatly appreciated. Many thanks and regards.
  7. I'm kind of getting there... I've created 3 parameters: 1. P{cal}, java.util.calendar, default value expression: Calendar.getInstance() 2. P{startdate}, java.util.date, default value expression: ($P{cal}.add(Calendar.DAY_OF_WEEK,-($P{cal}.get(Calendar.DAY_OF_WEEK)-1))) ? null : $P{cal}.getTime() 3. P{enddate}, java.util.date, default value expression: ($P{cal}.add(Calendar.DAY_OF_WEEK,-($P{cal}.get(Calendar.DAY_OF_WEEK)+6))) ? null : $P{cal}.getTime() These find the sunday before, and the sunday before that. What I need is "Last Sunday" and "Sunday before". So basically these parameters are following a week behind... Any comments???
  8. Hi All, I'd like to set a default value expression for the stardate and enddate parameters of my report. The idea is that the date prompt screen would always open with values; Startdate: Sunday before Enddate: Last sunday But the user can also change the values if they want. Basically what I need to write is a Java or Groovy conversion of the following SQL expressions: Last sunday: DATE_SUB(DATE(NOW()), INTERVAL DAYOFWEEK(NOW())-1 DAY) Sunday before: DATE_SUB(DATE(NOW()), INTERVAL DAYOFWEEK(NOW())+6 DAY) Jaspersoft Studio doesn't allow usage of calendar functions and I'm badly stuck. Any help would be greatly appreciated! Thank you!
  9. Thanks for the reply Ajinkya. I get the idea. But I need more info on the usage of P!{} parameter. I'll have P{startdate} and P{enddate} parameters. When these are left NULL, the SQL will be something like: select FORCE INDEX (FromIndex) WHERE CASE WHEN $P{startdate} IS NULL THEN (Fromx> "XX-YY-ZZ" ) AND Fromx < "AS-DF-FG" ORDER BY FromX) as a1, ELSE (Fromx>"$P{startdate}") AND (Fromx<"$P{enddate}" ORDER BY FromX) as a2, END Problem is that I think I need a third parameter that will give the user the option to select a date or leave it empty. I can't see how to achieve this...
  10. Hi All, I'm using a report with start and enddate parameters. I want the users to have the options of; 1. Using default start and enddates defined in the parameters OR in the SQL (ie. startdate: sunday before. enddate: last sunday) 2. User defined start and enddates. Implementing either of these alone is dead easy. However I can't get my head around finding a way to give the user these 2 options. Ideally user would select from a menu like below: A. Use default dates B. Enter your start and enddates I am badly stuck and this is pretty urgent work. Any help / suggestion / idea would be greatly appreciated. Many thanks, Tugrul
  11. Hi all, I'm new to ireports and trying to build a report that would run 2 sql queries using a subreport. I got stuck at the point of creating charts from these 2 queries for several days now. I'd GREATLY appreciate any comment to get me going. Please have a read below. I need 2 queries in my report so I use a subreport. Structure-wise these queries are exactly the same, only difference is the values that they bring. I do some calculations in the subreport, pass the values from the subreport to the main report, use them in some calculations and print them and all work fine. I print the output of the main report in the detail band and all works fine. Finally I need to plot a chart to compare the output of 2 queries. The idea is, I'd pass the field from the main report to the subreport, use them in a chart there with the output field of the subreport. Then I'd placee the subreport in the summary band of the main report so when the report is printed, you'd get the chart at the end. To do this, I create a variable in the main report and assign the value of the field I need. Then I pass this to the subreport as a parameter. This is where I got stuck: When I print the parameter for test purposes in the subreport, and run the main report, it prints the last value of the field, 10 times. Inevitably, when I use the parameter in the chart, it prints the same value 10 times. Again, this is the 10/10 th value of the variable I want to print / plot. - The variable that is passed to the subreport; big decimal / calculation; nothing / reset type; group / reset group; source - thats the only group i use in the report. - The subreport is placed in summary band - The chart is placed in the summary band of the subreport - Chart evaluation; now - XML files attached PS. When I place the chart into the detail band of the main report, the values it prints changes but obviously it prints the chart again for each value - 10 times. Thanks in advance, Tugrul
  12. Thanks for your reply augarte. I couldn't do it that way so decided to add rownumbers to my SQL output. Now it looks like: rownum fromdate todate sum 1 01/02/13 02/02/13 1234 2 01/02/12 02/02/12 5678 3 01/01/13 02/01/13 9876 I can print the 'sum' i want using the boolean function $F{rownum}.==1 ? Boolean.TRUE : Boolean.FALSE in 'printwhen expression' but I need to create a variable for each 'sum' result for the further calculations i'll use in the report. sum1 sum2 sum3 1234 5678 9876 i create a variable (double) and put the following in the variable expression with the aim to get 'sum' for row number 1. $F{rownum}=="1"?$F{sum}:new Double("0") but this returns 'null'. It'd be great if you could have a look and comment. Regards, tugrul classes: rownum: integer sum: double variable: double
  13. Hi, i'm very new to ireport and java / groovy. I know this is the very basics but got stuck here for hours. Any help would be appreciated. I've build a report that runs an SQL query to get this result: fromdate todate sum 01/02/13 02/02/13 1234 01/02/12 02/02/12 5678 01/01/13 02/01/13 9876 First two fromdate and todate (01/02/13 and 02/02/13 in this example) are user defined parameters (startdate and enddate) entered into the pop-up window when running the report. Remaining ones are produced by SQL. I want to print 'sum' field conditionally, for each 'fromdate' value, in different textfields. Like if this was a table 'A' and I was using SQL, I'd write: select sum from A where fromdate='01/02/13' I've tried putting this in a static text box but didn't work $F{fromdate}==p{startdate}? $F{sum}:0 then i've just put $F{sum} and added a printwhenexpression but that didn't do it either... Class details are as follows. Thanks a lot! sum: java.lang.double fromdate: java.lang.string todate: java.lang.string startdate: java.util.date enddate: java.util.date
×
×
  • Create New...