Solved

Cheque using Crystal Report

Posted on 2007-04-11
15
458 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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 …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

690 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