VB.Net 2005 doing my crust in!! - 12-01-2007 , 01:47 PM
I've recently moved over from VB6 to VB.Net 2005
Initial impressions are pretty good, but there's on bit that's driving me
In a VB6 app I've done, I created a Crystal report and give it a datasource
of an ADO recordet - Perfect!!
Trying to do the same in 2005 and I've wasted 2 days in this!!
It seems that I can't create a report, either crystal or the ms report
viewer, without a database connection!!
My current app creates the database as it runs for the first time, and it's
location is variable. I'm totally new to datasources - I've always worked
As I can't seem to attach a recordset to it, I though of populating a table
in the database and having the report read from there...
It would seem I can't create a report without defining a datasource and this
needs configuring into my database - which could be anywhere!
I've read vaugly about being able to use an object as a datasource, and
wondered if that might be a better solution, but being new to this, can't
find any details that I understand!
My object is created thus:
Public Class ReportSummary
Public m_DATE As String
Public m_ID As String
Public m_TRIPtime As String
Public m_DISTANCE As Double
Public m_MAXspeed As Double
Public m_AVspeed As Double
Public m_IDLE As Double
Public Sub New(ByVal sDATE As String, ByVal sID As String, ByVal
sTRIPtime As String, _
ByVal dDISTANCE As Double, ByVal dMAX As Double, ByVal dAV As
Double, ByVal dIDLE As Double)
m_DATE = sDATE
m_ID = sID
m_TRIPtime = sTRIPtime
m_DISTANCE = dDISTANCE
m_MAXspeed = dMAX
m_AVspeed = dAV
m_IDLE = dIDLE
Public ReadOnly Property ID() As String
Public ReadOnly Property EvDate() As Integer
Public ReadOnly Property TripTime() As Integer
Public ReadOnly Property Distance() As Integer
Public ReadOnly Property Max() As Integer
Public ReadOnly Property Av() As Integer
Public ReadOnly Property Idle() As Integer
Can I populate this object, or an array base therron, with multiple records
that I can then use to fill my report with?
Is there an easier way to acheive my objective of creating a recordset and
using it as a source for my report?
I've given up on crystal and am using the microsoft report viewer as its
going to be easier to deploy., and it's not a sophistaced report so there's
no point complicating matters!
Help and prozak appreciated...
Re: VB.Net 2005 doing my crust in!! - 12-07-2007 , 09:49 PM
In my experience with reports, it is best to use MS Reports over Crystal
Reports for the simple fact they are free to use. If you want robust
reporting then I would buy Crystal Reports, but for the most part, MS
Reports will do the job.
I have worked with reports using just datasets, but it can get harry at
For example, if you want to create a report that uses master/details data,
to diplay it, you will have to use a subreport, or you can create a new
dataset, create the table with the data you want displayed, and then bind
the report to the new dataset.
For your case, I assume, you are creating a database on the fly. Might I
suggest using a dataset, and saving the data through that since the location
is variable. Datasets are great for offline data, but they can get resource
greedy when you have a large amount of data.
I'll keep a watch on the message, and see if you have any questions.
Ryan S. Thiele
The Power is in your hands now!
Re: VB.Net 2005 doing my crust in!! - 02-14-2008 , 04:06 PM
You can use the dataset objects with crystal reports datasource in code,
have a look on the business objects website for code samples.
Mark Worsfold MCP
"Tym" <spamtrap (AT) ictis (DOT) net> wrote
|Thread Tools||Search this Thread|