Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Last row won't print completely Post Reply Post New Topic
Author Message
EdoArles
Newbie
Newbie


Joined: 25 Aug 2011
Online Status: Offline
Posts: 5
Quote EdoArles Replybullet Topic: Last row won't print completely
     Posted: 25 Aug 2011 at 10:32am
Hello!
It's my first post in this forum!
Thanks in advance for the help.
 
I have a little problem with a report i'm doing.
The last row in the report won't print in the report.
It only prints String values, but won't print currency values.
I have grouped the results by salesman, country and date
 
something like this
 
Code          Name            Country              Invoice           SalesOrders
 
001          Alexis A.             CO                 1,253.03$          12,546.02$
002          Alexis C.             CO                  
 
                                     Total                  1,253.03$
 
the cliente code 002 has an invoice balance, but it won't print it, and it wont add it
Any ideas?
IP IP Logged
EdoArles
Newbie
Newbie


Joined: 25 Aug 2011
Online Status: Offline
Posts: 5
Quote EdoArles Replybullet Posted: 25 Aug 2011 at 10:56am
PD. It always happens in the last record of the table.
Would it help if I use 'OnLastRecord'?
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2011 at 10:58am

are we looking at group header or footer here or a detial row?

are the invoice and sales order formula or summarized fields? if so what is he fomrula or summary?
IP IP Logged
EdoArles
Newbie
Newbie


Joined: 25 Aug 2011
Online Status: Offline
Posts: 5
Quote EdoArles Replybullet Posted: 25 Aug 2011 at 11:05am
is the group footer
and they're formula
 
WhilePrintingRecords;
currencyVar FacTot;
if {A.DocNum} <> Next ({A.DocNum})  or  OnLastRecord
then Sum ({A.DocTotal},{B.DocNum});
FacTot := Sum ({A.DocTotal},{B.DocNum})
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2011 at 11:39am

can you try using a running total alonside this to see if it works correctly.

name=doctotal_test
field to summarize=a.doctotal
type=sum
evaluate = for each record
reset= on change of group, select b.docnum
IP IP Logged
EdoArles
Newbie
Newbie


Joined: 25 Aug 2011
Online Status: Offline
Posts: 5
Quote EdoArles Replybullet Posted: 25 Aug 2011 at 12:43pm
The total works fine. I have results to compare with, and it's fine. The issue comes when printing the las record.
 
I think the problem is with the control structure
 
if {A.DocNum} <> Next ({A.DocNum}) or OnLastRecord
 
The Total part has two formulas to sum that formula I posted before
 
WhilePrintingRecords;
Global currencyVar valor;
valor := valor + {@Facturas2011} -- This one in the group footer
 
WhilePrintingRecords;
global currencyVar valor;
valor;                                           -- This one in the Report Footer
 
IP IP Logged
EdoArles
Newbie
Newbie


Joined: 25 Aug 2011
Online Status: Offline
Posts: 5
Quote EdoArles Replybullet Posted: 26 Aug 2011 at 10:41am
ok, I think I got the problem, but I have no idea how to fix it =(
 
it' in the Formula
 
WhilePrintingRecords;
currencyVar FacTot;
if {A.DocNum} <> Next ({A.DocNum})
then Sum ({A.DocTotal},{B.DocNum});
FacTot := Sum ({A.DocTotal},{B.DocNum})
 
it doesn't compare the last record.
 
any ideas on how to fix it >,<?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Aug 2011 at 11:34am
I was suggesting to try running totals to see if they printed correctly, not to see if the value was correct.
Try changing the option in your formula to 'use default values for nulls'
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