HighTechTalks DotNet Forums  

VB.Net 2005 doing my crust in!!

VB.net Controls microsoft.public.dotnet.languages.vb.controls


Discuss VB.Net 2005 doing my crust in!! in the VB.net Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Tym
 
Posts: n/a

Default 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
insane!

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
with recordsets

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:

Imports System.text
Namespace Report
Namespace Objects
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
End Sub

Public ReadOnly Property ID() As String
Get
Return m_ID
End Get
End Property

Public ReadOnly Property EvDate() As Integer
Get
Return m_DATE
End Get
End Property
Public ReadOnly Property TripTime() As Integer
Get
Return m_TRIPtime
End Get
End Property
Public ReadOnly Property Distance() As Integer
Get
Return m_DISTANCE
End Get
End Property
Public ReadOnly Property Max() As Integer
Get
Return m_MAXspeed
End Get
End Property
Public ReadOnly Property Av() As Integer
Get
Return m_AVspeed
End Get
End Property
Public ReadOnly Property Idle() As Integer
Get
Return m_IDLE
End Get
End Property
End Class

End Namespace
End Namespace

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...


Tym.



Reply With Quote
  #2  
Old   
Ryan S. Thiele
 
Posts: n/a

Default Re: VB.Net 2005 doing my crust in!! - 12-07-2007 , 09:49 PM






Hi Tym,

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
times.

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
RT Enterprises
The Power is in your hands now!


Reply With Quote
  #3  
Old   
Walter Mark Worsfold
 
Posts: n/a

Default 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.

--
Regards

Mark Worsfold MCP
http://www.webspecdevit.co.uk
http://www.sharepricewebservice.co.uk
"Tym" <spamtrap (AT) ictis (DOT) net> wrote

Quote:
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
insane!

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 with recordsets

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:

Imports System.text
Namespace Report
Namespace Objects
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
End Sub

Public ReadOnly Property ID() As String
Get
Return m_ID
End Get
End Property

Public ReadOnly Property EvDate() As Integer
Get
Return m_DATE
End Get
End Property
Public ReadOnly Property TripTime() As Integer
Get
Return m_TRIPtime
End Get
End Property
Public ReadOnly Property Distance() As Integer
Get
Return m_DISTANCE
End Get
End Property
Public ReadOnly Property Max() As Integer
Get
Return m_MAXspeed
End Get
End Property
Public ReadOnly Property Av() As Integer
Get
Return m_AVspeed
End Get
End Property
Public ReadOnly Property Idle() As Integer
Get
Return m_IDLE
End Get
End Property
End Class

End Namespace
End Namespace

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...


Tym.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.