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

Gaby38

Members
  • Posts

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

Everything posted by Gaby38

  1. Hello, Hereafter, the code I used for the "style" part : <style name="BandStyle" isDefault="false"> <conditionalStyle> <conditionExpression><![CDATA[new Boolean($V{Row_count}.intValue()%new Integer(2).intValue()==0)]]></conditionExpression> <style isDefault="false" style="BandStyle" backcolor="#99FFFF"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[new Boolean($V{Row_count}.intValue()%new Integer(2).intValue()!=0)]]></conditionExpression> <style isDefault="false" style="BandStyle" backcolor="#FFCCFF"/> </conditionalStyle> </style> For the control variable in the "Main" report : <variable name="Row_count" class="java.lang.Integer" resetType="None" calculation="DistinctCount"> <variableExpression><![CDATA[$F{IdIns}]]></variableExpression> <initialValueExpression><![CDATA[new Integer(0)]]></initialValueExpression> </variable> Notice that the $F{IdIns} field is a field of the query result which can be considered as an "id" for each row returned, that means that the variable "row_count" acts as a line number. And in the crosstab , as said, I created a rowgroup which is not visible and used only to activate the conditional style: <rowGroup name="Row_count" width="0"> <bucket> <bucketExpression class="java.lang.Integer"><![CDATA[$V{Row_count}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents mode="Opaque" style="BandStyle"> <textField> <reportElement x="0" y="0" width="0" height="19"> <printWhenExpression><![CDATA[new Boolean(false)]]></printWhenExpression> </reportElement> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{Row_count}]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents/> </crosstabTotalRowHeader> </rowGroup> I don't master all the subtilities of this solution : I suppose that there is a "mapping" of the variables by their names which allows to use in a crosstab a "variable" defined in the main report. In all cases, this solution is working Code: <rowGroup name="Row_count" width="0"> <bucket> <bucketExpression class="java.lang.Integer"><![CDATA[$V{Row_count}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents mode="Opaque" style="BandStyle"> <textField> <reportElement x="0" y="0" width="0" height="19"> <printWhenExpression><![CDATA[new Boolean(false)]]></printWhenExpression> </reportElement> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{Row_count}]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents/> </crosstabTotalRowHeader> </rowGroup>
  2. Hi, One suggestion (that I have not tested) : create a scheduled job running every day of every month, but in the where clause of the query you set a condition returning an empty result except the last month's day and in the scheduled job output thumb you set the condition "don't send anything if empty".
  3. looks like you put your chart in a detail band : you get as many charts as records in your query result
  4. Finally I succeeded. As said in my first post, I created in main report a variable "row_count" representative of the line number in crosstab ( that is different from query response line number) and I created in crosstab not a measure variable but a row header variable "row_count" that I put at the top of the row header variables : this variable has for bucket expression the main report variable row_count. I always have the conditionnal style piloted by the row_count variable ( row_count modulo 2) I affect the conditionnal style and the "opaque" property to the cell containing row_count. 'row_count header) The report element is set to transparent. I affect also the conditionnal style to the detail/detail variables. And it works !!! The whole line has the right colour different from the previous one. In order not to have the "row_count" cell displayed at the beginnig of the row, I set the "Print when expression" to false and the width property to "0". Perhaps is there a better way to do that. Hope will be useful to other guys Gaby Post Edited by Gaby38 at 11/14/2009 20:54
  5. In a more general way, is it possible in a crosstab to have variables or something similar available for the header objects??
  6. Hello, I got the same error message when trying to upgrade to 3.6.1 the jasperreport jar in jasperserver. The whole story is the following one : I was using iReport 3.6.0 and was told that the new 3.6.1 release is available. So I downloaded the new release, but after installation, the reports containing a "List" object generated an error saying that "Print Order" property was not supported. I supposed that this was due to an uncompatibility between the jasperreport ".jar" of jasperserver and iReport. So I tried to upgrade the jasperserver's jasperreport jar and I got the eroor message that the font Verdana was not in the JVM. It seems that the font managing has changed with the 3.6.1 jasperreport release. A short documentation on what to do on jasperserver to be "in phase" with iReport should be very useful for each new iReport release. PS : using the compatibility options of iReport didn't fix my List problem
  7. hello, I already put in place alternate color bands in reports with detail band by using conditionnal styles. I want to do the samething in a crosstab (summary band). I found somewhere in this forum a way to do that by creating a variable in the main report and a "measure" in the crosstab with the same name , evoluting in the same way according the line number and piloting a conditionnal style. It works well but only for the "measures" part : the row header is not affected because the piloting measure is undefined for the row header. Has somebody on this forum fixed that or found another way to do the same thing? Thanks a lot for your help
  8. You act as if your "next" report was run in stand alone mode, that is: - declare a parameter Param1 in the report - declare an input control with name Param1, even if it seems not useful and use it as $P{Param1} in the query
  9. I downloaded the last release of ireport and updated with it an existing report. When trying to execute it (under jasperserver), I got the java exception : org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'printOrder' is not allowed to appear in element 'jr:list'.I tried to fix the problem by overwriting in jasperserver the jasperreport .jar by the one in iReport delivery but in this case I got an error saying that the JVM didn't know the Verdana font. So I went back to the previous status with i<report 3.6.0 and jasperreports 3.5.3 Has anybody got the same troubles ?
  10. Hello, Perhaps, try to create a Group on the id. In the group header put the two fields Familyname and firstname and in the detail band the data field(s). You shoudn't have to deactivate " 'Print repeated values'" It should fix the problem of identical names but different id's Hope this helps Gaby
  11. It's strange! To be sure, I created a small report with only one detail band and one field "NomAct". I defined the query as "select lib_nom_act as NomAct from activite where id_act in ($P!{ListAct})" and defined a string parameter ListAct. and an Input control ListAct I run the report; when prompted, I key : 1,2,3 and I get the right list of name activities without error. So I don't understand why in your case it doesn't work.
  12. One suggestion : not to use a collection but a string. If I well understand, you want to key manually the ids or names of your cutomers, so you have to key something like : " 1,2,3,....,N". If you use a collection you certainly use the $X{} parameter syntax in your query. My suggestion is to use a single value input control with string type and , when prompted, you key your list of values : "1,2,3,..." and declare the parameter as string. In your query you replace the $X{} by a "classical" sql clause : where userid in ($P!{StringListValue}) (notice the "!" after $P) If you had not 2000 customers, you could use a multiselect query with a collection but you don't want. Hope this will help
  13. As far as I can understand, you are asking how to change the date format of your parameters when you run a report and when you are prompted to enter these ones. I had the problem when running my reports in jasperserver : I edited the files "calendar.properties" and "jasperserver_config.properties" in $tomcat/webapps/jasperserver/WEB-INF/bundles and I got the wanted formats. When I run the report from iReport, I get also the right format. Hope this Helps
  14. Hello, I already did that by casting the collection to a string: I got a string like "[1,2,3,..X]". I replaced the "[ ]" by parenthesis "( )" and in the query I didn't use the $X{IN,...] parameter but the classical sql string : "where field in $P!{Parameter}". It worked fine. To cast the collection to string, use the formula : "" + $P{Collection}
  15. Perhaps using a "view" in the database, redescribing the table. If the table changes, only the view has to be redefined and not the reports using this view. No idea about the performance impact, if any !! HTH Gaby
  16. As far as I remember, I read recently on this forum that this was planned for the release of the end of the year. Meanwhile, Swood said that a "patch" would be soon available.
  17. As for me, I did it "manually" by oweriting in jasperserver the jasperreport .jars with those delivered with iReport 3.5.2. Sure, it would be more pleasant that that be done "automatically" but as the update period is not the same for the 2 products, it is not obvious. There should be a warning in the iReport release notes to suggest doing this manual updating.
  18. Another way that I use is to access directly by sql the metadatabase : JIuser and JIuserrole tables. I also use the users rights to make my own access controls to be able to execute such or such report.
  19. I got the same problem. In fact, in standard mode, jasperserver doesn't use smtp authentication. You have to edit the file applicationContext-report-scheduling.xml in $TOMCAT/webapps/jasperserver/WEB-INF directory, to find the bean <bean id="reportSchedulerMailSender" and to add inside the property : <property name="javaMailProperties"> <props> <prop key="mail.smtp.auth">true</prop> </props> </property> I have a scheduled report that sends reports by mail and I use the smtp server of my FAI with authentication. Hope it will help you (solution given by Lucian in this forum some months ago) Post Edited by Gaby38 at 07/21/2009 21:09
  20. Thanks Giulio for your suggestion : you were right! But in fact it was my jasperserver (3.5.1) that had a 3.5.0 jar for jasperreport. So I had to overwrite it with the 3.5.2 jasperreport jar delivered with iReport 3.5.2. A question : when iReport has a jasperreport version more recent than jasperserver, are we obliged to do the update manually?? I don't remember having seen something about that. (My ireport and my jasperserver are on distinct machines)
  21. Hello, I tried to use the List component in a report. No problem : I defined the datalist properties with the right dataset but when trying to run the report under iReport (preview) I got an error : 1 - org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'jr:list'. One of '{"http://jasperreports.sourceforge.net/jasperreports":component}' is expected. java.lang.Exception: 1 - org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'jr:list'. One of '{"http://jasperreports.sourceforge.net/jasperreports":component}' is expected. at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:403) at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:320) at com.jaspersoft.ireport.jasperserver.ReportRunner.run(ReportRunner.java:70) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) I am not a specialist of xml : I looked at http://jasperreports.sourceforge.net/xsd/jaspereport.xsd file and I saw that the "jr:list" component is not defined. Am I wrong?? How to have the list component working ?? I used iReport 3.5.1 and 3.5.2 : same problem Thanks for suggestions Code:
  22. Gaby38

    drill down

    Hello, My understanding is , since the parameters are transmitted inside a URL, they need to be strings. At the beginning, when I tested jasperserver with hyperlinks, I succeeded in transmitting java.util.collections as strings in the URL (in fact, you must "cast" the collection to obtain a string like "[1,2,3,...,N]" then replace the "[ ]" by parenthesis to get "(1,2,3,..,N)" and finally use this parameter in the query not with $X{..} but with " and Field1 in $P!{Param}". As far as I remember, there is a tip for casting the java.util.collection into a string : you must concat a null string : " " + $P{JavaUtilCollection} Hope this will help you If I find my first test I will post it
  23. As I used a lot of charts without problems about data, except from my own, I am convinced that, if the chart says "null serie value", it is why it receives a null value. To be sure that it cannot receive null values from the query, I would do the following : replace each field in the query ("SELECT Field1 from ......) by an expression : SELECT case when Field1 is not null then Field1 else 0 end from ...... ( or SELECT case when Field1 is not null then Field1 else 'AAA' end from ...... if Field1 is a string) If you still get the same error it's an error in the mapping of input data or a bug in the chart
  24. Hello, Remember that a report can contain several sub-reports and that a report can be included as a sub-report in another report. All the outputs of all the subreports will be in the same output file. So my suggestion is to create a Main report containing all the reports you want to send as sub-reports and you schedule this report in jasperserver. Moreover each sub-report can have its own datasource. Hope this will help you
  25. Thanks for your answer, Lucian. But, as I am not very familiar with java, I forget my idea !! I think it woul be an interesting improvment for jasperserver : think of people who receive their monthly invoices by mail. It would be an interesting way to do that.
×
×
  • Create New...