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

yael

Members
  • Posts

    27
  • 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 yael

  1. Hi,

    How can I connect parameter as string sql to the queryString ??

    Code:

    strSql = " AND tasks.watch_date IS NULL ";

     

    Code:
    [code]
    <parameter name="strSql" isForPrompting="true" class="java.lang.String"/>
    <parameter name="owner_id" isForPrompting="true" class="java.lang.Integer"/>
    <queryString><![CDATA[sELECT * FROM tasks WHERE owner_id = $P{owner_id} $P{strDateSql}
  2. Hi,

    I'm running viewReport from my java application.

    Code:

    JasperPrint jasperPrint = JasperFillManager.fillReport(
    jasperReport, parameters, conn);
    JasperViewer.viewReport(jasperPrint, true);

    My problem is when I'm closing the view report, my java aplication closing twe!

    I think it's because the view frame sel exit(0)?

    and one more question, if I run this viewReport from JButton in a JDIalog, the view location is under my dialog, how can I set this view to be allways on top??

    Thanks alot :)

    Post edited by: yael, at: 2007/02/15 07:48

  3. Hi, thanks!!!

    if I click on:

    menu>edit>insert>image It's work, I can see the image on the report, but I get runtime error:

    This error about if I add new Date() to the title, but I get the same error if I add Image..

     

     

    net.sf.jasperreports.engine.JRException:ÂReportÂdesignÂnotÂvalidÂ:Â ÂÂÂÂÂ1.ÂFieldÂnotÂfoundÂ:ÂField ÂÂÂÂatÂnet.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:267) ÂÂÂÂatÂnet.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144) ÂÂÂÂatÂnet.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:127) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:109) ÂÂÂÂatÂit.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:529) ÂÂÂÂatÂjava.lang.Thread.run(UnknownÂSource)

    Post edited by: yael, at: 2007/02/15 06:56

  4. Yes,

    I can't find a browser to my icom/image file..

    If you can tell me where is it.

    I whant to add with iReport or edit with my self, do you have an example for me? (code)

  5. How can I check in the xml file this:

    If( $P{status_id} != 0)

    then to add WHERE filter.

    else

    don't use the WHERE

    Code:

    <parameter name="status_id" class="java.lang.Integer" />

    <queryString>
    <![CDATA[sELECT task_id,status_id FROM tasks WHERE status_id = $P{status_id}]]>
    </queryString>

    :whistle:

  6. Hi,

    1)How can I set an Icone/Image to a pageHeader?

    2)How can I creat dinamic queryString parameters, I'm using JasperReport

    I mean something like this

    Code:

    public class Report {
    public Report() {
    // TODO Auto-generated constructor stub

    try {
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"«»);
    Connection conn = DriverManager.getConnection(
    "jdbc:«»sqlserver://matarotsrv:1111;databaseName=qm6", "aa",
    "aa"«»);

    // load JasperDesign from XML and compile it into JasperReport
    JasperDesign jasperDesign = JRXmlLoader.load("task1.jrxml"«»);
    JasperReport jasperReport = JasperCompileManager
    .compileReport(jasperDesign);

    HashMap parameters = new HashMap();
    if(ownerId!= 0){
    parameters.put("owner_id", new Integer(ownerId));
    }
    if(!(ownerName.equals(null))){
    parameters.put("owner_name", new String(ownerName));
    })
    JasperPrint jasperPrint = JasperFillManager.fillReport(
    jasperReport, parameters, conn);
    JasperViewer.viewReport(jasperPrint, true);

    } catch (Exception e) {
    e.printStackTrace();
    }
    }

    Then, in the xml file - How can I connect to the WHERE statment only if this properties is full with data??

    Code:
    [code]
    <parameter name="owner_id" class="java.lang.Integer" />
    <parameter name="owner_name" class="java.lang.String" />
    ...
    Where tasks.owner_id = $P{owner_id} AND tasks.owner_name = $P{owner_name}

    Thanks,

    Yael. ;)

  7. Hi,

    I whant to run the iReport from my java application.

    I think I'm missing somethimg..

    I get this error:

    Java virtual machine launcher

    Could not fined the main class, program will exit.

    Code:

    public class runApp {
    Process proc;
    runApp() {
    String str = "C:\MyJava\iReport-1.3.0\iReport.exe";
    try {
    proc = Runtime.getRuntime().exec(str);
    if (proc.waitFor() != 0) {
    System.err.println("Program did not finish properly"«»);
    }
    } catch (Exception e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    }
    }

    public static void main(String[] argz) {
    new runApp();
    }
    }


    I'm thinking that I'm missing some file to complite iReport running. (with this code I get the same error).

    maybe I need add to this code more files to run the iReport?

    I get this error when I'm running this code, and I was try to check if it is about my code (not attached to java):

    If I coppy to some place in the computer only the iReport.exe file - then click on it to run this program, I get this error to.

    but if I'm running from the shortcut desctop or from the exe that located in the iReport directory (whit no attached to java) it's running good.

    so, I think this error dialog attached to iReport program.

     

    Post edited by: yael, at: 2007/02/13 06:20

    Post edited by: yael, at: 2007/02/13 07:12

  8. Do you have an example for that?

    I don't fully understan.

    In my program I'm useing with JasperReports and show the report with JasperViewer.

    I whant to be able to edit a new report from my java program, I mean: if I clicked on the JButton, for example - I whant that the iReport will open to me :whistle:

    Thanks,

    Yael.

  9. Hi,

    I'm try to create a jrxml for my java project (with JasperReport).

    I whant to write a title but I don't have '+' in the document structure:

    -- []Document

    ----- []background|

    ----- []title

    ----- []pageHeader

    It's sopose to look like this yep?

    -- +[]Document

    ----- +[]background|

    ----- +[]title

    ----- +[]pageHeader

     

    I don't anderstand why:whistle:

    In the main console I get this(maybe it's relation this)

    iReportÂhomeÂ(ireport.homeÂsystemÂproperty):Â.

    UserÂhomeÂ(user.homeÂsystemÂproperty):ÂC:DocumentsÂandÂSettingsOwner.ireport

    iReportÂdefaultÂcompileÂdirectory:Â.

    iReportÂuserÂhomeÂdirectoryÂ(iReportÂcompilesÂhereÂifÂthereÂareÂnoÂsettingsÂorÂifÂiReportÂisntÂcomilingÂtoÂtheÂreportÂdirectory):Â{0}

    iReportÂconfigurationÂfileÂC:DocumentsÂandÂSettingsOwner.ireportconfig.xmlÂsuccessfullyÂupdated.

    iReportÂfileÂC:DocumentsÂandÂSettingsOwner.ireportrecentFiles.xmlÂsuccessfullyÂupdated.

    Renamed C:Documents and SettingsOwnerMy DocumentsUntitled_report_1.jrxml to C:Documents and SettingsOwnerMy DocumentsUntitled_report_1.bak

  10. I'm new in iReport..

    I whant to build a XML File for JasperReports.

    I'm runing the exe file but I can't see an access to the elements tree (thay with no '+')

    and in the console I get this message:

    iReportÂhomeÂ(ireport.homeÂsystemÂproperty):Â.

    UserÂhomeÂ(user.homeÂsystemÂproperty):ÂC:DocumentsÂandÂSettingsOwner.ireport

    iReportÂdefaultÂcompileÂdirectory:Â.

    iReportÂuserÂhomeÂdirectoryÂ(iReportÂcompilesÂhereÂifÂthereÂareÂnoÂsettingsÂorÂifÂiReportÂisntÂcomilingÂtoÂtheÂreportÂdirectory):Â{0}

    Post edited by: yael, at: 2007/02/07 10:45

  11. Hi,

    How can I display the result of a query as a table in JasperViewe??

    Code:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jasperReport
    PUBLIC "-//JasperReports//DTD Report Design//EN"
    "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
    <jasperReport name="example1">
    <reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="12"
    isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"
    pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />
    <reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="12"
    isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"
    pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false" />
    <reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="12"
    isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false"
    pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false" />
    <parameter name="Title"/>
    <queryString language="sql">
    <![CDATA[ SELECT first_name,last_name,contact_id FROM contacts
    ]]>
    </queryString>
    <field name="first_name" class="java.lang.String" />
    <field name="last_name" class="java.lang.String" />
    <field name="contact_id" class="java.lang.Integer" />

    <title>
    <band height="35">
    <textField isBlankWhenNull="true">
    <reportElement mode="Transparent" x="0" y="0" width="520" height="30" forecolor="#FF3300" backcolor="#FFFFFF" key="staticText-1" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" />
    <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000" />
    <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" lineSpacing="Single">
    <font fontName="Arial" pdfFontName="Helvetica-Bold" size="24" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded="false" pdfEncoding="Cp1252" isStrikeThrough="false" />
    </textElement>
    <textFieldExpression class="java.lang.String">
    $P{Title}
    </textFieldExpression>
    </textField>
    <line>
    <reportElement x="0" y="30" width="520" height="1" />
    <graphicElement />
    </line>
    </band>
    </title>

    <pageHeader>
    <band></band>
    </pageHeader>

    <columnHeader>
    <band height="20">
    <staticText>
    <reportElement x="10" y="0" width="180" height="20"/>
    <textElement textAlignment="Center">
    <font fontName="Arial" isBold="true" isUnderline="true"/>
    </textElement>
    <text><![CDATA[First Name]]></text>
    </staticText>
    <staticText>
    <reportElement x="90" y="0" width="180" height="20"/>
    <textElement textAlignment="Center">
    <font fontName="Arial" isBold="true" isUnderline="true"/>
    </textElement>
    <text><![CDATA[Last Name]]></text>
    </staticText>
    <staticText>
    <reportElement x="180" y="0" width="180" height="20"/>
    <textElement textAlignment="Center">
    <font fontName="Arial" isBold="true" isUnderline="true"/>
    </textElement>
    <text><![CDATA[iD]]></text>
    </staticText>
    </band>
    </columnHeader>


    <detail>
    <band height="20">
    <textField>
    <reportElement x="10" y="0" width="180" height="20" />
    <textElement textAlignment="Center">
    <font fontName="Arial"/>
    </textElement>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{first_name}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="90" y="0" width="180" height="20" />
    <textElement textAlignment="Center">
    <font fontName="Arial"/>
    </textElement>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{last_name}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="180" y="0" width="180" height="20" />
    <textElement textAlignment="Center">
    <font fontName="Arial"/>
    </textElement>
    <textFieldExpression class="java.lang.Integer">
    <![CDATA[$F{contact_id}]]>
    </textFieldExpression>
    </textField>
    </band>
    </detail>

    <pageFooter>
    <band height="40">
    <line>
    <reportElement x="0" y="10" width="515" height="1" />
    <graphicElement />
    </line>
    <textField>
    <reportElement x="200" y="20" width="80" height="15" />
    <textElement textAlignment="Right" />
    <textFieldExpression class="java.lang.String">
    <![CDATA["Page "]]>
    </textFieldExpression>
    </textField>
    <textField evaluationTime="Report">
    <reportElement x="280" y="20" width="75" height="15" />
    <textElement />
    <textFieldExpression class="java.lang.String">
    <![CDATA[" of "]]>
    </textFieldExpression>
    </textField>
    </band>
    </pageFooter>

    </jasperReport>

  12. I'm tring to set title from java to a xml file with parameter, but I get this error:

    Code:

    net.sf.jasperreports.engine.JRException: Report design not valid :
    1. Parameter not found : Title
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:267)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144)
    at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
    at XmlAndSql.main(XmlAndSql.java:38)

    In java code:

    Code:
    [code]

    import java.io.File;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.HashMap;
    import java.util.Map;

    import net.sf.jasperreports.engine.JRDataSource;
    import net.sf.jasperreports.engine.JREmptyDataSource;
    import net.sf.jasperreports.engine.JRResultSetDataSource;
    import net.sf.jasperreports.engine.JasperCompileManager;
    import net.sf.jasperreports.engine.JasperExportManager;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.engine.JasperReport;
    import net.sf.jasperreports.engine.JasperRunManager;
    import net.sf.jasperreports.engine.design.JasperDesign;
    import net.sf.jasperreports.engine.util.JRLoader;
    import net.sf.jasperreports.engine.xml.JRXmlLoader;
    import net.sf.jasperreports.view.JasperViewer;

    public class XmlAndSql {

    public static void main(String[] args) throws SQLException {

    try {
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"«»);
    Connection conn = DriverManager
    .getConnection(
    "jdbc:«»sqlserver://matarotsrv:1433;databaseName=qm6",
    "sa", "sa"«»);

    // load JasperDesign from XML and compile it into JasperReport
    JasperDesign jasperDesign = JRXmlLoader.load("example2.xml"«»);

    // *** this is the line error!!! ***
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

    // create a map of parameters to pass to the report.
    Map<String,String> parameters = new HashMap<String,String>();
    parameters.put("Title", "Customer List"«»);

    // create JasperPrint using fillReport() method
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
    // You can use JasperPrint to create PDF
    JasperExportManager.exportReportToPdfFile(jasperPrint, "example2.pdf"«»);
    // Or to view report in the JasperViewer
    JasperViewer.viewReport(jasperPrint, true);

    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }

    In xml:

    Code:
    [code]
    <title>
    <band height="50">
    <textField>
    <reportElement x="0" y="0" width="200" height="50" />
    <textFieldExpression class="java.lang.String">$P{Title}</textFieldExpression>
    </textField>
    </band>
    </title>

    Please help me with that, I'm biginerr in xml & reports..:unsure:

  13. Hi,

    1)I have problem with hebrew data.

    if I'm saving to pdf, csv.. I get gibbrish data.

    (if the data in english - it's save good).

    In my xml file:

    Code:

    <?xml version="1.0" encoding="UTF-8"?>

     

    2)How can I "include" xml file to another xml file?

    I want to different in one xml file some header reports...for once!!!

    then to call (include) from all athers xml files to this header.

    (instead all the time to write the same rows.. :))

    Thanks.

    I'm new in xml topic.

×
×
  • Create New...