Addid Static Report Titile on Crystal Report - crystal-reports

i have faced some problem , when i want to display some static Title after i have displayed a few number of Rows . for Example , the first 4 rouws on crystal Report has header"Training " the next 4 rows mmust have "Education " Report Header.
i am trying to display the report using by calling one Stored Procedures any one who can help me please??

You could insert a new detail section above your current detail section and have the new section only be visible based on record count or some value in the data. Add a new section in the details, Format Section->Suppress and enter a formula controlling when the new section is visible. For example, a running total field named InspIDCount and this formula in the suppress section ({#InspIDCount} mod 5 <> 0) will cause a blank row every 5 records. The new section could contain a formula to display the correct "title".
I think I misunderstood your question. The number of rows for each type is probably not constant. A better way to handle this would the to insert a group into your report if the data is not already grouped. Group by the record type (Education, Training Etc). You probably want to suppress the group header but show group by footer. The footer could display a field from the database showing the type or it could display a formula (string) based on the record type. It would only take a few minutes to give this a try.

Related

jasper report show count on footer of a specific query

am very new to jasper report
also I have tried looking at videos but can not seem to get this one concept
basically there is this main query which i have
select * from table
which is populated in the details area
however i want a second query
select count(*) from table where name = "tim"
and put the count on the footer
can this be done using jasper
any tutorial to this concept or guidance would be helpful
to sum up the details area should show all the data where as the footer should only show counts of a few things.
You can only have one DataSet (therefore query) for the report. In your case this is your main report select * from table, which seems to be working well.
You have two options for adding the information you want:
(and I would say the better option) is to add a variable $V{tim_count} which is configured as:
initial value 0
expression value "tim".equals($F{name}) ? 1 : 0"
calculation function sum
there are multiple ways to increment this variable, so I'll leave that with you. In the footer you would then add a text field with the $V{tim_count} variable as it's contents.
You can read about variables here https://community.jaspersoft.com/wiki/variables
You can add an object that has it's own DataSet:
Table
List
Subreport
You would then be able to add your query to that object and display it appropriately. As you can see, displaying a COUNT is not really the most appropriate way to do this.
Note - I don't suggest this way

calculating the percentage based on the number of records in the crystal reports

In my crystal reports I have a field called "PAYMENT" it has to be displayed according to the following requirement
REQUIREMENT
if there is only one RECORD in detail section then it has to display,
PAYMENT=percentage
if there are MULTIPLE RECORDS in detail section then it has to display,
PAYMENT=percentage+(percentage(total value)+remarks)
can anyone please tell me how to do this?
You can use the following formula in CR to count the records
CountRecords
Count ({Table.PAYMENT})
PaymentDisplay
Then create another formula with your decision making:
If COUNT FORMULA = 1 then DISPLAY OPTION 1 else DISPLAY OPTION 2
I have not tested this but it should work.

How to filter records in a single section of Crystal Reports

I have my base record set filtered with a parameter. However, this leaves me with 6 records and I need to filter down to one particular record in each of my sections. If none of the records meet my criteria i cannot suppress the section, it will need to just stay there and blank.
Essentially, I need a method to filter down records that hit one of my sections but not affect the report as a whole.
A few notes:
I cannot use a subreport for this. I need to duplicate this effort over a couple of sections and if I add any more sub reports it just crashes crystal reports (I have a lot of data & a ticket with SAP)
Using a suppression formula hasn't worked yet because I need the section to exist, if it has a null value
Applying no filter doesn't help me because it will duplicate my section 6 times
2 options.
a)
Right Click on white space and choose Insert Group
Choose your field and select specified order or use another record that can filter your data
On the Specified Order Tab click New
Select equal to on the combo box and specified what record you need to be shown
or
b)
Right click on the record
Next to the suppress check box, click on x-2
Here you can create a formula to suppress the records that you don't need.

Crystal Reports set record number in formula

Would anyone know of a way to manually specify a record number within a formula, in Crystal Reports?
For instance, I have a report linked to an SQL server View that sits on top of a table that contains 20 records. This view selects the fields I need and then orders by the highest value to the lowest.
The report then pulls these records into the report in that order. What I would like to do is to be able to write a formula that can select a record based on its number.
I know I can reference RecordNumber in a formula (i.e. If RecordNumber = 5 Then...) but this only works in the Detail section once it actually shows record number 5, and if I place a formula in the header section it just displays False as the header only shows the first record.
I need to create a formula that sets the record number and then displays the desired value of that record number in the header (i.e. something like:
Set RecordNumber = 5
ToText ({table.value})
Can anyone help or is Crystal just not that sophisticated?

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?