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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C#: How to create report using a data table

Status
Not open for further replies.

salooo

Programmer
Sep 11, 2003
30
US
i,
I am using VS.NET 2003 and using the C# language to deploy crystal reports for .NET. I want to create a report using a dataset by deploying the push model, also I want to know how I can create this report using a data table ??

I want to know how to implement the use of a "data table" that I can create off of several tables and use that for my report. What I mean is that in my memory I can create a table what MS calls "data Table" right ? That's what I want to use to build my report.

any help would be greatly appreciated.

Chow.

__________________
Salmaan

When there is a bridge...There is a way
 
Hi again,

I think I have not explained my question right. Let me give you an example of what I am looking for. Here is a VB example of similar process to update a ListView item. But I am using C# so please give me examples in C#.

*******************
Dim dr As DataRow
cn = New SqlConnection("Server = Saloo\VsDotNET;database=Test_DB;trusted_connection = yes")
ds = New DataSet
ds.Tables.Add("TaskTable")
da = New SqlDataAdapter

'your sql statement
sql ="................................."

cmd = New SqlCommand(sql, cn)

da.SelectCommand = cmd
cn.Open()
ds.Clear()
Try
da.Fill(ds, "TaskTable")
Catch eFill As SqlException
MessageBox.Show(eFill.Message, "Data Fill Error")
cn.Close()
Exit Sub
End Try
'Read the records from the virtual recordset "TaskTable"
For Each dr In ds.Tables("TaskTable").Rows
'dr(0) is the first column and dr(1) is second column...
Dim Str2 As String() = {dr(0), dr(1), dr(2), dr(3), dr(4), dr(5)}
ListView1.Items.Add(New ListViewItem(Str2))
Next
da.Dispose()
cn.Close()
ds.Clear()
**********************************
Now my question is how can I use a similar way to buil my report????
What would be the steps I need to take to construct my report off of a data table like the one used in the example?

Anticipating help soon :)
__________________
Salmaan

When there is a bridge...There is a way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top