Jump to content
JasperReports Library 7.0 is now available ×

adam_7

Members
  • Posts

    26
  • Joined

  • Last visited

adam_7's Achievements

  1. I am having trouble with a divide expression in a report. The report is set to run from Jasperserver automatically every day. 99.99% of the time it runs great. Occassionally the report will error and i just dont think twice and do not investigate. Today i decided to investigate and found this error. __________________________________________________________________________________________________________________ net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{Sum- Discount Amount}.divide($V{Sum - Sale Amount},4)at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:537)at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$20(ReportControler.java:512)at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:393)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{Sum- Discount Amount}.divide($V{Sum - Sale Amount},4)at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:874)at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:172)at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:423)at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:152)at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:536)at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:411)at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:386)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNoLastFooterSamePage(JRVerticalFiller.java:1066)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1025)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:161)at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:580)at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123)at java.lang.Thread.run(Thread.java:745)Caused by: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{Sum- Discount Amount}.divide($V{Sum - Sale Amount},4)at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:352)at net.sf.jasperreports.components.table.fill.BuiltinExpressionEvaluatorDecorator.evaluateEstimated(BuiltinExpressionEvaluatorDecorator.java:94)at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:607)at net.sf.jasperreports.engine.fill.JRCalculator.estimateVariables(JRCalculator.java:208)at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1276)at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1250)at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1056)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:117)at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:580)at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:732)at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)... 1 moreCaused by: java.lang.ArithmeticException: / by zeroat java.math.BigDecimal.divideAndRound(BigDecimal.java:4106)at java.math.BigDecimal.divide(BigDecimal.java:5183)at java.math.BigDecimal.divide(BigDecimal.java:1561)at java.math.BigDecimal.divide(BigDecimal.java:1622)at Employee32Discount32Per32Receipt32V2_tableDataset_1467986985409_229125.evaluateEstimated(Employee32Discount32Per32Receipt32V2_tableDataset_1467986985409_229125:431)at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:338)... 15 more __________________________________________________________________________________________________________________ Both variables in tis expression yield numbers that are not 0 so i am not sure why i am getting a / 0 error message. If i remove the scale of 4, i get the following error message. _________________________________________________________________________________________________________________net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{Sum- Discount Amount}.divide($V{Sum - Sale Amount})at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:537)at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$20(ReportControler.java:512)at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:393)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{Sum- Discount Amount}.divide($V{Sum - Sale Amount})at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:874)at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:172)at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:423)at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:152)at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:536)at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:411)at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:386)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNoLastFooterSamePage(JRVerticalFiller.java:1066)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1025)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:161)at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:580)at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123)at java.lang.Thread.run(Thread.java:745)Caused by: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{Sum- Discount Amount}.divide($V{Sum - Sale Amount})at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:352)at net.sf.jasperreports.components.table.fill.BuiltinExpressionEvaluatorDecorator.evaluateEstimated(BuiltinExpressionEvaluatorDecorator.java:94)at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:607)at net.sf.jasperreports.engine.fill.JRCalculator.estimateVariables(JRCalculator.java:208)at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1276)at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1250)at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1056)at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113)at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:580)at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:732)at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)... 1 moreCaused by: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.at java.math.BigDecimal.divide(BigDecimal.java:1690)at Employee32Discount32Per32Receipt32V2_tableDataset_1467987615796_138525.evaluateEstimated(Employee32Discount32Per32Receipt32V2_tableDataset_1467987615796_138525:431)at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:338)... 15 more _________________________________________________________________________________________________________________ This would indicate that the two numbers being divide simply create a never ending decimal, but i though the scale would have helped that. Any support or help would be appreciated. I am a newbie when it comes to java reports.
  2. Casting as float allowed me to use the * and > expressions.
  3. I get undefined operators when i try to use > or * in the expression. That was my problem when trying to get the expression set up. I think it wants me to use java expressions like this from a different report i have: ($V{Margin}.divide($V{Adjusted Retail})
  4. Hello All, I am not very good when it comes to java and i was hoping someone could help me with some conditional formatting in a report. I have two columns that both contain BigDecimal values. One columns is the averages sales per day (over the past 60 days), and the second column is the total sales over the past 3 days. I would like to create a conditional style that highlights the 3 day sales value if it is over 3 times larger than the average day sales. This is to show a recent influx of sales on a product over the past 3 days compared to the typical average. Here is an exmple of the simple math expressions: if (3 day total) > (60 day average x 3) - highlight green I am pretty sure i can set up the styles how i want, i just dont know how to take the above math expression and actually create a java expression out of it. Any help or advice would be appreciated.
  5. Asimkin Thanks for your response, I have already tried changing the relativedate.properites file with no luck. I found the datepicker file in my optimized scripts folder and changed it manually. SInce that file is already in the optimized folder, is there any need to reoptomize it? Making the changed and restarting the Tomcat server seemed to change it how i wanted.
  6. Hello All, I hvae some reports that contain input controls for the date (mostly sales reports). Everything works smoothly with the reports, but some of the people have made complaints that the date picker calendar displays Monday as the first day of the week, when they are more familiar with Sunday as the start day of the week. Anyt thoughts on where I can change this? Thanks
  7. Your smtp server is "mail.localhost.com"? are you sure your smtp settings are set up correctly?
  8. I would check this file and set the authentication option to true if your SMTP server requires authentication. $TOMCAT/webapps/jasperserver/WEB-INF/applicationContext-report-scheduling.xml and change the following option.. <property name="javaMailProperties"> <props> <prop key="mail.smtp.auth">true</prop> </props> </property>
  9. I am a newbie myself when it comes to these things, but i do know that the only place you can add Tables is to the Summary band. I believe that charts are the same way.
  10. Does your SMTP server require authentication?
  11. I ended up abandoning the idea of doing the address labels through SQL and started doing them through Postgresql. I created a database funcation that duplicated the item (for the quanity) then refrenced the function inside my dataset query along with the input paramaters. I was successfully able to create a report that would give me XX quantity of a specific label.
  12. Up until now I have just don't basic chart reports. I am now attempting to do a report similar to yours where the IC is passed directly do the main report dataset. I have my input controls named exactly like my parameters but it doesn't seem to be working either. I am receiving a message saying unable to fill report. When I used the multi-select before, I had to use Array as my class
  13. I found some information on using temp tables to generate the data how i want in SQL, but JasperStudio/Jasperserver doesnt appear to like the query. I am assumin its too complex for the report to handle. I decided that maybe it didnt like creating and dropping a temp table so i opted to create a permanent table but have the script truncate the table after run. Here is my final script, it works great in SQL, but doesnt work in JasperStudio/JasperServer DECLARE @copies INT SET @copies = 1 While @Copies <= $P{Number_of_Labels} Begin Insert into LabelQuantity (UPC,UPC_Description) Select UPC,UPC_Description from UPCLIST where UPC = $P{UPC} Set @copies = @copies + 1 End select * from LabelQuantity truncate table LabelQuantity
  14. From Google's support page https://support.google.com/mail/answer/78775?hl=en If you tried configuring your SMTP server on port 465 (with SSL) and port 587 (with TLS), but are still having trouble sending mail, try configuring your SMTP to use port 25 (with SSL). Apple Mail users: At times, Mail may misinterpret your SMTP server settings. If you currently have 'smtp.gmail.com:username@gmail.com' in the 'Outgoing Mail Server:' field of your settings, please try changing the field to 'smtp.gmail.com' and saving your settings. Also, if you are using secure authentication, you need to change the following file: $TOMCAT/webapps/jasperserver/WEB-INF/applicationContext-report-scheduling.xml and change the following option.. <property name="javaMailProperties"> <props> <prop key="mail.smtp.auth">true</prop> </props> </property>
  15. Hello all, I have seen this question several times in the forum in the past with no answers but decided to post myself in case anything has changed and the old posts were never answered. I would like to print barcode labels through Jasper so that I can generate label information from my database. I have the "template" for my labels all set up and the correct fields entered into my label. I can successfully generate the labels and print them on my sheets but i am having trouble printing more than one of the same label. Example: (using sql database) My report currently has 1 input control that specifices the UPC number that will be on the barcode. Example Query Select UPC,UPC_Description from UPCList where UPC = $V{UPC} The input control works great and generates one label for the item. I would like now print multiple quantity of this same label. The only option i could find for attempting this was to alter my query so that it would do a loop while type of function. This option does generate the data multiple times, but not in the same results tables so that Jasper can see it as the same item multiple times. Bascially the results look like 1. result 1. result 1. result instead of 1.result 2.result 3.result DECLARE @copies INT SET @copies = 1 While @Copies <= $P{Number_of_Labels} Begin Select UPC,UPC_Description from UPCList where UPC = ' $P{UPC} ' Set @copies = @copies + 1 End
×
×
  • Create New...