Jump to content
JasperReports Library 7.0 is now available ×

andrqxa

Members
  • Posts

    13
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by andrqxa

  1. Hello everyone!


     


    I'm converting Jasper 3.7 Pro reports to Lasper 6.* and I've met one strange problem.


     


    There are 2 report: `Parent` and `Child`. `Parent` has text field `Change`  which has links to `Child` (type of links is ReportExecution plus parameter OldName).


     


    `Child` has two parameters OldName without default value and NewName with default empty string "".


     


    On the server was set  input control property  "Always prompt" to TRUE and in additional to OldName paremeter added NewName parameter. (both of them are not mandatory)


     


    But when I click on `Change` field into `Parent` report,  then `Child` report's executed immediately (i.e. without calling of choosing parameter dialog)


     


    This dialog's appeared only when I added "mandatory" to  NewName and remove its default value from `Child` report


     


    This behavor works coorectly on 3.7 version and doesn't work on 6.1


     


    Could anybody explain is there any way to fix this issue, please?

  2. In my situation (I'm using JasperStudio) I added new scriptlet to "Scriptlet Srction" of  report Inspector. I.e. didn't edit default REPORT_SCRIPTLET but added new. In class of this scriptlet I put full name of my scriptlet class (i.e. "com.company.MyScriptlet") And then PUBLISH my report to Server (in terms of Jasper Studio.  After that you can work with you scriptlet as <SCRIPTLET_NAME>.<METHOD_NAME_OF_SCRIPTLET>

    for example:

    Scriptlet 

    <scriptlet name="MeasureScriptlet" class="com.mera.commprove.scriptlet.MeasureScriptlet">  <scriptletDescription><![CDATA[]]></scriptletDescription> </scriptlet>[/code]

    in report you can use expressions like this MeasureScriptlet.getData() (you have to have method getData of course)

    P.S. and add jasperserver.jar as a library to you scriptlet project

  3. I have found the solution. May be it will help somebody.

    1. In main report created parameter NAME_OF_MY_PARAMETER with type of net.sf.jasperreports.engine.JRDataSource

    2. Created scriptlet 

    3. In scriptlet beforeReportInit() method received value of  REPOT_CONNECTION parameter

      Connection conn = (Connection) this.parametersMap.get("REPORT_CONNECTION").getValue();[/code]

          Run query which I needed and received result (ArrayList in my cause)

         Processed  result and got ArrayList which I needed (i.e. added additional rows)

    4. override setData method in scriptlet

      public void setData(Map parameters, Map fields, Map variables, JRFillGroup[] groups) {    super.setData(parameters, fields, variables, groups);    JRFillParameter parameter = (JRFillParameter) parameters.get("NAME_OF_MY_PARAMETER");    parameter.setValue(JRMeasureDataSourceFactory.getDataSource(measures));}[/code]
    5. call setData in beforeReportInit method of scriptlet

    6. In main report created subreport and as a DataSource of it  set parameter NAME_OF_MY_PARAMETER

    7. in subreport left its query as empty (or as select 1)

    8. added field to subreport which had type and name which I need

    9. created chart which I needed

  4. Hi all,

     

    Can anybody give right direction in solving such problem.

     

    I have query (MySQL) which returned as result table with fields: "year", "month", "day", "hour", "someValue_1", . . . , "someValue_4".

     

    My customer wants that I added HTML5 Chart (StackedColumn) to report (I work with Pro-version).

     

    And this chart must always have 24 samples (on X-Axis) , but it's problem, because there are some empty values, i.e. we have hour  like this 1, 2, 3, 5, 8, 10

     

    My questions are:

     

    1) Which method should I use to add empty rows to table, i.e. if there is not hour number 3, I have to add row which hour = 3 and all values = 0;

    2) Can I into scriptlet load ALL values ALL rows(fields) in local variable?  And then change it?

     

    Best regards, Andrew

  5. Hello, everybody!

     

    Is there way to combine arbitrary graphs in one chart? Yes, I know about ColumnLine/ColumnSpline chart, but this chart allow me have only one (last) graph as Line/Spline whereas I need 2 columns and 2 lines.

     

    I found helpfull article:

     


     

    About  combining chart types in highchart library.  

     

    BUT I can't apply this info to Jasper Studio. How can I point JasperSttudio to use type of series?

     

    BR,

     

    Andrey

  6. Can somebody convert Pie chart to HTML5 one? How can you convert this type of chart if there are more than 1 series in pie?

     

    i.e. I have Pie3D

    <pie3DChart>

    <chart theme="aegean">

        <reportElement x="583" y="97" width="350" height="180" uuid="57f9d143-e18d-4f2d-a001-e4b09f76da72"/>

        <chartTitle/>

        <chartSubtitle/>

        <chartLegend/>

    </chart>

    <pieDataset>

        <pieSeries>

            <keyExpression><![CDATA["XX"]]></keyExpression>

            <valueExpression><![CDATA[$F{Call_TotalXX}]]></valueExpression>

            <labelExpression><![CDATA[$F{CallPCentXX}.toString()+"%"]]></labelExpression>

        </pieSeries>

        <pieSeries>

            <keyExpression><![CDATA["YY"]]></keyExpression>

            <valueExpression><![CDATA[$F{Call_TotalYY}]]></valueExpression>

            <labelExpression><![CDATA[$F{CallPCentYY}.toString()+"%"]]></labelExpression>

        </pieSeries>

    </pieDataset>

    <pie3DPlot>

        <plot/>

        <itemLabel color="#000000" backgroundColor="#FFFFFF"/>

    </pie3DPlot>


     

     

     

     

    How convert if to HTML5 Pie, if this type of chart has only 1 Mesure?

  7. SOLVED:

    I'm resolved this problem like this.
    1) I clear (may be this step unnessasary) .eclipse folder in c:/user/<my_name>. So do I with <workspace> folder.
    2) I change proxy type to "Manual" (Window->Preferences->Network Connections) and edit HTTP and HTTPS "Schema". !!!! Attention !!! SOCKS schema MUST BE empty!
    3) Then I'm restarted eclipse from command line (Win-R "cmd") (or from Far command line etc.) with "-clean" option. I.e. "eclipse -clean"
    4) Then I'm added my Jasper Report Server and all worked fine

    p.s. it's work on 32-bit Windows7 machine with java6u45 and proxy

  8. Hi,

    can I use variable in query directly or it's allowed for parameteres only?

    in my report i want to pass 2-gigit integer to set date within current month  (yes, i know about date type) or if another parameter set to boolean true (or integer 1) i have to ignore that 2-digit integer

    this is my parameters:

    1) DAY_OF_CALC

    type: java.lang.Integer

    default - 0

    2) ALL_DAYS

    type: java.lang.Integer

    default - 0

     

    and variable

    1) CALCDAY

    type: java.lang.Integer

    initial value expression  : ($P{DAY_OF_CALC} == null  ? new Integer(0).intValue() : new Integer($P{DAY_OF_CALC}).intValue()+1)

    this is sql-code

    AND (CAST($P{ALL_DAYS} AS INTEGER) = 1 OR EPC."DAYOFCALCULATION" < $V{CALCDAY})

    then i run a report and get exception " Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][1061][10303][3.62.56] A syntactical error is in a condition ESCAPE.  ÐŸÐ¾Ð´Ñ€Ð¾Ð±Ð½Ð¾Ñти Ñмотрите Ð² Ð¿Ñ€Ð¸ÐºÑ€ÐµÐ¿Ð»ÐµÐ½Ð½Ð¾Ð¼ Ð¼Ð¾Ð´ÑƒÐ»Ðµ Throwable. ERRORCODE=-4463, SQLSTATE=42601  "

    i try to use parameter CALC_DAY instead of variable like this

    parameter CALC_DAY

    type: java.lang.Integer

    default value expression:

    ($P{DAY_OF_CALC} == null  ? new Integer(0).intValue() : new Integer($P{DAY_OF_CALC}).intValue()+1)

    and then i rewrite sql :

        AND (CAST($P{ALL_DAYS} AS INTEGER) = 1 OR EPC."DAYOFCALCULATION" < $P!{CALC_DAY})

    when i run report it was generated successfully, but when i integrate my report in program i get error "!Forinputstring__!" if i not filled CALC_DAY-field

     

    P.S.sorry for my terrible english

×
×
  • Create New...