"Stretch With OverFlow" option overlaps another text field - jasper-reports

I have set the "Stretch With Overflow" option True to some text fields (Denomination, From, To, Stock, Amount). There is one text field which is placed below these text fields ($F{grandTotal}). The below situation occur when I generate the report.
Can anyone please suggest what should I do to avoid this circumstance?
And this is the scenario of my report design.

I have found the answer to this problem. Here is what I've done-
Right click on report name and select Add Report Group
Select a group name and click next.
Check Add Group Footer option.
Then place the $F{grandTotal} in the group footer and Voala! it's done.
Here is what happens: The group is added with respect to the detail band. So, my $F{grandTotal} field is placed perfectly after the detail band column values are generated.
Thanks...

Move grandTotal to summary or ColumnFooter Band. In this use case I would suggest using a variable that aggregates "total" field so You don't need grandTotal field, unless grandTotal aggregates values not shown on report...

Related

Suppress a field and its placeholder in Crystal Reports

I am working in Crystal Reports to generate a report, and I would like to add a note/remark for some records, so the record should be double-lined for these specific records and a single-line for others
the issue is that the row should be in its standard height unless a specific field has a certain value. In that case, the row should be expanded and field with red-colored note is placed in the expansion.
I tried suppressing the fields but it does not remove the placeholder
The attached is what I am aiming to do, the Zurich Record has a note in red color, announcing the trip is for ladies only.
I will be gratefull for anyone can give me a hand
There are multiple ways to accomplish the same.
Create a name field formula and append the "conditional text" based on logic
if condition then
text:=text + "*dummy text"; // this is just an example
//add conditional color logic for appended text
Create another detail section just below the existing detail, and add conditional show hide logic to suppress.
You have to check the alignment of fields in the previous detail section for "Can Grow" option- like you want "dummy text" to be aligned in height with other column data?. Because with this option, your text field will always appear to be below your row.
You can add another field and place it below Name, and add formula on its height to be suppressed, based on condition. (Again this will mess up if your name field grows into multiple lines, by overlapping this field in the process).
This could be done with a second DetailSection.
Create a new DetailSection below the existing one.
Put the note/remark in the new DetailSection
Edit the suppression-formula of the new DetailSection and insert the suppression-formula that's currently used on the note/remark-field

Designing crystal report to match a template

I need to design a crystal report that matches a invoice template. Which means that the page will contain the layout & the crystal report will printout the values in the gives spaces. What is the easiest way to align the labels so that they will print out at the right location on my bill.
For example, If I were to get my printout on the invoice sample shown in the below image, how can I align the today's date label right in front of the date field.
I will try to help to the extent I can:
Logo, Address and date are printed once then those should be in report header so that it will be printed once...
To allign date filed just place the date to the right of the design of the report header.
2.if Bill Number and other items are needed only once then place those in report header.. If place is not sufficient then increase the size of the header of insert a section below.
3.Now group the report with the item and place the Description etc items in group header.
4.Place the values in Detail so that those will repeat for the items if there are more values for each item.
5.For sub total, PST, GST take in group footer. If one is not sufficient then insert a section below for each group footer.
6.For Notes, Total, Paid, Total Due use report footer as these need to be printed only once.
7.Take one more report footer section and write Thanks for your business.
Hope I explained what is needed.

crystal report - repeat group header across multiple column

I have a report that has 3 columns and it is grouped by a value that i display in the group header. The report is setup to run down then across.
If the details span across multiple columns, how do I repeat that group header on the next column.
I have already checked "repeat group header on each page" in the group expert.
I have already checked "format groups with multiple column" in the Layout tab of the details section.
It will not let me insert a text object in the group header of each column.
Not sure how to do this. I could write a formula to only show at the top of each column, but not sure if there is a function to find out when the second column has started.
edit
What i want is below
Group Header Text Group Header Text Group Header Text
Detail Values Detail Values Detail Values
Detail Values Detail Values Detail Values
I would like to have the Group Header Text show at the top of each column. Doesn't matter if its the start of a new group or in the middle of the group.
thanks.
okay, I have your solution, the field, that you are grouping by , just place it on to the page header and it will repeat itself on every page until the columns of that group are finished.
Lets say you are grouping by Employee Names, just put the Employee Name field on to the page header and it should solve the issue, I jsut tried it and it worked, thanks.
There is Previous() function available in formulas that allows to show-hide a Text Object based on the change of specific field value from previous to current record.
Is this what are you looking for? Can you edit you question drawing a sample af what you have and what you want?

Fetch Cross-tab grandtotal?

I have a cross tab inside a subreport. I need to fetch the grandtotal of cross tab and display it in a textobject under the cross tab. Any clue how this can be achieved ?
Drag and drop the database or formula field you want into the detail section of the report. (Remove any unwanted guidelines / column headings that this generates.)
Right-click the inserted detail section item and select Insert > Summary... . Specify Sum, to be inserted in the same section as the datagrid is located. (Remove the detail section item, if you don't want it in the detail section.)
The total field can be dragged and dropped into position under the data grid. If you specifically want it in a text field, then insert a blank text field into the report under the data grid and then drag and drop the total field into it.
Do you have any criteria or special formula in the crosstab? If not, then you could probably just make a new formula sum({table.field}) and put it wherever you like.
(If this subreport is grouped, you may want to use sum({table.field},{table.group}))

How to calculate sum of a formula field in crystal Reports?

In some inherited code, I see group headers/footers have items like 'Sum of #numcount' . I cannot get the sum of a formula field. Any thoughts?
The only reason that I know of why a formula wouldn't be available to summarize on is if it didn't reference any database fields or whose value wasn't dynamic throughout sections of the report. For example, if you have a formula that returns a constant it won't be available. Or if it only references a field that is set throughout the report and returns a value based on that field, like "if {parameter}=1 then 1" would not be available either.
In general, the formula's value should not be static through the sections of the report you're summarizing over (Though the way Crystal determines this is beyond me and this doesn't seem to be a hard and fast rule)
EDIT: One other reason why a formula wouldn't be available is if you're already using a summary function in that formula. Only one level of summaries at a time!
(Assuming you are looking at the reports in the Crystal Report Designer...)
Your menu options might be a little different depending on the version of Crystal Reports you're using, but you can either:
Make a summary field: Right-click on the desired formula field in your detail section and choose "Insert Summary". Choose "sum" from the drop-down box and verify that the correct account grouping is selected, then click OK. You will then have a simple sum field in your group footer section.
Make a running total field: Click on the "Insert" menu and choose "Running Total Field..."*** Click on the New button and give your new running total field a name. Choose your formula field under "Field to summarize" and choose "sum" under "Type of Summary". Here you can also change when the total is evaluated and reset, leave these at their default if you're wanting a sum on each record. You can also use a formula to determine when a certain field should be counted in the total. (Evaluate: Use Formula)
You Can simply Right Click Formula Fields- > new
Give it a name like TotalCount then Right this code:
if(isnull(sum(count({YOURCOLUMN})))) then
0
else
(sum(count({YOURCOLUMN})))
and Save then Drag and drop TotalCount this field in header/footer.
After you open the "count" bracket you can drop your column there from the above section.See the example in the Picture
You can try like this:
Sum({Tablename.Columnname})
It will work without creating a summarize field in formulae.