I'm very new to Jasper Report, and alter an existing jasper report to repeat a field dynamically. The current report is for a cashier receipt, which has in the footer a label signature, followed with a line, on which the client sign the receipt...
now, we mignt have more than a client (1 to 9). Thus, I need to repeat this line as many times as the number of users on the account. (the number of signers is set in field (Java bean) that is passed to the report.
Does anyone have a clue on how to do this?
I fixed the issue and I wanted to share the solution with you. Actually, in my the reason why it didn't work is that I've put my fields (signatures and labeles) in the footer. It turns out that the footer is static. You specify its height once, and it remains the same.
In contrary, the body can be adjusted dynamically dependins on the number of rows you displaying... unless you configure it otherwise.
I didn't try it, but I believe the header works the same way as the footer
Related
I am trying to display a certain message in the Report Header section based off if the Report Footer section is suppressed.
I need something like... ifSuppressed()
Does something exist like that in Crystal Reports?
In case something similar does not exist... here is my ultimate goal.
I need a value to be determined in the Report Footer section. If said value is greater than another value then I need a message to be displayed in the header.
The problem which I believe is that one of the values used in the calculation in the footer is from a sub report which I had to put in the Page Header to get what I needed. Therefore, I could not pass the value above the Page Header to the Report Header so I am trying to see if I could determine if a section is suppressed (Which is based off some variables in the sub report) and go from there.
Sorry if that is confusing and can elaborate if needed.
Of course after I post a question... I typically figure it out.
So here it is.
I created another formula to grab the SUM I was looking for with the running total.
I also created a formula to grab the amount I need to compare to (Which was from the subreport).
I then created an additional header so I have now header 1 and header 2. I put the subreport in header 1 and the two formulas in header 2. This way I can grab the sum and pass the number from the footer to the header because the subreport is above in header 1.
I then could do my comparison and display my message correctly.
I have a report of a bill and i want to make that the value on the footer (which should represent the sum of all of the items on the page) of one page appears on the header of the next page, just like a bill should have.
Any idea on how i can do this?
Regards,
I can't test this (don't have a copy of CR in front of me), but try this:
Create a running total of your summary value. Use the default options. You should be able to do this by just right-clicking.
Move the running total to your page header.
I am using iReport 3.7.6 to create this report.
I have a report based off of an XML file. There is a 2-column master report and it has a detail band with a subreport.
I have a field called "Name" in the subreport. I want it to print at the top of every page. Or even at the top of every column. I have tried virtually everything I know how to do.
"Print When Detail Overflows" doesn't work, because this setting is in the detail.
I sure hope I don't need to create a subreport for every report break I want. I'll have like 4 or 5 subreports.
Is there some way to determine when the page has changed, and then use that event in a "Print When" expression?
Here is one solution, presuming the value does not change between pages:
Write a query for a subreport that obtains only the Name value.
Change the dimensions of the subreport to be as small as necessary.
Place the subreport in the page header band of the master report.
To answer your question accurately, more details (such as pictures of what you have versus what you want) would be helpful.
you can use pageCount variable which is implicitly available in jasper reports to know whether the page has changed or not.
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
Using iReport, how do you set a variable (could be a parameter, or a value in the REPORT_PARAMETERS_MAP) to Boolean.TRUE at the start of a new band?
There are some fields in the header that should only be displayed after a specific band has started being filled.
Thank you!
AFAIK, it does not wirk that way. It goes straight from the header, passing thru each band header down to the detail band and back to the footer. That's the way one can set sums in the footer of a band, being calculated from the data available at that segregation level. But the filling process for a jasperreports document is pretty straightforward.
In the properties of each text field you have two options available for this issue: "Evaluation Time" and "Evaluation Group". These options can be used to control the filling time of the field.