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 ?
 
I haven't done the subreport for back image yet but I must have miss something on the subreport for check front... the report groups everything in one page instead of 3 in 1st page, blank on second page, etc. Is it possible to send me your sample report ?
 
I could send you the sample report using the Xtreme database if you provided your e-mail address, but then you might be subject to spam. At least try using "at" instead of "@". Or you could try to explain what you did to troubleshoot this. Did you add to the formula up to the maximum number of checks? Otherwise your first group will be all checks that did not fall into the categories, but the second and later instances of the group would show 3 checks.

You also need to format the group based on {@grp} in the main report to new page after, both for the group header and the group footer. Also make sure you created a subreport link that links {@grp} in the main report to {@grp} in the subreport.

Please note that if you are using a CR version lower than 9.0 this solution will only work with a relatively small number of records, since it depends upon accumulating a string which cannot exceed 254 characters.

-LB
 
I made up a simple database to test it. There are only 5 checks in DB. Each check only has check # and ABA #. The formula can go up to 4 pages. I guess the problem is on {@grp}. I created on {@grp} in main report. On the subreport, I just drag {@grp} from Field Explorer to subreport area. My report layout has a group header #1: @grp-A, then a Group Footer #1: @grp-A. Did you see any problem ?
 
You cannot drag the formula from the main report to the subreport. You have to create the same formula in the subreport. You can copy the formula from the main report and then in the subreport create the new formula name and paste the formula into it, so you don't have to recreate it from scratch. Then you must place the formula on the subreport canvas and then in the main report go to edit subreport link->and link the two fields.

-LB
 
Please bear with me - I am new to Crystal. I created another {@subgrp} in subreport. Then go to Edit -> subreport links. Select "Fields to link to" as {@grp} but the "Subreport parameter field to use" only has "?Pm-@grp" available. Once it's selected, I got 5-page report - page 1 & 3 have all 5 checks data while the rest are blank. Any idea ?
 
If {@subgrp} is the same formula as {@grp}, then in the linking screen, after moving {@grp} to the right as your main report field, in the bottom right of the screen, use the drop down to select {@subrpt}.

-LB
 
I got the front check to work ! Yeah ! Will be testing the back side later. But one question: there is not a limit of how many checks can be printed in one time. In this case, how can I adjust the formula ?
 
When you create the formula, you want to have as many groups as your total number of checks divided by 3. You can make the formula have more groups (they won't be populated), but not less--so you don't need to know the exact number. If there are less, you will have a large last group.

I tried using a formula that uses a loop instead of the hard coded group numbers in the {@grp} formula:

numbervar counter;
numbervar result;

for counter := 1 to 29 do (
if col in (3 * counter) - 2 to (3 * counter) then
result := counter;
result;

This still requires a hard value for the maximum number of groups (here 29), but when linking the subreport to the main report on this revised formula, the loop itself seemed to cause some geometric increase in the string accumulation which resulted in the "string is more than 254 characters" error. This error doesn't occur (at least for relatively small numbers of checks in 8.0 when I use the hard coded group range values. It probably wouldn't be a problem in 9.0. So, I think hard values must be used in this instance.

In order to simply generate a formula that might be very long, create a separate report in which you create a formula:

"if col in "+ totext(3*recordnumber-2,0,"")+" to "+totext(3*recordnumber,0,"") +" then "+totext(recordnumber,0,"")+" else"

Place this in the detail section. Then export the report to a word file. You can then copy the results and paste it into your formula, just adding the final number after the last "else". That makes using the hard numbers less onerous.

So your formula should look like:

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 //this line and the following ones can
//be generated in a separate report and plugged in here
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;

This doesn't solve the problem of the 254 character limit for strings, and I don't know whether this applies to CR.net. I'd be interested in knowing.

-LB
 
I replaced:

if col in 1 to 3 then 1 else //this line and the following ones can
//be generated in a separate report and plugged in here
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;

with

numbervar counter;
numbervar result;

for counter := 1 to 29 do (
if col in (3 * counter) - 2 to (3 * counter) then
result := counter;
result;
)

but it creates an error "boolean is required here". Any idea ? Except for that, everything seems to work great !

 
It should be:

numbervar counter;
numbervar result;

for counter := 1 to 29 do (
if col in (3 * counter) - 2 to (3 * counter) then
result := counter); //note the paren here, not after the last line
result;

Please note that I don't think this will work. I think you have to use the hard coding method.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top