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!

Not suppressing blank lines 4

Status
Not open for further replies.

SitesMasstec

Technical User
Sep 26, 2010
470
1
18
BR
Hello colleagues!

I have created a report which has 20 detail rows:

TelaItens_i01r7y.jpg


When processing the report I want to remove lines which have no data in each field, so I set the Properties, Print When tab, for each field to:
1) Print field only when data>0
2) Remove blank line
PrintWhen_doinkd.jpg


But when I process the report, the blank lines are NOT suppressed!

Am I missing anything?


Thank you,
SitesMasstec
 
Perhaps you don't have the fields set to float, maybe they are set to relative to the top of the band?

** edit **
From your screenshot, on the general tab, in object position.

If a line in the middle was blank, the next line would stay where it was if not set to float
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.

There is no place like G28 X0 Y0 Z0
 
Hi,

Not Only LcO10 has to be blank but also ALL the other objects on that line

From the help file

When a field in a report band is blank or the field in the underlying table is empty, Visual FoxPro checks the report band for other report controls. If no other controls exist in the report band, Visual FoxPro removes the entire line. ...

hth

MarK

 
You haven't created a report, but rather a list of 20 sets of variables. A report will at design time only show details from one record.
 
I think Tore has the reason. If your detail band looks like this, the whole band is "one line". And if only some of the fields are not blank, then the whole area gets printed and nothing is removed or collapsed.

The other reason is, that 0 is empty, but not blank. Blank really means nothing to print in a whole line of the report. I think even if this is all one detail band it would suppress empty lines, too. But as MarK said, only if the whole line is blank. If I look closely at the first elements of each line, then I see the start of the lines vary by a bit, if the report elements all swim a bit from an exact grid position, you don't define lines very well. One element having its top over the bottom of the elements in the previous line would cause that above line to be printed, etc.

Anyway, it screams for redesign with just one line of all elements and a record per line instead of one detail band that covers multiple lines filled in with data of one record. You should really think about a data AND report design where 1 record means 1 line of the report.



Chriss
 
Tore:

Yes, it is a report, because each record has indeed 20 lines, or 6 fields each record (120 fields each record).


Griff and Chriss:

I set all field to Float now, but with fields in same position on the report .


Chriss:

You said
"The other reason is, that 0 is empty, but not blank. Blank really means nothing to print in a whole line of the report."

So I have to try this now. But as 3 fields in each line are Numeric, read from records in a file, how to transform 0 to blank?


Thank you,
SitesMasstec
 
Hi,


0 (zero) in a numeric field is considered as EMPTY - please have a look et the help file.

When a field in a report band is blank or the field in the underlying table is [highlight #73D216]empty[/highlight]...

Code:
x = 0
?empty(x)

x = 0.00
?empty(x)

hth

Mark
 
What are you quoting MArk.

We talk about the "remove line if blank feature:

help said:
Remove line if blank
Specifies that the report engine may contract the report band vertically if the evaluation of the report control results in [highlight #FCE94F]no renderable content[/highlight], and no other renderable controls occupy the empty space on either side of the control.
A 0 is renderable content, it's the character "0" and it's not blank.

This is really about having no dot, no tiny tidbit of ink or toner to print in a line. And not about VFPs concepts of EMPTY() or BLANK().

There are options to let a numeric field display nothing, if it is 0:
blankifzero_jfm01j.jpg


The question is, if you want that in case there is other data and text in the line and you want 0 to print as 0 in that case. There is no magic setting that does that. The best option then will be to have a character field that you set to transform(numericfield) and then decide whether a 0 should be turned into space or not. All in a report prepass of the data yyou want to report.

Your major issue still is that you use a record that has fields for multiple lines, though, you should redesign the report table to only have one record per line. Otherwise all other efforts don't play out anyway.

Chriss
 
SitesMasstec,

Suggestion - Try this:

Uncheck [Remove line if blank]

[Print only when expression is true]
NOT ISBLANK(Ico10)

Steve
 
The thing is, even if everything on the No. 5 line is blank, the number 6 line will still print in the same place unless they
and the ones below them are all floating, not fixed relative to the top of the band.

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.

There is no place like G28 X0 Y0 Z0
 
Griff, that might be true, but only plays a role because the design is so broken to have report field in multiple lines that are all fed by one record of the report driving workarea.

Only have one line in the detail band, and the float setting won't matter. For each record the band will not print, if it is blank. That's how to best make use of this.

Chriss
 
Maybe Chris

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.

There is no place like G28 X0 Y0 Z0
 

Dear colleagues:

All fields (and labels) in Detail section are now set to Float.
Yes, each record has data for up to 20 lines. And I can have up to 10 records in the temporary table (TEMPEXPL.DBF).

Steve: NOT ISBLANK(Ico10) shows error.

Chris: I set Format, 'Blank if zero' for Numeric fields, but it hasn't worked, also.


Thank you,
SitesMasstec
 
SitesMasstec said:
Yes, each record has data for up to 20 lines. And I can have up to 10 records in the temporary table (TEMPEXPL.DBF).
Well, thanks for that information, but it's not "yes", that's the no go of your report, that makes it not work in respect of "remove line if blank.

What you need is a data structure that has one record for one row of the report.


Chriss
 
Instead of running the report from a table, run it from a cursor. You can do whatever you want with this cursor, in your case you must make sure that there's one record per line in the report. IOW the cursor will not correspond directly to your table, instead it will correspond to your report. This will make the report much easier to create, and you will solve your problem easily.
 
My table TEMPEXPL.DBF can have up to 10 records. It is about Production Order, that means ONE Production Order can request to Production Food kitchen (bakery, restaurant, etc) 10 recipes. Let's say a Chocolate Cake is one of the requested recipes.

The Chocolate Cake recipe is recorded in just one record.
In that record it has up to 20 itens used to produce the Chocolate Cake:
1. Flour
2. Chocolate powder
3. Sugar
etc

So, each record in the TEMPEXPL.DBF store up to 20 items about a particular food Production Order (example Chocolate Cake).

Please see the application:
This is one example of Production Order (up to 10 recipes):
ProductionOrder_akefds.jpg


And this is one recipe (Chocolate Cake), with "exploded" ingredients:
ChocolateCakeRecipe_vc8a47.jpg


Tore: a cursor? I have never used this, I will try to use it in the application, thanks.


Thank you,
SitesMasstec
 
Hi,

All the records of one row have to be blank. "Remove line if blank" has to be checked for all fields in a row and "Blank if 0" has also to be checked for numeric fields.

I uploaded the code with the report in the zipfile Sites.7z. You may download it and run the code, first without any changes and then emptying the values of street, areacode and town of one or more records to see its behavior.

Enjoy

MarK
 
 https://files.engineering.com/getfile.aspx?folder=fc60fc54-75cb-4160-bc61-54ff64b05c96&file=Sites.7z

Mark said:
All the records of one row have to be blank. "Remove line if blank" has to be checked for all fields in a row and "Blank if 0" has also to be checked for numeric fields.

Yes, Mark, I did this for all labels and fields of the Detail section of the report.

Note that, as I showed in the example above, just ONE record in the TEMPEXPL.DBF is made of 20 rows.

Maybe, as Chris said above
What you need is a data structure that has one record for one row of the report.



Thank you,
SitesMasstec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top