Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Labels in Data Base
Labels in Data Base
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
nadhunt
Agent


Joined: Oct 16, 2008
Posts: 17

PostPosted: Tue Feb 24, 2009 6:02 am    Post subject: Labels in Data Base

HI
we use the database to print labels, but have a problem, each label has the information automatically inserted from the database, each label also has additional data such as 'title' etc. this data is entered once and automatically repeated in all label spaces - but if we only want to print one label , we get just the one label with the info from the d Base, but the additional text gets printed on all the other labels on a sheet, wasting a sheet of labels - any idea how to stop this ?
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Tue Feb 24, 2009 7:16 am    Post subject:

I've run into this, too, although sometimes it doesn't happen. I haven't figured out what makes for the difference.

Can you tell me the steps you are using to create the labels?

If you know ahead of time how many labels you will have, you could try deleting the contents (i.e. the field names) of the "extra" labels before printing.

Lorinda
Back to top
nadhunt
Agent


Joined: Oct 16, 2008
Posts: 17

PostPosted: Wed Feb 25, 2009 8:05 am    Post subject:

I dont think I can delete the 'empty' labels - problem is anything you add to the first label (top left) gets repeated on all the labels on the page, regardless of if there is any data on those labels, so on a page of say 10 labels, if I only select 2 entries to print, I will get the Data Base info for those 2 entries printed on the first 2 labels - BUT if (as we need to) I enter headings or additional text on the label - this additional text is always repeated on all labels, so I get the first two labels with the data in, then the next 8 labels with just the additional text.
So is there a way to add additional text/headings to labels, that only gets printed on labels with data in them ?
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Feb 25, 2009 8:56 am    Post subject:

One possible way, although I have not had time to try this, is to create a new "view" object in your database. A view is a saved query and you could create a view that shows only the rows in the database table that meet some condition. In your case, that condition would be where the name and address fields are not empty.

If you are able to create a view, the next step is to delete the placeholder fields in your label template document and readd new fields that point to your new database view instead of the database table.

Does that make sense?

Patrick
Back to top
yakusha
Operator


Joined: Oct 03, 2008
Posts: 43
Location: Gent BE

PostPosted: Wed Feb 25, 2009 11:18 am    Post subject:

hi,

Make perfect sense to me.
so following up on Patrick's idea.
You make the query Patrick mentioned and enter as criteria the SQL terms
Code:
IS NOT NULL
this should give you a query output without the empty fields.
This will give you a query that works on the condition that the field(s) are not empty.

greetz,

_________________
"The mountain doesn't mind which way you climb it"
Back to top
nadhunt
Agent


Joined: Oct 16, 2008
Posts: 17

PostPosted: Thu Feb 26, 2009 2:34 am    Post subject:

no its not the info from the database that causes the problem.
I have a SQL set up, and it only prints the entries I ask for - the problem is that as well as the information from the database, I also need additional information on the labels.
eg. I have a field in the database that prints a deadline date - but on the label just having a date can cause problems, so I need to put a heading "Deadline" next to where the database date entry will print.
so on the label creation page, I type the text "deadline" next to where the date field will be entered.
This works, BUT now every label on the page, regardless of if there is any info from the DBase, has the text "Deadline" printed on it, wasting a sheet of labels.
I need a way of entering additional text to labels, text that is not coming from the database but is common to each label, but that only prints on labels where there is information from the dbase - does that make sense ?
Dan
Back to top
Markk
Operator


Joined: Mar 15, 2007
Posts: 43
Location: Wisconsin US

PostPosted: Thu Feb 26, 2009 7:20 am    Post subject:

nadhunt wrote:

eg. I have a field in the database that prints a deadline date - but on the label just having a date can cause problems, so I need to put a heading "Deadline" next to where the database date entry will print.
so on the label creation page, I type the text "deadline" next to where the date field will be entered.
This works, BUT now every label on the page, regardless of if there is any info from the DBase, has the text "Deadline" printed on it, wasting a sheet of labels.
I need a way of entering additional text to labels, text that is not coming from the database but is common to each label, but that only prints on labels where there is information from the dbase - does that make sense ?
Dan


That is where a view would work - you would create a new "Label_Print" view that simply consisted of the fields you want from your current data table, (put the column names and appropriate table in when you create the view) and then for the constant columns just put the value you want, say, 'Deadline' in the FIELD row of the define view and whatever you want to call it as a column title in the ALIAS row. Include the the single quotes. So you might put - 'Deadline' - in the field row and - DEADLINE - in the alias. You would have already added all the columns from your data table.

Now use this view as your data source and just select the data you want, including the constants. This technique is used a lot in big databases. If fact often the constants themselves are actually kept in a table and views set up. Then you can just change the value in one place and all reports using are changed.

I can help more if this isn't enough.
HTH
Mark
Back to top
nadhunt
Agent


Joined: Oct 16, 2008
Posts: 17

PostPosted: Thu Feb 26, 2009 9:10 am    Post subject:

thanks, got it now... & all working
Dan
Back to top
Markk
Operator


Joined: Mar 15, 2007
Posts: 43
Location: Wisconsin US

PostPosted: Thu Feb 26, 2009 11:27 am    Post subject: Can do right in query also!

Forgot to mention you can just do this right in the query also and skip the view. The way I described is fine and as I said it is easier to find later.
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.