Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Invoice created in crystal report and specifying placement of Total for EACH invoice

Posted on 2007-09-28
20
Medium Priority
?
891 Views
Last Modified: 2012-06-27
I created an invoice report in crystal reports 10.  The client wants to be able to print multiple invoices at one time.  I have everything working except for the total for each invoice.  For every invoice except the last one, the total prints on its on page.  

The report is set up with 2 groups.  One is the invoice number group and the other is a date group.  Each invoice is sorted by the date of the service and each date has a subtotal.  Each day also prints on its own page (per client's request).  On the last invoice of a group of invoices, the total prints directly under the last subtotal which is where I would like it to print for EACH invoice.  Any ideas?  I've been trying to figure this out for days and days...

Thanks in advance!
0
Comment
Question by:stephaniem712
  • 10
  • 8
  • 2
20 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 19979753
How is your report structured - for example:

RH: ???
PH: ???
GHa:  Invoice #
GHb:  Date
D: ???
GFb: ???
GFa: ???
PF: ???
RF: ???
0
 

Author Comment

by:stephaniem712
ID: 19979920
RH: NONE
PH: Suppress on page = 1
GH#1:ARInvoice.InvoiceNumber -- Suppress = {ARInvoice.InvoiceNo}=previous({ARInvoice.InvoiceNo})Keep together
GH#2:@Date() - Keep together
Details: Keep together
GF#2:@Date() - New page after - Not onlastrecord;Keep together
GF#1:ARInvoice.InvoiceNumber - New Page After;Reset page number after;keep together
PF:  Not used
RF: Not used
0
 
LVL 42

Expert Comment

by:frodoman
ID: 19979989
Where is the field that your totaling and where are the totals?  Are you using custom formulas or did you use Insert -> Total?
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 

Author Comment

by:stephaniem712
ID: 19980068
@Amount - If {OELineItem.ExtendedPrice} = 0 Then {OELineItem.Amount} Else
{OELineItem.ExtendedPrice}  This formula is in the details section.

The subtotals, which is sum of @amount is in GF#2.
The next two formulas (the first one is suppressed) are in GF#1:

WhilePrintingRecords;
Currencyvar S:=Sum({@Amount},{ARInvoice.InvoiceNo})

This one prints the total:
WhilePrintingRecords;
Currencyvar S;
0
 
LVL 42

Expert Comment

by:frodoman
ID: 19980173
If I understand correctly, the value you want printed below each invoice is Sum({@Amount},{ARInvoice.InvoiceNo}) - which is the value currently showing in GF1, correct?

If that's correct just create a new formula in GF#2:  Sum({@Amount},{ARInvoice.InvoiceNo})

btw, why are you assigning the sum to a variable and then printing the variable?  Why not just show the sum directly?

frodoman
0
 

Author Comment

by:stephaniem712
ID: 19980464
I was trying anything to get this to work.  The formula I'm using does work.  The problem is where the total prints.  If I choose to print two invoices at once using a parameter.  The first invoices total prints on it's own page all by itself.  The second and in this case the last invoice's total, prints below the last subtotal - which is what I want on all invoices.  So, if I choose to print 100 invoices at once, invoice 1 - 99's total will print on it's own page, the last invoice's total will print below the last subtotal which is where I want it.....
0
 
LVL 42

Expert Comment

by:frodoman
ID: 19980514
Okay - that would be handled simply by removing the 'new page after' from GF2 but I assume there's a reason you haven't already done that?

frodoman
0
 

Author Comment

by:stephaniem712
ID: 19980613
The client wants each days activity on it's own page with a subtotal, hence the 'new page after' on GF2...
0
 

Author Comment

by:stephaniem712
ID: 19980765
If I add a section - GF#2b and put the TOTAL formula their, then it prints below the subtotal, but on every page.  How do I count the pages before the new page number starts and then suppress the formula on all pages except the last page.  Possible?
0
 
LVL 42

Expert Comment

by:frodoman
ID: 19980770
How are you controlling multiple copies with a parameters?

frodoman
0
 
LVL 42

Expert Comment

by:frodoman
ID: 19980780
>>> How do I count the pages before the new page number starts and then suppress the formula on all pages except the last page

I thought the problem was that it was already only printing on the last page?  I'm sorry, but I'm very confused as to what you are actually trying to accomplish here.  Could you possibly upload some screenshots?

0
 

Author Comment

by:stephaniem712
ID: 19980849
What do you mean multiple copies with parameters?  What I'm trying to do is this.  Say, the client wants to print 2 invoices and chooses the paramter range of Inv# 833 to Inv#834.  Each page of the invoice has one day worth of service.  On the last page of EACH invoice which has one day worth of service is the Total of the invoice.  So, the total is never just on a page by itself.

I can use PageNofM function to suppress the pages that I don't want the total to print on.  Do you know how to use that function?  
0
 
LVL 42

Expert Comment

by:frodoman
ID: 19981119
Wow - I was completely off base!  You said earlier "If I choose to print two invoices at once using a parameter." and I thought you were printing multiple copies of *each* invoice instead of multiple invoices...

I don't think you need PageNofM.  Try using TotalPageCount instead.

0
 

Author Comment

by:stephaniem712
ID: 19981243
How to I use TotalPageCount? I tried this formula -
ToText(PageNumber,0)<> trim( Right (PageNofM, Length(PageNofM)- (InStr(PageNofM,"f")+1))) to suppress on every page except say where PageNofM = Page 4 of 4.  What happens is I'm printing two invoices which is a total of 10 pages.  The first invoice is 4 pages long so I'd only want the total to print on page that is page 4 of 4.  Then the page numbers start over.  So, I'd want the total for the second invoice to print on page 6 of 6.  Possible?
0
 
LVL 42

Expert Comment

by:frodoman
ID: 19981306
If I understand your layout correctly all you need is:

PageNumber <> TotalPageCount

The special field totalpagecount resets when the page number resets so it should suppress page 1-3 of 4 and page 1-5 of 6.

frodoman
0
 

Author Comment

by:stephaniem712
ID: 19981346
I tried that and it only prints the total on page 10.  There has to be a way to do this..  I'm at a loss...  
0
 
LVL 35

Accepted Solution

by:
James0628 earned 2000 total points
ID: 19982007
Going back to the report structure you posted, I think you want to change the conditional New Page After on GF 2 to:

 Not OnLastRecord and {ARInvoice.InvoiceNo} = Next ({ARInvoice.InvoiceNo})


 I think that's right, but if it doesn't work, try <> instead of =.

 James
0
 

Author Comment

by:stephaniem712
ID: 19985093
James,

Thanks!  That worked!  I've been working on this what seems like forever.  I would have NEVER thought of that formula!  Can you tell me how to get rid of the blank page that appears at the end of the report.  I'm testing with printing two invoices and there is blank page at the end of the second invoice.  Thanks again!
0
 

Author Comment

by:stephaniem712
ID: 19991805
Fixed and done!  Thanks!
0
 
LVL 35

Expert Comment

by:James0628
ID: 19994059
You're welcome.  Glad I could help.

 James
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question