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

reportdev

Members
  • Posts

    413
  • 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

Posts posted by reportdev

  1. Try this way:

    Spin up EC2 instance first

    Then write Jasper reports deployment code which will use a build tool such as Maven and Jasper API - this build code will use REST API and combines the XML and JRXML to create a Report Unit for each report in your Repository, then deploys this report unit on to the Jasper server that you have already deployed. May be you could use spring boot to automate all these steps.

     

  2. If your datasource is a resultset from a database, try using SQL to create a new column which resets at interval of 10 records ( you can use mod comparison and case statements). Based on this new column, create a group and select new page on group level settings.  This method will be easiest when compared to variables in Jasper.

    $V{REPORT_COUNT} is a report level variable and it will not reset until you specify the reset type.

  3. Try to convert the List or ArrayList parameter object into toString and then use terinary expresssion to compare with All the possible Values for that parameter.

    But this method will be a problem when you modify the Server Parameter Values. You need to remember modifying the jrxml when you are modifying the Server Parameter Values.

  4. In order to initiate the resultset, dummy parameter is needed in this case. 

    Create another parameter dependent upon p_idreg_docs_prest, called as p_idreg_docs_prest_handler.

    p_idreg_docs_prest_handler code : Use a terinary expression to evaluate if p_idreg_docs_prest is null (may be like $P{p_idreg_docs_prest}.equals(null) ? "" : $P{p_idreg_docs_prest} )

    Now instead of using p_idreg_docs_prest parameter in your SQL query, use p_idreg_docs_prest_handler value as $P!{p_idreg_docs_prest_handler}. In this case a string value will replace the parameter. I believe it should work this way. 

     

  5. Yes, you can by suppressing One band in pdf and displaying the Other band - vice versa.

    Check the below code blocks. You need a design in which you would have pageHeader and columnHeader being suppressed based on a export property.

    When the report is being exported, the property will suppress the other band. 

        <property name="net.sf.jasperreports.export.csv.exclude.origin.band.1" value="columnHeader"/>    <property name="net.sf.jasperreports.export.pdf.exclude.origin.band.1" value="pageHeader"/>[/code]
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  --><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="hiding" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a464a856-0112-4306-af87-56ad7909845b">    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>    <property name="net.sf.jasperreports.export.csv.exclude.origin.band.1" value="columnHeader"/>    <property name="net.sf.jasperreports.export.pdf.exclude.origin.band.1" value="pageHeader"/>    <queryString>        <![CDATA[select * from address]]>    </queryString>    <field name="ID" class="java.lang.Integer">        <property name="com.jaspersoft.studio.field.label" value="ID"/>        <property name="com.jaspersoft.studio.field.tree.path" value="ADDRESS"/>    </field>    <field name="FIRSTNAME" class="java.lang.String">        <property name="com.jaspersoft.studio.field.label" value="FIRSTNAME"/>        <property name="com.jaspersoft.studio.field.tree.path" value="ADDRESS"/>    </field>    <field name="LASTNAME" class="java.lang.String">        <property name="com.jaspersoft.studio.field.label" value="LASTNAME"/>        <property name="com.jaspersoft.studio.field.tree.path" value="ADDRESS"/>    </field>    <field name="STREET" class="java.lang.String">        <property name="com.jaspersoft.studio.field.label" value="STREET"/>        <property name="com.jaspersoft.studio.field.tree.path" value="ADDRESS"/>    </field>    <field name="CITY" class="java.lang.String">        <property name="com.jaspersoft.studio.field.label" value="CITY"/>        <property name="com.jaspersoft.studio.field.tree.path" value="ADDRESS"/>    </field>    <background>        <band splitType="Stretch"/>    </background>    <pageHeader>        <band height="20">            <staticText>                <reportElement x="0" y="0" width="80" height="20" uuid="97ec4745-5338-4f63-81e8-a301334e71a8">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="cab492e6-4694-4ae8-b5db-dd6ab80a8301"/>                </reportElement>                <text><![CDATA[student_id ]]></text>            </staticText>            <staticText>                <reportElement x="80" y="0" width="100" height="20" uuid="b227076c-d3b2-4592-80f8-c755c2dbc4af">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f7c3918e-a1ad-40a7-8621-d0d6b771948b"/>                </reportElement>                <text><![CDATA[student_name]]></text>            </staticText>            <staticText>                <reportElement x="180" y="0" width="100" height="20" uuid="57b152a7-6e77-40a8-9e2a-6b6d33bc2442">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="2edcb22b-11c2-44aa-8a56-9b3272bd1de9"/>                </reportElement>                <text><![CDATA[address]]></text>            </staticText>            <staticText>                <reportElement x="280" y="0" width="100" height="20" uuid="9116f345-4d53-4504-945a-76a8820f5491">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="79699508-c889-4f8e-85bc-9eef358502c2"/>                </reportElement>                <text><![CDATA[zip_code]]></text>            </staticText>        </band>    </pageHeader>    <columnHeader>        <band height="20" splitType="Stretch">            <staticText>                <reportElement x="0" y="0" width="80" height="20" uuid="a4b25c40-866e-4afa-82e8-0f420307faa4">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="cab492e6-4694-4ae8-b5db-dd6ab80a8301"/>                </reportElement>                <text><![CDATA[student ID]]></text>            </staticText>            <staticText>                <reportElement x="80" y="0" width="100" height="20" uuid="bf46f0b3-35e0-4ea7-9256-52102daefe44">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f7c3918e-a1ad-40a7-8621-d0d6b771948b"/>                </reportElement>                <text><![CDATA[Name]]></text>            </staticText>            <staticText>                <reportElement x="180" y="0" width="100" height="20" uuid="629df1db-8e6a-4617-ad62-b2f2df3ddca4">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="2edcb22b-11c2-44aa-8a56-9b3272bd1de9"/>                </reportElement>                <text><![CDATA[Address]]></text>            </staticText>            <staticText>                <reportElement x="280" y="0" width="100" height="20" uuid="6b0b2235-e6e4-4971-9e62-c55cca647a7c">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="79699508-c889-4f8e-85bc-9eef358502c2"/>                </reportElement>                <text><![CDATA[Zip Code]]></text>            </staticText>        </band>    </columnHeader>    <detail>        <band height="20" splitType="Stretch">            <textField>                <reportElement x="0" y="0" width="80" height="20" uuid="e8f7b4a1-e137-4f28-8f4a-e0236211ea96">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="cab492e6-4694-4ae8-b5db-dd6ab80a8301"/>                </reportElement>                <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="80" y="0" width="100" height="20" uuid="3616c7d5-c9d5-44e9-b2e7-edfc3eac179e">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f7c3918e-a1ad-40a7-8621-d0d6b771948b"/>                </reportElement>                <textFieldExpression><![CDATA[$F{FIRSTNAME}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="180" y="0" width="100" height="20" uuid="9f4c09de-eeff-4406-bd11-9e3928627622">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="10b2a284-9f3e-4ee1-9981-df1cdbe161a9"/>                </reportElement>                <textFieldExpression><![CDATA[$F{STREET}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="280" y="0" width="100" height="20" uuid="9667de72-641e-4543-a62a-148e5adc7b5a">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="79699508-c889-4f8e-85bc-9eef358502c2"/>                </reportElement>                <textFieldExpression><![CDATA[$F{CITY}]]></textFieldExpression>            </textField>        </band>    </detail></jasperReport>[/code]

     

  6. I see what you have mentioned. Jasper reports does not allow that feature. (ireports would have had that feature). 

    Since the parameters control the datasource, I dont think you would be able to fetch a value from the datasource to fill a parameter in Jasper. 

    The workaround would be to create a subreport/table element and then fill the Field value from the main datasource. 

  7. Yes, you can execute batch files from the Jasper studio Project.

    I have similar setup through which I push all my reports from Jasper Studio to Server using maven.

    Running scripts at regular intervals would require you to write a batch script and then you could use task scheduler (if you are using windows, task scheduler allows you to automate some stuff) on top of the batch file to run at a specific time of the day

     

×
×
  • Create New...