Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplex Print Check Images

Status
Not open for further replies.

HaveTrouble

Programmer
Jan 10, 2005
63
US
I need to print check's front/back images using duplex printer. One page can print up to 3 checks. I put check's front image in "Detail A" area and check's back image in "Detail B" area. In "Detail A", I put conditional formula under "Suppress":

remainder(pagenumber,2) = 0

In "Detail B", I have the following formula under "Suppress":

remainder(pagenumber,2) <> 0

But it didn't work. Can anyone advice ?
 
What do you mean by "can print up to 3 checks"? Are there 3 checks per page, or can a check vary in length somehow? Please explain.

MrBill
 
I need to print 3 checks per page, with front and back images.
 
I can't think of an easy way to do this, but I'd love to be proven wrong. The problem is that in order to get this right, the data would need to be returned in such a way that rows 1 - 3 would have the front side info, rows 4-6 would have the back side info, rows 7-9 front side, 10-12 back side, etc.

You might be able to accomplish this using a subreport as well. How many checks will print at once?

-dave
 
If I understand you correctly, the following might work.
Create 4 detail sections (a - d). In section a place your front image and check data. In sections b - d place a copy of your back side image (1 in each section). Each section should be expanded to the size of one check.

Create the following formula and place in detail section a:
// formula to count checks printed on a page.
whileprintingrecords;
numbervar Cnt;
If Cnt + 1 > 3 then
Cnt:= 1 else
Cnt:= Cnt + 1

In the format section windows do as follows:

In detail section a click X-2 next to New Page After and enter OnLastRecord.

In detail section b click on X-2 next to Suppress (no drill down) and enter {@Cnt} < 3 and not onlastrecord.

In detail section b click on X-2 next to New Page Before and enter {@Cnt} = 3 or OnLastRecord

In detail section c click on X-2 next to Suppress (no drill down and enter ({@Cnt} < 3 and not onlastrecord) or
(OnLastRecord and {@Cnt} = 1).

In detail section d click on X-2 next to Suppress (no drill down) and enter {@Cnt} < 3.

In detail section d click on X-2 next to New Page After and enter {@Cnt} = 3.

I think this will work for you.

MrBill


 
I am a newbie to Crystal. How can I create the following formula and place in detail section a ?

// formula to count checks printed on a page.
whileprintingrecords;
numbervar Cnt;
If Cnt + 1 > 3 then
Cnt:= 1 else
Cnt:= Cnt + 1
 
Please ignore my last email. I've figured out how to add the formula. It's working on the sample report in Crystal. Now I have to move it over to Crystal.NET to see if it works. MrBillSC, you are so wonderful !
 
Check data/images are coming from SQL database. I dragged the data field to section b-d but it only shows the image of the last check printed on the page, ie when printing check #1 to 3, the back of the page printed back image of check #3 3 times. Any idea ?
 
My misunderstanding. I thought the back image was standard for all checks. I did not realize that it was different for each check. I'm not sure this can be done. How is the report sorted and grouped?

MrBill
 
There is no specific sorting and grouping done yet. Basically it just pulls the data and images from SQL database and place it on the Crystal Report.
 
Dear HaveTrouble,

So you are stating that you need to print 3 checks per page. The front of the checks obviously differ, but why would the back of the check image differ.

How does the data differ for the back of the checks between the records?

I think we are confused because usually the backs of checks don't have data specific to the front of a check?

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
I guess my next thought would be to find some way to create a group for every three records. This would require some common data or a something like sequential numbers (check numbers?) in the data that you could use to create a formula for grouping. Are the check numbers in the data?

MrBill
 
The back of the check will have endorsement which make each images different.

Yes, check number is part of the data but it might not be sequential because checks from multiple payers could be in the same batch for printing.
 
If the database is SQL Server, and you can write stored procedures, I might be able to come up with a SQL-based solution using the theory I described in my first post.

Let me know.

-dave
 
You could try the following. First sort your records (report->sort records) by whatever field you are using to distinguish the checks (let's say it is {table.acctID} (this is critical). Then create a formula {@grp}:

numbervar col;
stringvar x;

if instr(x,totext({table.acctID},"000")) = 0 then
(x := x + totext({table.acctID},"000")+", "; //add as many zeros
//as the maximum length of the acctID.
col := col + 1);
if col in 1 to 3 then 1 else
if col in 4 to 6 then 2 else
if col in 7 to 9 then 3 else
if col in 10 to 12 then 4; //etc.

Insert a group on {@grp}. Then insert a subreport which contains your check fields in the detail section. Again sort the records by {table.acctID} (this is critical) or insert a group on {table.acctID}, if you wish. Create the same formula {@grp} as above in the subreport also. Place{@grp} in the details section of the subreport. Suppress those sections of the subreport that you do not want displayed.

Link the subreport to the main report by {@grp} in the main report and {@grp in the subreport. Place the subreport in the group header. Then go to the section expert, and format both the group {@grp} header and the group footer to "New Page After". You should now have three subreport groups on page 1, followed by a blank page 2, three subreport groups on page 3, a blank page 4, etc.

Create a second subreport for the check backs, adding the fields you want displayed, again sorting by {table.acctID}, and again add the {@grp} formula to the details section and link it to the main report on that formula. Place this subreport in the group footer.

-LB
 
what's the use of the following codes ?

if instr(x,totext({table.acctID},"000")) = 0 then
(x := x + totext({table.acctID},"000")+", "; //add as many zeros
//as the maximum length of the acctID.
col := col + 1);

If ordering is based on more than 1 fields, what would the formula looks like ?
 
Please note that the entire formula is:

numbervar col;
stringvar x;

if instr(x,totext({table.acctID},"000")) = 0 then
(x := x + totext({table.acctID},"000")+", "; //add as many zeros
//as the maximum length of the acctID.
col := col + 1);
if col in 1 to 3 then 1 else
if col in 4 to 6 then 2 else
if col in 7 to 9 then 3 else
if col in 10 to 12 then 4; //etc.

This formula when used in both main and subreports (with correct sort orders) will group your checks into sets of threes. If you have other groups besides on check number and other sort fields, please provide the detail. I'm not sure how that would affect this solution--I'd have to test it out.

-LB
 
I got an error when using this formula - too many arguments have been given to this function - and looks like it's on "totext".

The sort field I have is ABA # and check #.
 
The error is because {table.acctID} is already a string (you didn't specify datatypes, and I assumed it was a number), so change the formula to the following. I am also changing the field name {table.acctID} to {table.chkno}, since that is what the corresponding field should be:

numbervar col;
stringvar x;

if instr(x,{table.chkno}) = 0 then
(x := x + {table.chkno})+", ";
col := col + 1);
if col in 1 to 3 then 1 else
if col in 4 to 6 then 2 else
if col in 7 to 9 then 3 else
if col in 10 to 12 then 4; //etc. You have to add to this to the
//maximum number of checks.

If you have a higher order sort field, then in the main report->sort records you should have {@grp}, {table.ABA#}, {table.chkno}. In the subreports, sort by {table.ABA#} and {table.chkno}.

This works when I test it here.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top