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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preprinted Invoice Form 2

Status
Not open for further replies.

groasa

Technical User
Jun 14, 2001
39
0
0
US
Using Crystal 7.0

I have a report printing on a preprinted form that is grouped by transaction type (Sales and Credits). Right now my details section is holding all the item info for the invoice. Here's what I need to accomplish:

I want all the Sales to print at a fixed starting point on the page and go for 30 lines, print a total amount on the last page directly below the last Sales transaction, then I want the Credits to print at the bottom of the page at a fixed starting point and go for 10 lines, then print the credit total in a fixed spot and the net amount directly below that.

From reading past postings, I think that I can use

Remainder (RecordNumber, 30) = 0

for a conditional next page formula. I'm pretty sure that I can put the Sales total in the group footer and maybe do some conditional formatting there as well. I could also put the credit total and net amount in the page footer. But I have no idea about the rest.

I tried to add another group of Item Sequence and put the item info in that group with 2 sections. The first section suppressed if Credits and the other suppressed for Sales. The 2nd section also Printing at the Bottom of Page. I got the first section to print, but the Credit section prints only one record per page. And I'm not sure how to get the Credit section to start at a specific point and fit in that section.

Should I keep going in this direction or revamp and try something else?

Thanks,
glenda roasa
 
You are going in the right direction.

To get your sales items to start at a fixed position, use the ruler on the left margin and size the page and group headers to take up the space in inches and fractions of an inch above where your sales details should start. These sections must always be the same size and should print on every page. Check "Repeat Group Header on Each Page" in Change Group Options if you have group headers in this space. Be sure you have enough space after your 30 lines for the bottom of page stuff. Size your Credits Section (which prints at Bottom of Page) from the bottom up, using the ruler lines.

You will probably have to do a lot of trial and error to get everything positioned correctly.

If your pre-printed form is printed to a fixed line pitch (lines per inch) set your Grid Size to that value (e.g. for 6 lines per inch, set Grid Size to 0.167) and check Snap to Grid in File/Options. With these set, when you move or resize your field boxes or guide lines, they will jump to the nearest grid line.

You may have to put the Credits section into a subreport.
 
Is this a one page invoice? Are there always 30 lines of sales and 10 lines of credits?

If this is true then what I have found useful (works reliably but is tedious to implement though) is to do the sales and credit details as separate subreports that are suppressed in the Main report header (your report would be grouped by something like Transaction number

The sales subreport would collect all of the sales details and assign them to shared string arrays (I use string arrays to store the values since they are initialized to "Null")

for example in the Sales subreport

@initialization
WhilePrintingRecords;
shared stringvar array product := ["","",...30 of these];
shared stringvar array descript := ["","",...30 of these];
shared stringvar array sales := ["","",...30 of these];
shared stringVar SalesTotal := "";
numberVar TempTotal := 0;
numberVar Linecounter := 0;


now in the subreport detail section (with groups formed accordingly) place a formula like the following;

@SalesAccumulate
WhilePrintingRecords;
shared stringvar array product ;
shared stringvar array descript ;
shared stringvar array sales := ;
numberVar TempTotal ;
numberVar Linecounter ;

linecounter := Linecounter + 1;
product[Linecounter] := {table.product};
descript[Linecounter] := {table.description};
sales[Linecounter] := totext({table.sales},0);
TempTotal := TempTotal + {table.sales};

now in the subreport report footer

@SalesTotal
WhilePrintingRecords;
shared stringVar SalesTotal ;
numberVar TempTotal ;

SalesTotal := totext(TempTotal,0);

All sections of the subreport are suppressed so as to make it invisible in the main report.

Now here is the tedious part...

Now in the main report create a section in the group footer
for the Transaction Number that is positioned perfectly after the headings and is EXACTLY the size for the pre-printed form.

Now create 30 formulas for each array such as the following

@DisplayProduct1
WhilePrintingRecords;
shared stringvar array product ;

product[1];

Place these formulas for Product, Description and Sale exactly where you want them

Create a similar formula to display the Sales total and place it appropriately...

This is tedious mind numbing work...but once this is done...it will work perfectly every time...the formulas with no data just register a blank on the paper.

do the same thing for the credit section

Hope this helps Jim

JimBroadbent@Hotmail.com
 
Thanks guys! These were great suggestions.

I ended up using the page header to fix the length at the top of the page. All the Sales were in the details. Using the remainder formula in the conditional suppression worked beautifully for this section. The Credit section was a bit more of a pain. The only place I could make it work to print correctly was to put it in the page footer. The problem with this was that it prints the same thing on each page. I got it to only print on the last page, but this still doesn't resolve if there are more than 8 lines of detail. I tried putting it in the group footer, but it would not print on the same page as the sales. It printed on the page following the last Sales transaction, and depending on what I tried it would print at the top of the page.

Due to time constraints, I wasn't able to use Jim's suggestion. Luckily, the customer said that she didn't think that they would ever have more than 8 Credits. But I would still like to know how I can do this. Even though she says they don't need it now, one day they'll come back and ask for it!!

At least I have more time now, so I'll probably try Jim's way next. Any other ideas out there???
 
"The Credit section was a bit more of a pain. The only place I could make it work to print correctly was to put it in the page footer. The problem with this was that it prints the same thing on each page. "

You could always suppress the page footer til you wanted it printed

In the section expert in the conditional suppress

if it is a certain page number that you want it unsuppressed

not(pagenumber = 2) //for example

or if after a certain group value

{table.field} = value


something like that Jim

JimBroadbent@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top