How to add number of row and auto increment on Dynamic Report? - dynamic-reports

I want to add auto increment number on dynamic report, i have 4 column
No, Name, Address and Phone how to create auto increment on number like page_count from jasper report

$V{ROW_COUNT} is the variable used to count number of rows just like we user ResultSet.getRow() in java.

Related

How to implement a conditional fomula in Crystal Report

I have a table named tblRecovery with 4 column. ID, LStatus, Amount and RecoveredBy I created a formula to sum Amount Column where LStatus Column value is "WCL". I use following code.
It sum all value of Amount column without condition. I want to sum amount column if Lstatus Column value is "WCL". How can I do that?
if {tblRecovery.LStatus}='WCL' then sum({tblRecovery.Amount})
Crystal Reports formulas work on a per-record basis.
Your current formula shows the sum of tblRecovery.Amount on every single row where LStatus='WCL'.
To get the desired result, create a formula-field with following formula and the create a sum of it:
if {tblRecovery.LStatus}='WCL' then
{tblRecovery.Amount}
else
0

Crystal- Reports: Exclude a field value from running total

In crystal reports is how can one exclude a field value from running total. This field is not suppressed however we donot want to add its value to the sum total.
I would suggest you to create one more column for the calculation purpose and then place after the last column and write below formula:
if column="NonDelivery"
then value
else 0
Now take the sum of this column and then place the sum below your mail value column and supress the newly created column.

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?

Finding the number of column in a table

I would like to know how to tell the number of columns in a table created in iReport. The variable COLUMN_COUNT returns the number of rows, but I want to know the number of columns.
Does anyone know how to do?
The quotes from JasperReports Ultimate Guide:
BUILT-IN REPORT VARIABLES
COLUMN_NUMBER
This variable contains the current column number. For example, on a report with three
columns, the possible values are 1, 2, and 3. The variable restarts from 1 and runs up to
the defined number of columns for each page in the generated document.
COLUMN_COUNT
This variable contains the number of records that were processed when generating the
current column.
PAGE_NUMBER
This variable’s value is its current page number. At the end of the report-filling process,
it will contain the total number of pages in the document. It can be used to display both
the current page number and the total number of pages using a special feature of
JasperReports text field elements, the evaluationTime attribute. You can see this
happening in most of the samples. Check the /demo/samples/jasper sample for an
example.
REPORT_COUNT
After finishing the iteration through the data source, this report variable contains the total
number of records processed.
PAGE_COUNT
This variable contains the number of records that were processed when generating the
current page.
GroupName_COUNT
When declaring a report group, the engine automatically creates a count variable that
calculates the number of records that make up the current group (that is, the number of
records processed between group ruptures).
The name of this variable is derived from the name of the group it corresponds to,
suffixed with the _COUNT sequence. It can be used like any other report variable, in any
report expression, even in the current group expression, as shown in the BreakGroup
group of the /demo/samples/jasper sample).

Addid Static Report Titile on Crystal Report

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.