Any suggestions on generic report solution?

S

staeri

I'm trying to build an easy and generic report solution in my ASP.NET
2.0 application and I need suggestions how to do this.

I have a print button on my form which opens the generic print page
"Print.aspx?report=account". The report parameter tells which page
called the print page.

In the CodeFile "Print.aspx.vb" I have right now the following code
which needs to be generic:

Dim myDataSet As DataSet = New DataSet()
Dim myConnection As New SqlConnection("bla bla bla")
Dim mySqlDataAdapter As New SqlDataAdapter("SELECT * FROM
vwReport_account", myConnection)

mySqlDataAdapter.Fill(myDataSet, "ReportRows")
Dim myDataRow As DataRow

For Each myDataRow In myDataSet.Tables("ReportRows").Rows
Dim row As WorksheetRow = sheet.Table.Rows.Add

cell = row.Cells.Add
cell.Data.Text = myDataRow("Account").ToString()

cell = row.Cells.Add
cell.Data.Text = myDataRow("AccountDescription").ToString()

cell = row.Cells.Add
cell.Data.Text = myDataRow("Budget").ToString()
cell.StyleID = "s30"
cell.Data.Type = DataType.Number
Next

Can someone please help me with advice how to replace the code above
with a generic solution so that I don't have to separate code files for
each report?

Regards,

S
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top