Thomas Zimmer
-
Posts
196 -
Joined
-
Last visited
-
Days Won
12
Community Answers
-
Thomas Zimmer's post in How do I pass a parameter to a sub-dataset? was marked as the answer
The parameter "runDAte" in your main report is of type java.sql.DAte. The subset's parameter "runTimeDAte" is of type String, change the former and you'll succeed.
You won't have to set a default value for the dataset's parameter, as you pass an actual value in the table within you use that dataset :-)
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in using japser-reports for printing a contract was marked as the answer
Hi Susi,
I see two possibilities to solve:
1) attach the datasource to a list element and place the list element into the last detail band
2) pass the datasource to a subreport and print the special-agreements there
Cheers, Thomas
http://www.ThomasZimmer.net
-
Thomas Zimmer's post in 1 report 2 pie charts was marked as the answer
My assumption for your example is, that you cannot do a group by query like you do it. Should there be a count(*) for workstream, and a count(*) for reason?
I would advise to use two datasets (right-click report root in Report Navigator and select "Add dataset"...) with two single queries and connect them to your pie chart. That should be a clear, clean and easy approach.
Cheers, Thomas
http://www.thomaszimmer.net
P.S.: To increase reusabilty (if it makes sense in your context), you could also implement each pie in a simple subreport...
-
Thomas Zimmer's post in To generate excel report without page break with virtualizer enabled was marked as the answer
This issue was addressed several times: http://community.jaspersoft.com/jasperreports-library/issues/4594 , http://community.jaspersoft.com/questions/530836/ignore-pagination-and-virtualizers
However, I can not see a solution in the discussions.
Did you try to use band filters? With them, you could achive the same xls-view without pagination:
http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name}
and
http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.{format}.exclude.origin.keep.first.{suffix}.{arbitrary_name}
But I do not know how it works in conjunction with file virtualizer (but i don't think that should make problems)
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in NotSerializableException SimpleFileResolver was marked as the answer
The SimpleFileResolver uses a java.util.List which is not serializeable. Looking at the source, I assume the simplest way to get around would be to implement your own FileResolver (implement the net.sf.jasperreports.engine.util.FileResolverInterface, copy from SimpleFileResolver and use an ArrayList instead of List)
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in how to pass a parameter to subreport was marked as the answer
Have a look at the jasperreports source package. There are a bunch of examples, especially an example with two different ways to execute subreports:
http://jasperreports.sourceforge.net/sample.reference/subreport/
For general, you either have to pass a ready compiled subreport (object) e.g. in a parameter to your masterreport, or you will have to pass a valid subreport expression. This could for example be $P{SUBREPORT_DIR} + "mysubreport.jasper", where $P{SUBREPORT_DIR} has to be a valid path, accessible from your webapplication.
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in Detect Export Format Within Report was marked as the answer
Have a look at this:
http://community.jaspersoft.com//questions/815695/how-hide-field-print-preview
You can use csv, xls, pdf and others instead of graphics2d in the example above. The elements you want to exclude must have the key <whatever4afilterUneed>
You are also able to filter whole bands in a certain output format: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name}
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in hide row group in Crosstab was marked as the answer
I think, hiding the coumn is not the right way and works not really good:
Minimize the column width and fields to 1px, use an empty expression for the fields.
Other ways to do it:
1) Structure and order your query for the crosstab so that the data can be shown without (re-)ordering by the crosstab (the most efficient approach, by the way), set the flag "Crosstab data is sorted" (or similar, I do not remember exactly) in the settings of the crosstab. Like this, you do not need two row groups, only use the second one.
2) Use one row group with a concatenated row expression of two columns (e.g. "Project 5;r1"). In the presentation you can split the bucket expression and show only "r1" in the text fileds. Like this the data can be ordered by the crosstab itself.
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in No Domain option on server was marked as the answer
There are no domains/topics, ad-hoc reports, analysis ui, multitenancy etc. in the community edition. You will have to buy a proffesional or enterprise license to be able to use this.
Have a look here:
https://www.jaspersoft.com/editions
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in How to hide a field in print preview? was marked as the answer
The key answering all the questions obove should be
net.sf.jasperreports.export.graphics2d.exclude.<whatever4afilterUneed>
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in A question about input control of Jasper5.1 was marked as the answer
you can achive this quite simple with the brand new cool DateRanges in jasperreports:
1. Define a first parameter in your report, which gets the count of days you want to go back. In an input control in jasperserver (if you use that), you can build a combo box selection with a static value list, where the user sees 'latest 7 days records','latest 30 days records','latest 90 days records', but the passed value is an integer.
2. Define a second parameter, which's type is "net.sf.jasperreports.types.date.RelativeDateRange" and initialize it with an expression, usinf the user's selection: "new net.sf.jasperreports.types.date.DateRangeBuilder("DAY-"+$P{selector}).toDateRange()"
Then you can use the second parameter, e.g. in a sql statement by typing ".... WHERE date_colum >= $P{param2}.getStartDate()"
See the attached report to make it more clearly :-)
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in Steps to change jasperserver tomcat port. was marked as the answer
you could have selected that within the installation...
1) shutdown the jasperserver
2) to change later, modify the "server.xml" in "/apache-tomcat/conf/"
Search for
Connector port="8080"
and change for your needs. if there is another tomcat instance running on your system, it would be a good idea to change the shutdown port as well.
3) start the server
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in Do multiple chart lines typically require multiple columns in the dataset? was marked as the answer
No, just use a series expression:
LineNumber (series expression) Category Value where the line number can also be a nice name, which is shown in the legend.
With the disadvantage, that you will have to extra-query the average line. Or you do this within a chart customizer.
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in Relative Dates in a Variable Expression was marked as the answer
IMHO, you should use the RelativeDateRange like this:
($F{warranty_order} == true ? ($F{date_done} >= $P{Prior_Week}.getStart() && $F{date_done} <= $P{Prior_Week}.getEnd() ? 1 : null) : null)
tried it, works.
didn´t know theses posibilities before. many thanks :)
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in [QUESTION] Using an attribute in subreport was marked as the answer
just click on the subreport element in the visual representation of your report. Then search the setting "Parameters" in the "roperties-View (you can de-/activate via the menue)
finally set a parameter-pass:
"Subreport parameter name" must be an existing parameter in your subreport, "Value expression" ca be anything, a parameter, variable or field (as described earlier) or just a static string.
I attached the sample reports her again, because in my iReport installation only one of the subreports opens; either i crashed this or it comes like this within the installation (that would not be nice...).
In the example "master" report, you can see that the field $F{SHIPCOUNTRY} is passed to the subreports. In the subreports the parameter is used in the queries, for example: select * from orders where shipcountry = $P{shipcountry}
I hope this helps.
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in Run a report using Rest_v2 and java was marked as the answer
Ok, here we are. I attached an eclipse sample project archive. It is based on an example for the REST API I found somewhere on the Jaspersoft pages.
I left in the original example "BasicResourceCRUDTest" which creates a folder on the jasperserver, uploads and downloads an image file, and finally deletes the folder. It makes heavy use of the two main classes "RestAPIUtils" and "Consts", which manage all the http-connection relevant things. The most of it was not my effort, so thanks to the Jaspersoft people.
"RESTV2Test" shows how to execute and export a report remotely (report "Employees" from the foodmart demo-installation) as a PDF file, and writes the result to a local directory (directory is hard-coded, report output type can be changed by changing the extension ".pdf" to sth. else).
I hope this helps, have fun.
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in How to print a model made of parameters for a number of times. was marked as the answer
You cannot use the detail band, if you do not have a set of datarecords to print. Instead set the report property "When no data type" to "All sections, No detail" and use the title or summary band to layout your single value parameters.
If you want to print a collection of records in your report, you could use a collection of java beans (representing a record set) as a datasource:
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{MyBeanCollection})
Of course, you will have to build the bean collection first outside the report...
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in Easy question for iReports expression was marked as the answer
hard to as long you do not give more information... the error says that the expression cannot be evaluated. so, what can be wrong?
possibly one of the fields is null? or the field "media_stock_target_price" is zero? (but in this case, as far as I know, you would get a "division by zero" error)
check the datatypes and all possible contents of the fields! check the needed datatype of the element the expression is used in (TextField or sth like this?)
Cheers, Thomas
http://www.thomaszimmer.net
-
Thomas Zimmer's post in How export from html or doc to jaspersoft studio? was marked as the answer
You could have asked Microsoft or Jaspersoft to implement an converter... ;)
No, there doesn´t exist any converter for any output format to convert to JRXML template (beyond .JASPER format....)
You
Cheers, Thomas
http://www.thomaszimmer.net