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

jgust

Members
  • Posts

    206
  • Joined

  • Last visited

  • Days Won

    1

 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 jgust

  1. We had a developer write a program in .NET where they used the Crystal API and Jasper's published xsd (http://jasperreports.sourceforge.net/xsd/jasperreport.xsd) to create jrxml files. It's not perfect and the biggest hurdle of all is trying to translate Crystal formulas into java/groovy expressions. Our workflow will be to convert the report then hand it off to the developers to clean it up addressing formula conversion errors or missing summaries since they are handled differently than Crystal. We will convert 500+ reports using this method. It's a work in progress. I will see about putting it on GitHub when it is finished.
  2. Assuming you addressed the subreport margins you might need to also delete any unused bands in your subreport. You can do that from the Outline view. Select the band you want to not display then select "delete" or you can update the "Print Wen Expression" on the band to suppress. Just set it to "false". I prefer the delete because it removes it from the canvas and makes it easier to see what is happening in the report.
  3. Assuming the field is in the group header you can set the "Reprint Header On Each Page" property for that band.
  4. You were really close. The error I saw was that you had a column alias in the group by clause which isn't allowed. This should work and it is sorted by column #2 (year) then #1 (month). select MONTH(DT_VORGANGABGESCHLOSSENAM) as Monat, YEAR(DT_VORGANGABGESCHLOSSENAM) as Jahr, str_ergebnisrisiko, count(*) as Anzahlfrom DSGVO_MELDUNG_E28928E22where STR_Status = 'abgeschlossen'group by YEAR(DT_VORGANGABGESCHLOSSENAM), MONTH(DT_VORGANGABGESCHLOSSENAM), str_ergebnisrisikoorder by 2,1;[/code]
  5. You should check out the "Compatibility" setting in preferences. Hopefully, that meets your needs.
  6. I tried to recreate the issue but it ended up working out for me. I thought the problem might have been that you needed to use the $P!{param} instead of $P{param}. From <https://community.jaspersoft.com/questions/529203/pparam-vs-pparam> <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.14.0.final using JasperReports Library version 6.14.0-2ab0d8625be255bf609c78e1181801213e51db8f --><!-- 2020-10-01T19:41:14 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="e1782c2e-c5e4-4423-ad39-79bee2b73b95"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="MyDB"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <parameter name="Report_Month" class="java.lang.String"/> <parameter name="Report_Year" class="java.lang.String"/> <queryString> <![CDATA[select LAST_DAY(ADD_MONTHS(to_date('01/' || $P{Report_Month} || '/' || $P{Report_Year}, 'dd/mm/yyyy'),'-1')) as EOMfrom dual]]> </queryString> <field name="EOM" class="java.sql.Timestamp"> <property name="com.jaspersoft.studio.field.name" value="EOM"/> <property name="com.jaspersoft.studio.field.label" value="EOM"/> </field> <columnHeader> <band height="14" splitType="Stretch"> <staticText> <reportElement x="43" y="0" width="100" height="14" uuid="fb479672-9b00-4bfe-8790-32d6172034a6"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="18f8a949-90d7-41f0-8cf5-13f5a4353ae2"/> </reportElement> <text><![CDATA[EOM]]></text> </staticText> </band> </columnHeader> <detail> <band height="17" splitType="Stretch"> <textField textAdjust="StretchHeight" pattern="MM/dd/yyyy"> <reportElement x="43" y="0" width="100" height="17" uuid="709b53cf-a4da-42a7-b5fc-75d117869435"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="18f8a949-90d7-41f0-8cf5-13f5a4353ae2"/> </reportElement> <textFieldExpression><![CDATA[$F{EOM}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  7. Yes, you can find all versions on the sourceforge page: https://sourceforge.net/projects/jasperstudio/files/
  8. You can do it using HTML5. Here is a blog post about it: https://community.jaspersoft.com/blog/drill-report-jasper-reports
  9. You can convert the number to a string and prefix with your zeros. "00000" + $F{MyFloat}.toString() [/code]
  10. You can group on the [ORDER ITEM] then set the 'Keep Together' property. If you have a group footer for the [ORDER ITEM] you may also want to set the 'Prevent Orphan Footer' to prevent the footer showing up on the next page due to space available.
  11. I believe the issue is not that Jasper can't deal with aliases but the Outline Wizzard tab can't parse SQL that is not super simple. What you can do is drop your SQL on the texts tab then read fields. If no errors then your query is valid. SELECT jg.Requester as MyRequester , jg.ReqID as MyReqID , jg.Status as MyStatus , jg.StatusID as MyStatusID , jg.Status 'MyStatus2' , jg.Status "My Status 3" , u.loginname as loginname , u.userfname FROM TEMPJG jg left outer join usrusers u on jg.reqid = u.userid
  12. I believe you have several options available to you. You can create a page break in the group header and group footer property. You can also conditionally create a page break using the <break> palette item. Another bonus way to create a break is that you have the ability to break up the group header/footer bands into multiple bands. Maybe your solution is to create a dummy group header band and put the page break there.
  13. You could use a font like IPAexGothic which has a non-slashed zero or you can convert the text field to be HTML markup and replace the zeros with a font tag. "孤独な数字は1ですか、それともゼロ(0)ですか?<br>θ<br><font color='red' face='sans-serif'>Here is a 0</font>"
  14. I'm starting to do some Crystal Reports to Jasper conversions and had to learn how to create an aggregate in the group header. I think the issue is that the GT variable needs to have a reset of MASTER. That will allow Jasper to understand the usage when it is used in an expression. I also read you also have to set the evaluation on the text field to Auto. I created the attached sample report that helped me. It works in Studio 6.14.0 and uses a data adapter called "10 Random Records".
  15. SSMS doesn't support adhoc bind variables so I have to declare a variable and set the value for my debugging needs. -- ssmsdeclare @ad varchar(10);set @ad = '0010005411';select adordernumberfrom aoadorderwhere adordernumber = @ad;[/code] In Toad and DBeaver you can use a colon (:) which will turn the variable into a bind variable and prompt you for a value. -- Toad, DBeaver, Oracle SQL Devloperselect adordernumberfrom aoadorderwhere adordernumber = :ad;[/code]
  16. That is exactly how I do it. My queries are anywhere from 50-200 lines. Due to the complexities, I require a proper SQL IDE to debug the query and Jasper is not that. This means I develop my report stored procedures in Toad or SSMS. Once they pass muster then I wrap a report around the data using Jasper or Crystal depending on the end-user.
  17. The issue you are running into is that java doesn't recognize Arial without a little setup. In the preferences goto Jaspersoft Studio|Fonts. Create a new font family for Arial specifying the correct normal, bold, italic, and bold italic ttf font. Style Name normal c:windowsfontsarial.ttf bold c:windowsfontsarialbd.ttf italic c:windowsfontsariali.ttf bold italic c:windowsfontsarialbi.ttf Once you are done with that click the export button and create a library of the font. I put mine in MyReportsFonts folder. Then studio on the project explorer navigate to the Arial.jar file you just created right-click and select Build Path|Add to Build Path. This should result in exported PDF using Arial and not swapping the font for Helvetica which is the default sans-serif font for Java.
  18. The issue you are running into is that java doesn't recognize Arial without a little setup. In the preferences goto Jaspersoft Studio|Fonts. Create a new font family for Arial specifying the correct normal, bold, italic, and bold italic ttf font. Style Name normal c:windowsfontsarial.ttf bold c:windowsfontsarialbd.ttf italic c:windowsfontsariali.ttf bold italic c:windowsfontsarialbi.ttf Once you are done with that click the export button and create a library of the font. I put mine in MyReportsFonts folder. Then studio on the project explorer navigate to the Arial.jar file you just created right-click and select Build Path|Add to Build Path. This should result in exported PDF using Arial and not swapping the font for Helvetica which is the default sans-serif font for Java.
  19. It looks like you already have the data sorted out. Next comes all of the static text and page furniture that comes with making a form. Crystal has one advantage in this area which is it has the ability of formatting text easily inside the textbox. You can type the text the go back and BOLD, UNDERLINE... format your text as you need. In Jasper, you can use 1 of 3 different markup languages (styled, HTML, RFT) then tell Jasper to render the text box using the appropriate markup. This is done on the Static Text or Text Field tab. Look for the Markup dropdown. The Styled format is Jasper specific. Here's a link to the details: http://jasperreports.sourceforge.net/sample.reference/styledtext/index.html The alignment could not get easier than in Jasper. You have more control then what you have in Crystal. You can lasso or hold ctrl and left click selecting multiple objects. Right-click and on there you have alignment to the container, Size Components, alignment to components(fields). In regards to the background in Jasper you actually have background band. The Crystal equivalent would be a page header set to underlay the following sections.
  20. I don't know the answer to your specific question if it will effect in html and javascript. I will say that in my experience that it is always better to bring in the data correctly and clearly if you can help it. You can do this by assigning an alias in SQL. SELECT employee.name AS EMP_NAME ,project.name AS PROJ_NAME ,department.name AS DEPT_NAMEFROM employeeINNER JOIN project ON project.id = employee.idINNER JOIN department ON department.id = employee.dept_id[/code]
  21. What you are looking for is the ternary operator. The format is : (expression) ? value if true : value if false[/code]Here is an example of a nested ternary operator: $P{PM_M_CAMP_ID}.isEmpty() ? "Campuses: All Campuses" : $P{PM_M_CAMP_ID}.contains( "* All Campuses" ) ? "Campuses: All Campuses" : $P{PM_M_CAMP_ID}.size() > 19 ? "Campuses: " + $V{CampusListLast3CharFIRST} + ".." + $V{CampusListLast3CharLAST} : $P{PM_M_CAMP_ID}.size() < 20 ? "Campuses: " + $V{CampusListLast3CharALL}.join(", ", $P{PM_M_CAMP_ID}).replaceAll($P{psEnter Organization ID},"") : ""[/code]
  22. My shop solely uses procedures for reporting 700+ reports. Benefits: Data logic is not tied to the presentation object. This becomes important when/if you ever change the report engine. In the last 10yrs, we went from Cognos, SAP BOBI, Crystal Report, and finally working on Jasper. Having to rewrite 800+ reports all having their own tables/views would be a challenge. It is difficult enough now having to deal with the presentation and scripting (formula vs expressions) differences.The procedure can address some presentation instead of having a formula do it. Consider having a UserFname and UserLName field. You could combine that in the procedure as User_FullName so that you don't need to write another bit of code in the engine to combine them together. It's easy enough to do it in the engine but when you have 800+ reports these easy things cost you time especially when/if you change the engine and have to do it all over again. Security You can create a read-only report user that has permission to execute specified report procedures. This moves a level of security to the db while you could also add another level on top of the engine.Performance Tuning Depending on the db engine you will have more control of how the SQL is executed then you would have if you let the engine make all of the decisions. One scenario that comes to mind is we have a scaling issue. Some of our reports take 5+hr to run due to the complexity and amount of data. We were able to analyze the issue with our dba and identify that we could rewrite the query using CTE's and also add an Oracle HINT to make a suggestion to the optimizer for a better approach. The report now takes under 2hrs.
  23. This stackoverflow answer has multiple ways to output multiple sheets. https://stackoverflow.com/questions/34808741/how-to-export-to-multiple-sheets-in-excel-from-jasper-report#34814503 It mentions some excel specific properties which you can find more details about them here: http://jasperreports.sourceforge.net/config.reference.html
  24. One option would be to use the CSV data adapter to read the text file. A quick search pulled up this JDBC driver that can read a text file; wsvjdbc. Another option is to write a scriptlet that returns the contents of the specified file. I currently do this to assist in finding the location of my subreport when we move between dev, test, and prod.
×
×
  • Create New...