?
Solved

Cheque using Crystal Report

Posted on 2007-04-11
15
Medium Priority
?
498 Views
Last Modified: 2012-08-14
I have created a program in Visual Studio 2005 where the end product is going to be a crystal report that prints an A4 Cheque where the cheque is perforated at the bottom of the page.
I have two tables in SQL Server 2005 where all the data is stored. A Header Table which contains the customer’s name addresses etc. Also a Line table which contains the details of the statement, e.g. Description, price etc.
Each customer is assigned an unique number in the Head table and all the corresponding records for that customer in the Line table have this unique number assigned to them.

My problem is that sometimes there is lets say 20 transactions on the statement for a customer and this then will need a second page which will take a second A4 sheet with a cheque on it.

How can I get the first page not to print anything on the cheque itself and just print it on the second page that it used?

I am in the process of doing it myself but would like some other views on how to complete it?

Thanks.
0
Comment
Question by:Eamon
  • 6
  • 6
  • 3
15 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 18888959
Without more info about how your report is structured it's difficult to say precisely.  As a general strategy though, I would create a subreport for the check itself and position this subreport in your page footer so that it prints on the cheque portion of your form.  Without any other changes this would print the cheque information on every page.

Since you don't want to print 2 cheques if you have two pages, you would place a shared variable on your report that gets set to 0/off/etc. in the group header and then gets set to 1/on/etc in the group footer.  The subreport that prints the cheques can produce different output based on this shared variable - if the variable is on then produce a cheque normally and if it isn't produce some static text such as "VOID - Not a Valid Cheque" to occupy the same space.

Hope this helps,

frodoman
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18889055
Sounds like a viable solution.  Agree more information may be needed.

mlmcc
0
 
LVL 1

Author Comment

by:Eamon
ID: 18889837
At present I have a group footer which contains the sellers name, address, seller Number. Im my details section I have all the details from my Line table which includes, LotNo, Description, Value Of lot. In my group footer I have the totals and the cheque amounts and Name which is printed on the cheque itself.

In the case where I have 20 lots and a second page is needed, maybe to somehow say, print page 1 on a blank page from tray 1 from the printer and then print page 2 from tray 2 where the cheque's are.

Would something like that be possible do you think?
0
Receive 1:1 tech help

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

 
LVL 42

Expert Comment

by:frodoman
ID: 18889896
No, to the best of my knowledge Crystal still hasn't added to ability to print pages from different printer trays, hence my suggested approach (after your description I still believe that's your best bet).

Another option would be to put the details in a subreport and limit them to 20 items (or whatever your max per page is) and simply not show any items beyond your max - effectively limiting each to a single page.
0
 
LVL 1

Author Comment

by:Eamon
ID: 18890045
I thought that alright.

Could you give me more info on shared variable?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18890150
0
 
LVL 42

Expert Comment

by:frodoman
ID: 18890203
The white paper should cover it.  In your case basically in the header you'll have a formula like this:

shared booleanVar PrintCheck := false;

Then in the group footer the same formula with a value of true.  I would create your subreport with some simple formulas  - for example for the payee something like this:

shared booleanVar PrintCheck;
if PrintCheck = true then
  {table.payee}
else
  '***VOID - Not a Valid Check ***'


frodoman
0
 
LVL 1

Author Comment

by:Eamon
ID: 18890474
Looking at that white paper now. One quick Q, How would I limit my Details section to just 10 records?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18890750
Use conditional suppression with a variable

Are you printing one check at a time or multiple?

mlmcc
0
 
LVL 1

Author Comment

by:Eamon
ID: 18890921
It will be multiple cheque's.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18891067
I assume this is a single report and there is no subreport.  I don't see that you mention subreprots.

Try this
In the report header add a formula
Name - DeclVars
WhilePrintingRecords;
Global NumberVar RecCount := 0;

In the group header
Name - ResetCount
WhilePrintingRecords;
Global NumberVar RecCount;
RecCount := 0;

In the detail section
Name - CountRecords
WhilePrintingRecords;
Global NumberVar RecCount;
RecCount := RecCount + 1;

Conditionally suppress the details section
Formula
Global NumberVar RecCount;
RecCount > 10

mlmcc


0
 
LVL 1

Author Comment

by:Eamon
ID: 18896356
Yes it is single report with multiple cheques. I entered all your formulas and it does what you suggest. Thing is one of my customers has 12 records to show on the details section. the above method doesnt show the last 2 records. I need to be able to see them. You were saying above about using a shared variable, Would that be the way to go to show the other 2 records.

Then on the first page and first cheque to set the payee name to "**VOID** or something to that affect.
0
 
LVL 1

Author Comment

by:Eamon
ID: 18897018
Would you know of any other 3rd party that I could use to select which tray a page should be takin from. One of the main aims of the project was too stop cheques being wasted.

Thanks.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1500 total points
ID: 18897504
Here is a link with several third-party viewers.  You might check Visual Cut.  It has the ability to burst reports which may provide the capability you need.
http://www.kenhamady.com/bookmarks.html

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18898861
Glad i could help

mlmcc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Suggested Courses
Course of the Month6 days, 8 hours left to enroll

593 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