is possible to create a Crystal Report instead a datareport1 with the recordset rsTest?
Naturally without external database -
-
Private Sub GetListViewData(lv As ListView)
-
Dim i As Integer
-
Set rsTest = New ADODB.Recordset
-
With rsTest.Fields
-
.Append "Field1", adBSTR
-
.Append "Field2", adBSTR
-
.Append "Field3", adBSTR
-
.Append "Field4", adBSTR
-
End With
-
rsTest.Open
-
For i = 1 To lv.ListItems.Count
-
With rsTest
-
.AddNew
-
.Fields("Field1") = lv.ListItems(i).Text
-
.Fields("Field2") = lv.ListItems(i).SubItems(1)
-
.Fields("Field3") = lv.ListItems(i).SubItems(2)
-
.Fields("Field4") = lv.ListItems(i).SubItems(3)
-
.Update
-
End With
-
Next i
-
-
Set DataReport1.DataSource = rsTest
-
With DataReport1.Sections("Section1")
-
.Controls("Text1").DataField = "Field1"
-
.Controls("Text2").DataField = "Field2"
-
.Controls("Text3").DataField = "Field3"
-
.Controls("Text4").DataField = "Field4"
-
End With
-
DataReport1.Refresh
-
DataReport1.Show 1
-
-
End Sub
-
Private Sub Command1_Click()
-
Call GetListViewData(ListView1)
-
End Sub
-
Private Sub Form_Load()
-
' Set listview
-
With ListView1
-
.View = lvwReport
-
.FullRowSelect = True
-
.ColumnHeaders.Add , , "Id", 1100
-
.ColumnHeaders.Add , , "First Name", 1400
-
.ColumnHeaders.Add , , "Last Name", 1400
-
.ColumnHeaders.Add , , "Email", 1700
-
End With
-
' Insert Data
-
With ListView1.ListItems
-
.Add , , "1"
-
.Item(1).SubItems(1) = "Andre"
-
.Item(1).SubItems(2) = "White"
-
.Item(1).SubItems(3) = "Andre@White.com"
-
-
.Add , , "2"
-
.Item(2).SubItems(1) = "Danny"
-
.Item(2).SubItems(2) = "Burnett"
-
.Item(2).SubItems(3) = "Danny@Burnett.com"
-
-
.Add , , "3"
-
.Item(3).SubItems(1) = "Edward"
-
.Item(3).SubItems(2) = "Carter"
-
.Item(3).SubItems(3) = "Edward@Carter.com"
-
-
.Add , , "4"
-
.Item(4).SubItems(1) = "Anne"
-
.Item(4).SubItems(2) = "Witter"
-
.Item(4).SubItems(3) = "Anne@Witter.com"
-
-
.Add , , "5"
-
.Item(5).SubItems(1) = "Vicky"
-
.Item(5).SubItems(2) = "Myron"
-
.Item(5).SubItems(3) = "Vicky@Myron.com"
-
End With
-
End Sub
-
-
1 2702 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Stephan |
last post by:
Hi,
I'm using Visual Studio 2003 (C#) with the integrated
Crystal Report software and have the following question:
How can I assign a value (string) to an unbound (string)
field in Crystal...
|
by: Phin |
last post by:
I need your HELP!
I've seen all the posts on using Crystal Reports within vs.net (vb.net)
and changing a SQL query at runtime. When I tried to pass in a dataset
into the crystal report at...
|
by: Mythran |
last post by:
In .Net, how can I go about and set a Crystal Reports namespace? Right now
they use the Root Namespace (VB) from the project. How can I extend the
namespace for a single report (which will be set...
|
by: Karun Karunakaran |
last post by:
Hi,
I am using the Crystal Enterprise .NET assemblies to generate and
display a crystal report in a webform. This report connects to an SQL
server (running locally) using a specific username and...
|
by: bthomas71chevy |
last post by:
I have just setup a WebServer and all the applications work fine, but
when every any of the applications try to generate a Crystal Report the
page errors out.
"File or assembly name...
|
by: Ray |
last post by:
Dear all,
I have some questions about the Crystal Report and vb.net 2003.
1. I have installed the crystal report 10 and vs.net 2003. Should I
update the crystal report within the vb.net so as to...
|
by: Jason Huang |
last post by:
Hi,
The Crystal Report bundled with .Net 2003 is version 9.
How do I update the Crystal Report V9 in my .Net 2003 to Version 11 so that
whenever I open a .rpt file in my VS 2003, the Crystal...
|
by: John Smith |
last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of
Crystal Reports. Sometimes the users will preview a report in a
Crystal report viewer, and sometimes they will send the...
|
by: =?Utf-8?B?cmtibmFpcg==?= |
last post by:
How can I stop receiving this message while calling a crystal report?
"The report you requested requires further information."
Thanks
|
by: apeg |
last post by:
Hi Guys. I have a problem in displaying the data in my report viewer which is crystal report based on the value of checkbox. When i select and check multiple item that i want to print, only one item...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |