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

bigalex

Members
  • Posts

    75
  • Joined

  • Last visited

Community Answers

  1. bigalex's post in How to dynamic pass Datasource to subreports was marked as the answer   
    The only way I know of to have a connection to multiple data sources is to use connection parameter(s).
    Suggestion is:
    Use one of the subreports as the main report or at least use the same data source (you can select the data source and then place on the main report query  something like- Select 1 from dual )
    Create Parameter (i.e., $P{Subreport2_conn}) on the main report  to use for connection to the data source in Subreport2:Class: java.sql.Connection Is For Promting: Uncheck Default value Expression: java.sql.DriverManager.getConnection("jdbc:oracle:thin:@YourServerIP:YourServerPort/yourdatabase","UserID","Password") Not sure what your drive is; in my case, it is   jdbc:oracle:thin
    Set the Connection Expression in Subreport2 to $P{Subreport2_conn} I was using the same approach to connect five different data sources from one report.
    I hope this helps.
  2. bigalex's post in Report Number Fields was marked as the answer   
    Have you tried to change the Class Type (i.e. dollar amounts - to java.lang.Double)  in JasperStudio Dataset and Query Dialog window?
  3. bigalex's post in Jaspersoft Studio File Naming issue was marked as the answer   
    JasperStudio adds _# to the file name if the same file name exists in derctory.
    Tip: To stay organized, create a separate folder for each report in JasperSoft Studio (MyReports).
  4. bigalex's post in compare 2 string while one does an int operation returns error was marked as the answer   
    Variables ANO and ANO_ACT cannot be null  and must be evaluated. 
    Expression:  $P{ANO}!=null? ($P{ANO}.equals($P{ANO_ACT}!=null ? (Integer.parseInt($P{ANO_ACT})-1+""): "ANO_ACT is Null")?$V{CAN}:new BigDecimal("0")): "ANO is empty"
    See example below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928  -->
    <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="String to Integer" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c5f3f90c-4936-41e8-a034-b7a768ac9060">
        <parameter name="ANO" class="java.lang.String"/>
        <parameter name="ANO_ACT" class="java.lang.String"/>
        <queryString>
            <![CDATA[]]>
        </queryString>
        <variable name="CAN" class="java.lang.String">
            <initialValueExpression><![CDATA["CAN"]]></initialValueExpression>
        </variable>
        <background>
            <band splitType="Stretch"/>
        </background>
        <pageHeader>
            <band height="35" splitType="Stretch">
                <textField>
                    <reportElement x="80" y="5" width="430" height="30" uuid="d99f10a3-6103-4987-ab25-33932aa27d2c"/>
                    <textFieldExpression><![CDATA[$P{ANO}!=null? ($P{ANO}.equals($P{ANO_ACT}!=null ? (Integer.parseInt($P{ANO_ACT})-1+""): "ANO_ACT} is Null")?$V{CAN}:new BigDecimal("0")): "ANO is empty"
    ]]></textFieldExpression>
                </textField>
            </band>
        </pageHeader>
        <summary>
            <band height="42" splitType="Stretch"/>
        </summary>
    </jasperReport>
     
     
  5. bigalex's post in Remove duplicate page was marked as the answer   
    Change your Title hight to 25. 
  6. bigalex's post in group header suppression was marked as the answer   
    Page # by group:
    Page # evaluation time : now
    # Of pages evaluation time : group
    Select Reset page number in the group footter.
    2. Select group header and enter "new Boolean($V{PAGE_NUMBER}.intValue()==1)" into [Print When Expression]
    3. Make IF statement in the text field for pages:  if  # of pages > 1 then "invoice + {number 123}+ continued" else page#
  7. bigalex's post in Change Report Display upon export? was marked as the answer   
    Add to the source code:
    To remove header on export:<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.1" value="pageHeader"/>To remove footer on export:<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.2" value="pageFooter"/>
     
×
×
  • Create New...