Help Creating different mailing labels on a page using vb.net tia Sal

S

sal

Greets, all

I'm trying to create different multiple mailing type labels on a page
reading from an untyped dataset anyone have any ideas on how I can get
this done without crystal reports a plan text file would be fine.

My untyped dataset looks like this (comma denotes next cell in untyped
dataset)
Name,Address,Age

I would like to get the output text file to look like this with each
name,address,phone being different

Name Name Name
Address Address Address
Age Age Age


Example of untyped dataset:
John,23 noway, 12
Sally,12 yesway, 34
Suzzy, 43 okway, 21


Example of Output I would like to get in text file:

John Sally Suzzy
23 noway 12 yesway 43 okway
12 34 21

tia
PS I'm using vb.net
Sal
 
C

Cor Ligthert

Sal

I thought I had made this sample already often however I could not find it
on Google. It is just rotating the datatable

Here a sample I made again this morning in my opinion exactly to your
problem description.

\\\Needs only a project with a datagrid on a form
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet
Dim dt1 As New DataTable("Original")
ds.Tables.Add(dt1)
dt1.Columns.Add("Name")
dt1.Columns.Add("Adress")
dt1.Columns.Add("Age")
For i As Integer = 0 To 2
dt1.Rows.Add(dt1.NewRow)
Next
dt1.Rows(0).ItemArray = New Object() {"John", "23 noway", 12}
dt1.Rows(1).ItemArray = New Object() {"Sally", "12 yesway", 34}
dt1.Rows(2).ItemArray = New Object() {"Suzzy", "43 okway", 21}
Dim dt2 As New DataTable("Reflection")
ds.Tables.Add(dt2)
For i As Integer = 0 To ds.Tables("Original").Rows.Count - 1
dt2.Columns.Add(i.ToString)
Next
For i As Integer = 0 To ds.Tables("Original").Rows.Count - 1
Dim dr As DataRow = ds.Tables("Reflection").NewRow
For y As Integer = 0 To ds.Tables("Original").Columns.Count - 1
dr(y) = ds.Tables("Original").Rows(y).Item(i)
Next
ds.Tables("Reflection").Rows.Add(dr)
Next
DataGrid1.DataSource = ds.Tables("Reflection")
End Sub
///

I hope this helps a little bit?

Cor
 
S

sal

Sal

I thought I had made this sample already often however I could not
find it on Google. It is just rotating the datatable

Here a sample I made again this morning in my opinion exactly to your
problem description.

\\\Needs only a project with a datagrid on a form
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet
Dim dt1 As New DataTable("Original")
ds.Tables.Add(dt1)
dt1.Columns.Add("Name")
dt1.Columns.Add("Adress")
dt1.Columns.Add("Age")
For i As Integer = 0 To 2
dt1.Rows.Add(dt1.NewRow)
Next
dt1.Rows(0).ItemArray = New Object() {"John", "23 noway", 12}
dt1.Rows(1).ItemArray = New Object() {"Sally", "12 yesway",
34} dt1.Rows(2).ItemArray = New Object() {"Suzzy", "43 okway",
21} Dim dt2 As New DataTable("Reflection")
ds.Tables.Add(dt2)
For i As Integer = 0 To ds.Tables("Original").Rows.Count - 1
dt2.Columns.Add(i.ToString)
Next
For i As Integer = 0 To ds.Tables("Original").Rows.Count - 1
Dim dr As DataRow = ds.Tables("Reflection").NewRow
For y As Integer = 0 To
ds.Tables("Original").Columns.Count - 1
dr(y) = ds.Tables("Original").Rows(y).Item(i)
Next
ds.Tables("Reflection").Rows.Add(dr)
Next
DataGrid1.DataSource = ds.Tables("Reflection")
End Sub
///

I hope this helps a little bit?

Cor

Thanks it works perfectly!!!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top