473,466 Members | 1,406 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem in Displaying Multiple Selected Item from listview to Crystal report Viewer

1 New Member
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 is in my report viewer. Can anyone help me on my problem?

This is my code and sample picture.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Dim i               As Integer
  3. Dim s               As String
  4.  
  5. Screen.MousePointer = vbHourglass
  6.  
  7. Set rpt = crx.OpenReport(App.Path & "\Report\IDMaker.rpt")
  8. Set db = rpt.Database
  9. Set sect = rpt.Sections("DetailSection1")
  10.  
  11. For i = 1 To Glass.lvwStudent.ListItems.Count
  12.  
  13.     If Glass.lvwStudent.ListItems(i).Checked = True Then
  14.         s = Glass.lvwStudent.ListItems(i).Text
  15.             strSQL = "SELECT * FROM Student where stud_num = " & s
  16.             dbcmd.CommandText = strSQL
  17.  
  18.             Set dbrst = dbcmd.Execute
  19.             rpt.Database.SetDataSource dbrst, 3
  20.  
  21.  
  22.     Screen.MousePointer = vbDefault
  23.     End If
  24.  
  25. Next i
  26.  
  27.     CRViewer91.ReportSource = rpt
  28.     CRViewer91.ViewReport
  29.     CRViewer91.Zoom 1
  30.  
  31. End Sub
  32.  
  33.  





Thanks in advance.
I hope someone can help me.
Oct 29 '10 #1
0 1496

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ashish Shridharan | last post by:
Hi All, I'm not very sure if this is the forum for my question but i was hoping someone could direct me to the right place (or answer my question). I am using the .NET crystal report viewer...
7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
0
by: louise raisbeck | last post by:
Hi, The first part of this code def works as i have an export function which saves my crystal report, as a pdf, to disk. However they want to be able to view them before deciding to save them. I...
1
by: Harshil | last post by:
Hi All, I am working on Vb.net application with oracle as my database. I have developed reports using crystal report 9. Usually when you open reports directly in crystal report viewer control it...
2
by: zdrakec | last post by:
Hello all: I have the Crystal Report viewer imbedded on a .NET form, and it works very well... except, on the target machine, when I set the ReportSource property of the viewer (to a...
0
by: mano.bharath | last post by:
I am developing a windows application in VB.NET 2005 that includes a number of crystal reports. To use the reports I use the included crystal report viewer and pass a dataset to the report at...
0
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...
0
by: SwamyKarthik | last post by:
I am trying to build an app that reads crystal reports. I was able to load the Crystal report viewer as a ActiveX plugin however I'm having problems. Here's my code: Public Class Form1 ...
1
by: CAM | last post by:
Hello, I am using Vista Basic.Net 2008 and I wondering what is the best way to display crystal reports in a form. I have about 10 different crystal reports what I am currently doing is using a...
0
by: mohanty2050 | last post by:
I am using Crystal Report 9 and VB6.0. I can display the report through Crystal report viewer properly. But the print button in the Crystal report viewer does not work. My printer is in network. If I...
1
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...
0
marktang
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,...
0
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...
1
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.