Value Headers Shown Only With Value S’abonner

0
Avatar
Legacy Poster

Hi,

For our labels we take the format of having certain fields of our items, followed by the actual values, an example would be:

Item code: 12345
Commercial name: "name"
Quality: "value"
Type:
Size:
Etc.

Now in order to link these values more directly to our system, we have linked these values to an Excel document. However, not all our products have all of these values, some for instance do not have a quality definition. Is it possible to have a query or function that would allow for the Field names such as Quality, or Type, to only be displayed if there is an actual value in the field? Or if the value is for instance greater than 0?

Kind regards,

Jack

7 commentaires

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Sure.

First you have to name the data sources (or sub-string if in version 9.4-). Then just make the source of the field names to be a Multi-Line VB script, and use code like follows:

[code]if Number = "" then
Value = ""
else
Value = "Field Header"
End If
[/code]

This code assumes I have named my data "Number", but it doesn't matter what you name it
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Thank you that is very useful!

The thing is, some of the fields are text, not necessarily a numerical value, it is possible to have the if/then/else statement rewritten such that there is an output if there is a value (any value) in the field, and if not there is no output?
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

[quote name='Jack022' timestamp='1333118459' post='2107']
The thing is, some of the fields are text, not necessarily a numerical value, it is possible to have the if/then/else statement rewritten such that there is an output if there is a value (any value) in the field, and if not there is no output?
[/quote]

Jack: like I said, I just happened to name my field "Number". It doesn't really matter in my code if there is actually a numerical value in it or not.

If you needed to account for more possibilities, you can add an elseif to the code as well. I take advantage of the [i]IsNumeric()[/i] function a lot for applications. It would look like:

[code]If IsNumeric(Number) then
Value = "The entered field is numeric"
ElseIf Number = "" then
Value = ""
Else
Value = "Field Header"
end if


[/code]
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I do realize that you simply named your field "Number" and it doesn't necessarily matter if it is a numerical value or not, but Im looking for the possibility of outputting the value in the respective field, unless there is no value at all. Let me illustrate with an example:

Suppose I have a list of values in Column E of my Excel file, which is linked to the word "Quality" in my Bartender sheet, meaning the sheet would look as follows:

Item Code: 123ABC
Quality: Field:$Sheet1.Quality

I have linked things properly such that the output in the 'Quality' field is shown with different Item codes, yet is it possible if there is no value in the Excel field for 'Quality', for the actual word "Quality:" to disappear as well, hence that entire line would only exist if there is an actual value in the Excel file linked to the Item code?

Please note that we have many different values in this column, hence I would not simply be able to list different preconditions, I simply want the value to be copied straight into the bartender sheet, but only if there is an actual value available.

Thank you for all the help, it's greatly appreciated!
0
Avatar
Shotaro Ito
Modérateur
Actions pour les commentaires Permalien

Try suppress transform of data source (in 9.4 or older, More options > General > Visibility)

Prepare a paragraph(multiline) text. Create some data sources for Field label, database field and newline.
In multiline text, you can use <<CR>><<LF>> for newline - which can be entererd from [Ω] button at right of screen data.

Null data in database field won't be appeared in the text.
For field labels, you can suppress that when next datasource is empty.
For newlines, suppress when previous datasource is empty.

For suppress field data when value is "0", in Transform (More options)VB Script, modify that to empty.
<OnProcessData>
[code]If Value="0" Then Value = ""[/code]

Hope that helps!


[attachment=192:Visibility.png]
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Thank you Shotaro,

I did manage to suppress data when there is no value available by linking the headers to their respective data source.
However, now when Data is suppressed I get empty lines in my text, is there any way that I can prevent this by getting the rest of the text to fill up the empty space?

For example:

Code: 12345C
Name: Calculators
Colour: Black
Number: 5 p/package

Suppose on certain items the Colour page is empty, this then leaves me with the following:

Code: 12345C
Name: Calculators

Number: 5 p/package

With an empty space in between name and number, is there a way I would be able to get number (and any possible text below that) to fill up the space, so that I can still have my stickers in one organized form of text?
0
Avatar
Shotaro Ito
Modérateur
Actions pour les commentaires Permalien

If you don't suppress newline substring [<<CR>><<LF>>], it would show one empty line.

Vous devez vous connecter pour laisser un commentaire.