Recently, I have been busy designing various reports with Crystal Reports, all of which adopt the push mode.
The basic situation for designing a report is as follows:
1. Create a dataset
2. manually create one or more table structures in the dataset;
3. Create an RTP file;
4. Use databaseexpert to import the created dataset;
5. Use this dataset during report design;
Now I have a report in this format, so I plan to create a table for each of the three phases of A, B, and C in dataset.
Parameters |
A phase |
Phase B |
C phase |
|
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Total active power (kW) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The three tables have the same structure and contain the following fields:
Rowname;
Maxvalue float;
Maxvaluetime datetime;
Minvalue float;
Avgvalue float;
Provalue float;
When importing the dataset to the RTP file, the expert will require Association. For the first time, I deleted all these links. Although the association is deleted, these datasets can still be added to the rpt file. However, a problem occurs when the report is designed and run.
Assume that the values of Table A are in the following two columns:
Total active power (kW), 100,200 22:22:22, 10, 50, 75
Total active power (kW), 100,200 22:22:22, 10, 50, 75
Table B and Table C have the same values. Normally
Parameters |
A phase |
Phase B |
C phase |
|
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Total active power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total reactive power (kvar) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
But it is actually shown as, a total of 8 rows:
Parameters |
A phase |
Phase B |
C phase |
|
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Total active power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total reactive power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total active power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total reactive power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total active power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total reactive power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total active power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total reactive power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
I suspect that the link was deleted during the dataset import process of Database Expert, so I decided to re-import the dataset;
First, Use Database Expert to delete the original imported dataset, set row as the primary key in dataset, and then use Database Expert to re-import the dataset. When setting the Association, delete all other associations, leaving only the associations between primary keys.
Then run the original program and the expected results are displayed:
Parameters |
A phase |
Phase B |
C phase |
|
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Maximum Value |
Maximum time |
Minimum value |
Average Value |
Overview of 95% Rate |
Total active power (kW) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
Total reactive power (kvar) |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |
100 |
2006-11-11 22:22:22 |
10 |
50 |
100 |