Jump to content
Changes to the Jaspersoft community edition download ×

joseng62

Members
  • Posts

    196
  • Joined

  • Last visited

Community Answers

  1. joseng62's post in How can I put a print icon on a report? was marked as the answer   
    Hi James, I can only assume you are making use of the proffesional version in this case. 
    Regardless, there could be numerouse ways to solve this, but I do not think any easy one. If you do thave the proffesional one, best to reach out to jasper support. 
    One could do some old reverse engineering and go identify the jsp's involved in created the slideout container/page what ever that is. Some one that has some html experience and back end development figure this out. When you do find the relevant jsp, you could introduce custom code to inject the print icon. 
    Or you could add a print icon in the report and link a href to it, the href would then execute a REST api call or another custom class that would do the required work for you. 
    You would need to familiase yourself with the jasper rest api, which you send a request to the server for a pdf export or other formats and be able to prinit of from there. 

    Hope this helps. Bit hard to give exact answer.
  2. joseng62's post in Sub report not appearing centered on parent report was marked as the answer   
    Hi fillipedesenvolvedor. 

    So it is hard to derive from the image, where your supbreport is being called, created ? 
    First make sure your subreport does not have page margins, the margins might cause unexpected outcome displayed. 
    Ensure you subreport witdh is not more that your main report. 
    The placement and alignment of your text field/components in your subreport also has an effect. 
    You need to get all of this set correctly and aligned for your disired outcome.

    Hope this helps. 
    Regards 
    joseng62
  3. joseng62's post in Is it possible to configure Active Directory in Community Edition was marked as the answer   
    I have not implemented this myself yet, but the questions has been asked before. 
    Yes you can. 
    There is a guide on this "jasperreportsserver-auth-cookbook_5.pdf" it is more a straight forward implementation, you will most likely have to make some changes to make it all work with your envirnoment and ldap structure.
  4. joseng62's post in Can we use visualize.js with JasperReports Community Edition was marked as the answer   
    Quick and straight answer, no. 
    You will have to write your own implementaiton of this. visualize.js is for commercial only and close source. You could reverse engineer it, but licensing would become and issue. 
    Best is to make use of the REST api, which is well diverse and set out. I am not 100%, but I believe visualize.js, just makes use of the rest api in anyways, it is just an easier developer layer to make it easier for app integration from an enteprise point of view. You can if you have the time and resource get the same done.
  5. joseng62's post in For projects, using Jaspersoft Server community edition is secure or not was marked as the answer   
    You might be authenicated already. You using the plugin to the browser ? If you have another tab open in same browser instance where you are already sign into jasper your request will work. 
    Try to sign out of jasperserver and then request again. 
    I made use of my postman app and I simulated put request with same setup as yours and it failed. If sign into jasper in browser or not. 
    If I use plug in, then it works. 
    Same with R client.  
  6. joseng62's post in Using one subreport several times with different results was marked as the answer   
    Hi Michael, seem you need some guidance on this one. 

    So I am assuming your will get the groups from the sql. 
    So first of all create a group and in the group epxression create the logic for the grouping there. 
    So example of you have a $F{group} from sql then just use that fields or maybe some if logic. 
    $P{group}.contains("GroupA")
    ? A : $P{group}.contains("GroupB")
    ? B : $P{group}.contains("GroupC") 
    ? C : ""

    Then you make use of the group header band or footer band and add your subreport there. 
    (Just a note, you mentioned using a table, so if the case , just use the table element instead of subreport.)

    Ok so know you need to pass over a parameter from main report to subreport or table element. 
    So if subreport, then click on the subreport element, in the property tab, select "subreport", then you see a "Edit Parameter". This is where you link any main parameter, field or variable with your subreport parameters. 
    You need to create a parameter in your subreport. Remeber to update your subreport jrxml then safe, then compile to create/update the .jasper file. 

    if table, then you will make use of a dataset, so create the parameter in the dataset. Then same logic above, click on table element in properties tab, select "Dataset", then "Parameters"
     
    Other option is that you could make use of 3 table or 3 subreport and just use the print when expression, but do not add this in the detialed band as you will get a lot of subreport/tables generating based on you main report row count. 
    So if your data returns 3 rows in main report and you have 3 tables/subreport in your main detailed band, you will generate 9 table or subreports. 
    This is ok if it is what you want to achieve, but can create a out of memory and loop issues when you main and subreport returns a lot of row possibilites. 

    Hope all of this helps. 

    Kind Regards 
    joseng







     
  7. joseng62's post in How I get the maximum and minimum value in a query was marked as the answer   
    Ok solution and outcome depends on what your want to achive at the end of the day. 
    So if you want your database to return 1 row with min and max then you can make use of sub queries in your select statement.  You did not mention which DB you are using. 
    So example in Oracle:
    select ( select MAX(number_column) from Your_table ) as MaxNo,
    ( select MIN(number_column)from Your_table ) as MinNo
    From Your_table where Rownum < 2

    This would return 1 row with MaxNo column with max value and MinNo with min value. 

    You could use ORDER BY age without max function and the first row would be your max and last your min, almost as you did above, just without max function and group by. 

    Or if you want jasper to do this, you need to understand that each row returned from DB will be iterated through. So 3 variables. I created a report below that connect to oracle datasource and use Dual to stump data. You need to update the datasource to your DB or update sql if using another DB. 


    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1  -->
    <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="report name" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="af88d3eb-c1fe-4d76-9a0c-e7394dc2ddb4">
        <property name="ireport.zoom" value="3.4522712143931042"/>
        <property name="ireport.x" value="0"/>
        <property name="ireport.y" value="0"/>
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="UPDATE_HERE"/>
        <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
        <style name="style1" isPdfEmbedded="true"/>
        <queryString>
            <![CDATA[select * FROM 
    (select 10 as age , 'Green' as Name from DUAL union
    select 15 as age , 'Red' as Name from DUAL union
    select 25 as age , 'Yellow' as Name from DUAL union
    select 2 as age , 'Blue' as Name from DUAL )]]>
        </queryString>
        <field name="AGE" class="java.lang.Integer"/>
        <field name="NAME" class="java.lang.String"/>
        <variable name="Max" class="java.lang.Integer" calculation="Highest">
            <variableExpression><![CDATA[$V{Variable_2} > $F{AGE} ? $V{Variable_2} : $F{AGE}]]></variableExpression>
            <initialValueExpression><![CDATA[0]]></initialValueExpression>
        </variable>
        <variable name="Min" class="java.lang.Integer" calculation="Lowest">
            <variableExpression><![CDATA[$V{Variable_2} > $F{AGE} ? $V{Variable_2} : $F{AGE}]]></variableExpression>
            <initialValueExpression><![CDATA[0]]></initialValueExpression>
        </variable>
        <variable name="Variable_2" class="java.lang.Integer" calculation="Highest">
            <variableExpression><![CDATA[$V{Variable_2}]]></variableExpression>
            <initialValueExpression><![CDATA[0]]></initialValueExpression>
        </variable>
        <background>
            <band splitType="Stretch"/>
        </background>
        <detail>
            <band height="50">
                <textField>
                    <reportElement x="190" y="10" width="100" height="30" uuid="9a16ad60-3e8b-415a-b0b7-3b024797f48e"/>
                    <textFieldExpression><![CDATA[$V{Max}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="450" y="10" width="100" height="30" uuid="8949c50d-a9db-4f93-b5c3-0a4503acfd37"/>
                    <textFieldExpression><![CDATA[$V{Variable_2}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="320" y="10" width="100" height="30" uuid="224af22d-cb1a-4922-9d27-6c62bbaf7478"/>
                    <textFieldExpression><![CDATA[$V{Min}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="10" y="10" width="100" height="30" uuid="41a78580-9280-4134-ad54-7cbb69a906e5"/>
                    <textFieldExpression><![CDATA[$F{AGE}]]></textFieldExpression>
                </textField>
            </band>
        </detail>
        <summary>
            <band height="100" splitType="Stretch"/>
        </summary>
    </jasperReport>
     
  8. joseng62's post in How to access remote mysql server database from ireports in localhost was marked as the answer   
    Jasperstudio is a bit different than ireport, but using same logic. You need to create a datasource (data adapter) 
    Below gives guidence on this. 
    https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v60/understanding-data-adapters-and-connections
    next page 
    https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v60/creating-and-using-database-jdbc-connections

    Ireport is outdated report studio and I can remember there is a option to add datasource, think the button is an icon in the submenu, just above the report design. 

    I totally understand why this is so hard to find, I can remember having same issue the first time I used Ireport. 
  9. joseng62's post in Splitting AWS instance of JasperSoft Server was marked as the answer   
    Not sure how you want to split and instance. 
    If you need 3 jasper instance you need 3, you can't split. 
    I guess of you have one AWS server envirn, you would need admin access to run 2 additional jasper installs and in each install, update the port numbers. You going to require some DEv/Ops skill to get this done, but possible. 

    If you want to clearly separate dev, test, proc but can only work with 1 instance, due to budget constraints, then I suggest of your using professional, just create multiple organization and have 1 for dev, another for test and another for prod. So all user will access same instance, but content of organization would be different and permission would be different. 

    If you don't have pro, then just create 3 different folders in root directory. 1_Dev, 2_Test, 3_Prod then just copy past the content of one folder into the other main folder. 
    There after you need to go create roles and user that are allowed to access given folder and then assign permission to given group. 
    So logically if you develop in Dev and a new report is update, then recreate report in Test and if all good then recreate in Proc. You going to keep some track of all of this, but saves you a lot of time. 
    Obviously not likely to have Proc in same instance, but I have worked with companies that could only afford doing that. So, Dev was done on local and then the Dev in jasper was only for Done development, so deployment. then test would be next step and then proc. 
  10. joseng62's post in Create Chart/Graph Using collection was marked as the answer   
    In the chart, you can usually select a dataset to run, which default is set to Report main dataset. 
    But if you create another dataset and selected it in the drop down in the chart properties. You can then select
    data source Expression and select "Use a DataSource expression"
    Then use the JRDatasource.
  11. joseng62's post in error in passing date value in sql query - not executing was marked as the answer   
    If using relative dates 

    Then create parameter in jasperstudio example 
    Name: "datefrom"
    Class: net.sf.jasperreports.types.date.DateRange
    Prompting: you decide
    Default value: new net.sf.jasperreports.types.date.DateRangeBuilder("MONTH-1").toDateRange()
    Explained "MONTH-1", you can use DAY, WEEK, YEAR.

    Then create second parameter in jasperstudio for the query. 
    Example
    Name: "FROM_DATE"
    Class: java.util.Date
    Prompting:
    Default value: $P{datefrom}.getEnd()

    Follow same steps for to date
    Query Example:
    select "columns" from table where "datefield" between  $P{FROM_DATE} and $P{DATE_TO} For none relative dates
    Only create 2 parameters, TO and FROM DATES
    Example
    Name: "FROM_DATE"
    Class: java.util.Date
    Prompting: you decide
    Default value: new Date((new Date()).getTime()-7*24*60*60*1000)    
    You can set the time period for now date just do new Date()

    If you have an issue with the date format, then either format the date field sql side to be same as jasper side or format jasper parameter to meet sql fields date format. 

    If you just want to hardcode test. Then default string value should work. 
    "2016-01-01" set paramter as string type. 
     
  12. joseng62's post in Error evaluating expression for source text: was marked as the answer   
    Ok so not sure what your question is. Need a lot more information. 
    Seems that you have an issues with your expression. Did you test the report in jasperstudio/ireport before deploying to jaspersever ?

    Error evaluating expression for source text: $F{HM_OUTP_RECEIPTS_COV_DISC}+$F{HM_OUTP_RECEIPTS_CASH_DISC}+$F{HM_OUTP_RECEIPTS_ADD_DIS
  13. joseng62's post in Java function not getting called on jasper server was marked as the answer   
    Hi premchandkp, 

    Look at the following answers. http://community.jaspersoft.com/questions/824896/how-use-custom-functions-jar-jasperserver-too

    You have a couple of options. 
    Upload to jasper server or upload to 2 different folder in tomcat. 

    Kind regards
  14. joseng62's post in Repository file resource could not be loaded was marked as the answer   
    Well first of all I know jasper is sensitive to using "-" in any resource. Rather use "_".

    Do you load the sub report onto jasper as a resource and then when you load your main reports you point to your subreport? 
    If you do load you're subreport onto repo then do you load the image as a resource as well. 
    Can you test the subreport seperatly in jasperserver to see if you have a path issues or incorrect load of resource onto jaspeserver? 

    If repo: does not work try the direct to resource first to test and see if same issue persist. 
  15. joseng62's post in How to clean up reports from the repository using command in jasperserver was marked as the answer   
    Sorry running js-import.bat --help , you can see that there are no delete function.
     
    Only way I would suggest is via REST_v2
    http://community.jaspersoft.com/documentation/jasperreports-server-web-services-guide/v56/deleting-resources
×
×
  • Create New...