Solved

Cheque using Crystal Report

Posted on 2007-04-11
15
440 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 100

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

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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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 100

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 100

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 100

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 100

Expert Comment

by:mlmcc
ID: 18898861
Glad i could help

mlmcc
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now