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

Printing blank lines 1

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
A Sales Invoicing program can print the sales invoice from a report template, salinv.frx/frt. The body of the invoice - the detail lines - is generated from a cursor cdata which contains one record for each line.

Each line contains a description cdata.tdesc which is printed as part of the line. This is often taken from the product record at the time of data entry, but it may be free-format, keyed in by the user as he raises the invoice.

This description field can be printed in several different styles - bold, centered or even in a different colour. These styles are determined by another field, cdata.tformat (which the user provides on the data entry screen).

Within the report designer, the report layout contains several lines which specify how the line is to be formatted. Each line contains a field for cdata.tdesc and probably for other fields cdata.tqty, cdata.tvalue &c.

On such a line the properties for cdata.tdesc will specify the style – bold font, colour, alignment &c. and the field will also have its ‘Print when’ property set, perhaps specifying Print when cdata.tformat = “2”. Each field also has the option Remove line if Blank set to .T.

In general this works fine. But if the user has left a blank line as he enters the invoice, perhaps spacing out a long description on many lines, this blank line does not show on the invoice: the lines get closed up. And this is because all the Remove line if Blank settings have had their effect.

How can I set up the print format so that blank lines show on the printed report? At present I am entering a scarcely significant dot in the description, so the Remove line if Blank does not take effect, but this is not ideal.

Thanks. Andrew

 
 https://files.engineering.com/getfile.aspx?folder=0826f1d0-6862-4603-b228-38317d138760&file=salinv1.zip
Andrew,

Can you add another instance of cdata.tdesc to the report, which you overlay with the existing instances for bold, centred, etc. But in this new instance, set the foregound colour to white. Then, in the PrintWhen, test for the line being empty. So you will print the line (which won't actually appear) only if it is a blank line.

Not sure if this makes sense, but it might give you the general idea.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Just remove the check against all the Remove Line If Blank entries... then they all print, one on top of another I guess, and you get your blanks...

According to this:


Under Hacking the FRX, it is the NoRepeat field that corresponds to the Remove Line item in a field.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Thanks Mike. I will probable do as you suggest. I had thought of that, but am very mean in adding further lines to the report definition so was reluctant to do that. But I guess that will be effective.

and Griff. Thank you for your suggestion; but as I have defined the report template, the lines (for cdata.tformat = 1, 2, 3 &c) are defined each one below the one before, so I would get multiple (albeit mostly blank) lines on the printed invoice. that is why I have the 'Remove if blank' option set.

Andrew
 
I usually put them all on top of one another

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Andrew,

You may replace your dot with a non-break space, CHR(160), for the lines intended to be left blank.
 
A belated thank you to Antonio. I have appended the non-break space to empty descriptions, and that does the trick : the line is not regarded as blank, so the 'Remove line if blank' property does not take effect.

But again, thank you all. I appreciate, GriffMG, that your approach (of overlaying the differently formatted text boxes) would also work. It is just that it becomes rather difficult (in the report designer) to distinguish between the different variants of the text boxes which overlay each other).
 
Hi

I spread them out vertically at design (or edit) time, then align them all just before saving... I'm sure there are other ways of doing it.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top