How to make the following report using Jasper Reports - jasper-reports

I collect test results between different locations. I can never predict the amount of locations that I should generate the report for and I need to make a dashboard representing these results. The dashboard should look like this (Assume a tabular structure):
Title
Report info 1|Report info 2
Conditionally displayed report (info 3) spanning the whole table columns
Report info 4|Report info 5
Blank Cell|Location A|Location B...etc
Location X|X-A result|X-B result...etc
Location Y|Y-A result|Y-B resutl...etc
.
.
etc
I've read A LOT and after a lot of reading I still don't think I can start making a JR report !
Although, after a while of chasing the solution of doing so using tables, I found that I should use crosstabs instead because tables aren't dynamic enough (i.e. since I can't predict the amount of rows\columns that will need to be displayed). But then after reading the crosstabs section I found that it's purpose is to summarize results, like calculate totals, averages, minimum and maximum..etc and still, that's not what I need. I'll have to provide all the results locations on the x\y axis and their results, no SQL will be involved.
Also what data structure would be suitable for that ? A datasource ? A java collection\object passed as a parameter ?
Any idea how can I do that with JR ?
Also a I'm finding JR VERY confusing and complicated. I was very happy to read the freely available ultimate guide and check the demos but that didn't help much, it still looks very complicated !
Thanks in advance.

if you cannot predict the amount of columns, crosstabs are the elements you have to choose. But be aware, that the width of a Jasperreport is static (and like this possibly not optimal for your purposes).
A crosstab will summarize your data only, if you have a column or row label twice, and only if the data is not sorted by the crosstab itself or by your datasource.
According to your description, I would use a report layout like
Title-Band: Title, Infos etc
Summary: Crosstab
You could pass the static title content as parameters into your report, the crosstab content as a datasource (e.g. a bean collection)

Related

Tableau make one line out of two if same city name

Does anyone know if I can add two rows together so that I end up with just one row in Tableau (see screenshot)? So, if both rows are city Aachen and one row has a value for cost but not for purchasing power and the other row has a value for purchasing power but not cost, I would want just one row with both values. I am not interested in the columns "Table Name" and "Document Index(...". Thankful for any help!
Manipulating data like that in Tableau is usually no-go. Nevertheless, you can try Tableau prep and you should be able to do what you need here. Or maybe a different tool (even excel).
With that said, even though you have the info in two rows, the default approach for Tableau is always to aggregate data, so even if you have many rows with similar cases, once you take it to a viz using City (for example) as a dimension, this issue shouldn't really matter.

Prevent grouping column header in JasperReports

