Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Multiple Records Post Reply Post New Topic
Author Message
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Topic: Multiple Records
     Posted: 24 Nov 2009 at 6:55am
I have a Connections By Meter report. The report lists accounts that have been connected to a particular meter. The turn on dates for the accounts must be within parameters set by the user.
 
We are using XML for this report. The meter information is stored in D0, account information in D1 and account deposit information in D2. The accounts may have multiple deposits. Also, there is the possibility that the same account was connected to the same meter multiple times in the same day(lets call this a user error). Regardless of the error, if it was connected between the parameter dates, it needs to display on the report.
 
The problem I'm running into is Crystal wants to redisplay the Meter and Account information for each meter when an account has multiple D2s(deposits).
 
I remedied this by suppressing the detail when:
 
(not isnull({table.d2deposit})
and
{table.meternumber}=next({table.meternumber})
and
{table.accountnumber}=next({table.accontnumber})
and
{pcr}=next({pcr}))
 
The problem I'm having with this suppression formula is when I come accros a meter that has one of the errors or same account connected to the same meter on the same day, then it wants to suppress that as well. Can I get some insight please?
 
Thanks!
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Nov 2009 at 6:23am

CR is suppressing all records, but you want to keep one record, right?  If so, suppress the detail and put the information that you want in group header or footer, this gives the one record that you are looking for.

Is this what you are after?
 
HTH
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 25 Nov 2009 at 6:49am
Not necesarilly. It won't suppress all records but it is suppressing the record that I actually want to display. Here is some XML data and what Crystal gives me:
 
<d0>
<meternumber>1</meternumber>
<CurrentTurnOn>112509</CurrentTurnOn>
<1stPrevTurnOn>112509</1stPrevTurnOn>
<d1>
<accountnumber>1</accountnumber>
<d2>
<depositamount>50.00</depositamount>
<depositsequence>1</depositsequence>
</d2>
<d2>
<depositamount>25.00</depositamount>
<depositsequence>2</depositsequence>
</d2>
</d1>
<d1>
<accountnumber>1</accountnumber>
<d2>
<depositamount>50.00</depositamount>
<depositsequence>1</depositsequence>
</d2>
<d2>
<depositamount>25.00</depositamount>
<depositsequence>2</depositsequence>
</d2>
</d1>
</d0>
 
This code would display something like:
 
Meter Number      Account Number            Deposit      TurnOnDate
        1                          1                        50.00         112509
        1                          1                        25.00         112509
        1                          1                        50.00         112509
        1                          1                        25.00         112509
 
But I need:
 
Meter Number      Account Number            Deposit      TurnOnDate
        1                          1                        75.00         112509
        1                          1                        75.00         112509
 
Don't get into the deposit amounts. I have those covered. I just need to suppress the correct records.
 


Edited by FrnhtGLI - 25 Nov 2009 at 6:49am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Nov 2009 at 7:55am
Personally, if you are getting the data from a stored proc, I would try to dedupe there, but given the information, there is nothing that makes a record unique as they could legimately have made 2 deposits for 50 each for a total of 100...which is just as bad for a stored proc, and that you need 2 rows with the total deposit displayed, I don't know.  All that comes to mind is to create a string of deposits for the meter and the account and turnondate and if the amount is alread in the string to skip it, otherwise to include it.
 
Since you are using a disconnected recordset, you might try a subreport since it doesn't hit the database, but I really don't know of a sure fire method as the example is unique but there is no reason to assume it always will be.
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum