How to print labels like label 1 of 1 and label 2 of 3....

I have a report that will be a label and I need to print N number of labels depending on a certain number returned from the query. Let's say that number returned is 3. So, on my first label I want to print 1 of 1 and on the second label, 2 of 3 and the third, 3 of 3. All other information on the label will be the same for all 3 labels. All information used is from the query. One of the fields accessed through the query holds the number I need to use to do this.

Is there a way to do that through the report designer using vs.net? Is there a setting for this or is it a SQL thing I need to put in the query some how. Or am I completely off track?

Any help would be greatly apprciated.

thanks

[773 byte] By [TheresaKad] at [2007-12-23]
# 1

Owkey this is a long shot ... but maybe it's just what you need:
From my point of view; you are printing a label per page (I hope this is what you are doing)

so

I found something about page numbering reports here: http://blogs.msdn.com/bwelcker/archive/2005/05/19/420046.aspx

So, then when you have the max numbers of labels (Like in your example 3) and you can retrieve the number of each page (3 pages for 3 labels, thats: page1, page2, page3), it won't be so hard to combine them and create:
label 1(first page) of 3(# labels retrieved from dataset)
label2 of 3
label3 of 3

I hope this is what you mean? Otherwise explain that label'ing thing a bit more?

Grts

hypo at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 2

It's very hard to explain, thanks for having patience with me.

I understand how to print out on the label what I want it to say. The problem is generating 3 labels from one record when usually you have one record for every page or multiple records in a table format.

I have one record(row of data) that I need to have print out on 3 labels. Each label will have the same data on it. And on each label I need to have number of totalcount that need to be printed, so that when I print them I get the amount of labels I need for each record and they are properly marked.

thanks

TheresaKad at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 3

Sorry but I really don't understand what you are trying to do;
you have one row of data returned by the query, and that contains a number (the number of labels) and other information that will be the same on every label (this I get)

But what do you mean by label?
I don't know if the report is of great importance to you but if it is ... can you make some drawings or a sample of what info you have and the result you want from it?

Maybe that can make your problem more clear and it will be easier to help!

Greets

hypo at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 4

I'm under the impression that Theresa has one row that needs printed more than once (different labels) and one of the columns has a number that signifies how many labels for the row needs printed. What Theresa needs, I believe, is to be able to loop through the row y number of times as specified by the row. The label should show a x of y information. I'm taking a look at what I can see, but if someone else has already conquered this one, feel free to post.

Thanks, I hope I'm right in my assumptions and this helps clarify the issue.

CurtisZeiszler at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 5

If that is the case, you could always write your own custom code or even use a custom assembly in the report which will look at the data on each row and perform something with it. Maybe you'll find it easier to resolve your problem using .net code like vb.net or c#

here's an article on custom code and custom assemblies in reports: http://www.yukonxml.com/chapters/apress/reportingservices/dotnet/

hypo at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 6

Thank you Curtis and Hypo. Curtis explained perfectly. I can create the code to loop but what is the command to make it generate more than one label for each record. The report designer sees it as generating 1 label(report) I need some command or function that tells it to print(generate) a specified amount.

record that is returned from query
firstName, lastName, number

theresa, kad, 3

labels to be printed
theresa kad 1 of 3
theresa kad 2 of 3
theresa kad 3 of 3

TheresaKad at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 7
Please, anyone have any ideas on this subject?
TheresaKad at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 8

If you know the number of labels you need to generate for each record (for example, given X of Y, you know Y), you can create Y detail rows in your table and use expressions like this:

Detail row 1: =Fields!Name.Value & " 1 of 3"

Detail row 2: =Fields!Name.Value & " 2 of 3"

Detail row 3: =Fields!Name.Value & " 3 of 3"

-Chris

ChrisBaldwin-MSFT at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 9

I don't have a table layout in RS. I am using a freeform layout.

For example:


IL009ADGP1 X of Y
1/1/2005
Joe Smith / 124

I know the value of Y. Let's say Y is equal to 2 then I need to print out this label twice with the same informaton on except for the X of Y.

So I don't have a table to put that code in. Is there some way in SQL to generate Y number of records from 1 record. Then RS would have Y number of records and I could just print the amount of labels I needed depending on records returned.


TheresaKad at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 10

Simplest way to me seems to be to chage the SQL by adding a join to a table that contais the sequence.

select T.*, A.seq
from table T
inner join (select 1 as seq union select 2 union select 3) as A
on A.seq > 0
order by T.id, A.seq

This sql will join your table T with a table A created only to contain the numbers 1, 2 and 3.

It will order the result set by your table T's id field and then by A.seq.

It will return each original line three fold in the result set with a "seq" field which can be printed on the label.

It is straightforward to change it for more complex queries, change the ordering, etc.

CesarGil at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...

SQL Server

Site Classified