i want to make an Crosstab Template for my data.
For each value there is a timestamp, a location and the name of the device from which i get the value. So i am giving a list of values via Java and a JRBeanCollectionDataSource to my report, for the example below this would be 9 values while each of them has 3 additional parameters to place it on the right column/place in the crosstab.
When i give this sort of data to my Jasper Report with a Crosstab (Crosstab is needed cause i don't know how many rows and columns my report will have) in it, Jasper orders/groups the columns and the output looks like this:
But what i want is to show the data in the sequence i give them to my report, for example:
I am using Java to fill my report with a JRBeanCollectionDataSource and a self defined DataSource (this works perfect, i am working with this method for months).
Is there any way this kind of column grouping could be prevented? (i have a working crosstab template but i am not able to find the propertie with the help of i can solve my problem)
Hope you people can help me.
Have you tried to tell the crosstab that your data ir already sorted?
http://jasperreports.sourceforge.net/schema.reference.html#crosstabDataset
Click the crosstab element, in the Dataset Tab, mark "Data Pre Sorted".

RDL is taking very longtime to render the report

In my report, I have 1 Tablix and 40 columns, i am simply dumping my data into the report, Scenario is as follow:
First row is for heading of the reports.
In Second row, i have data bound columns.
In third row, SUM expression.
I have some 5000 rows in my data table, This scenario is taking around 18 seconds to render the report.
Now the problem is that I need to apply colors dynamically eg.
=iif(CellValue >= 0 , "Black","Red") to all of my columns. as soon as i have applied this expression, report took around 5 mins to render.
Kindly share you expertise.
Regards
Inderjeet Singh
Sometimes SSRS has a bit of trouble doing lots of calculations during rendering. One thing to try is to have this calculation done as a column in the SQL if you can. Then simply refer to this field to determine the color. If you can't do that, add a calculated field to your dataset so that the calculations are done at a higher level than cell-by-cell. That usually helps too.
Based on my personal experience I have found that adding filters within SSRS tends to slow it down. Based on your dataset though it should not have much problem.
Additionally, if you have a grouping set to display pages on a single page (i.e. Keep together) that will slow it down as well.

How to accommodate 100 columns in a single report?

Requirement:
I have one new requirement in Crystal Reports.
I need to show 100 columns in the report. I have tried using Landscape option but maximum I am able to accommodate are 20 columns.
Can someone have any idea on how can I accommodate 100 columns. Thanks in advance.
Practically it is not suggested to take 100 columns..as this can create an issue while monitoring the data in crystal reports
But if you still need to accompdate the 100 columns then follow below process.
go to File --> Page Setup --> there go to Unit --> for selected option give maximun size for Horizontal Component
This will increase the size of the report and now can insert required number of columns
Since this report is not for print and will be exported into an Excel format, just make your page as big as you need it. This can be done by going to "File" → "Page Setup" and adjusting the following things:
Check "Dissociate Formatting Page Size and Printer Paper Size"
Might as well flip the page to "Landscape"
Enter a large number in "Horizontal"
You should also note that because you're exporting this data (especially as "Excel - Data Only"), you don't need to make the columns wide enough to display; as long as the field is on the canvas they should show up as a column.
The size of the columns doesn't matter if you are going to export to Excel data only. So you can make the columns as small as you want, even if the report is not readable it will be exported OK.
If you want just to export some data and your report does not include subreports you can go without Crystal reports. Will be much simpler to set the SQL and preview data in a grid (which is scrollable) and then export it to Excel. It will look better too.
There are some tools that can do this and I guess you can easily find something on Google. I am using R-Tag (www.r-tag.com), which is free. You can see it in action here: http://www.r-tag.com/Pages/Preview_Demo.aspx

Crystal Reports: Cross-Tab Column Arrangements

I am looking for a way out in cross tab, so that if the columns exceed in cross tab, they shouldnt go on next page..rather a new cross-tab should repeat after the first one.
For example, two columns are displayed in a cross tab :
Now if a new column is added, and assuming that it could not be accomodated within the given page width limit, it will go to a page next to it in CR by default.
But in my report it is required to be shown below the first cross tab (and not on next page), which will look as follows:
Please do suggest me if there's a way out :)
Thanks in advance
Your question is perfectly reasonable, but I'm pretty sure that in CR-XI, there is no automatic way to do this. I recommend skipping the cross-tab designer completely and just making your own:
Make a new CR using a placeholder table that has exactly 1 record.
In this CR, suppress everything but the details section. Add a new details section so you will have Da and Db.
In Da, add a subreport. Use your real datasource and add Column1 and Column2.
In Db, add a subreport. Use your real datasource and add Column3 and Column4.
I don't have time to test this, but I think it will display all the columns as you requested.
(Instead of step 1, you can probably use a placegrouper group in your report that only has 1 group. Then, when you add the subreports, make sure to not add any links to the main report.)
Edit
A dynamic number of columns makes this request much more difficult to do in Crystal.
Maybe you could autogenerate the entire report from a script. I couldn't help you with that, but I'm sure someone else on StackOverflow will.
You can use MS Excel to achieve something similar. Use MS Access or something similar to set up a crosstab of your data. Open a new Excel workbook and import your crosstabbed datasource using Data->Import External Data->Import Data (this imports the entire table, regardless of number of rows). In Page Setup, change settings to Fit to (blank) pages wide by 1 pages tall. You can format the data however you like and the format will be retained. This Excel method will squeeze all your columns into a 1-page wide area. It's not quite what you're asking for, but it will work.
The number of columns may be dynamic, but do you know what the field names could be? For example, your columns include 0-50 US States, then you know what the column names will be, just not which ones or how many. If this is your situation, then use my first suggestion (check off the suppress if blank options to hide unneeded subreports). It won't be pretty (alot of white space), but it can get the job done.
A possible solution can be a multi column report. But it can be difficult to make the row labels and values in the same line.
If you can create an additional row grouping then you have the solution that you want. For example if your columns have number like in your sample. Then you can add a formula like:
columnId \ 2