Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 2nd, 2003, 06:20 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
Thumbs up printing specific in datareport

Happy Halloween!

Is there a way for a datareport to print specific records only, let say I have a table and in that table contains different students, but i want to print only the students which are male or female or whatever that will match the criteria i need

Reply With Quote
  #2  
Old November 2nd, 2003, 09:46 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
U can select the special recordset to print:Select the recordset which match the criteria,and print them.

Reply With Quote
  #3  
Old November 3rd, 2003, 03:54 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
Where can i find the 'special recordset'? can you please show me a sample and where to put the codes

Reply With Quote
  #4  
Old November 3rd, 2003, 04:16 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
and do i have to change the properties of the command1 in the dataenvironment to SQL statement rather than stored procedure? i need it to execute the filtered print out at run time, please help

Reply With Quote
  #5  
Old November 3rd, 2003, 06:55 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
it's My mean that U can run a sql statement to filter what u need before print them out.And then print the filter recordsets...Can u tell me which kind of the database u used??If u use ms access,u will visit http://www.functionx.com/vbaccess/index.htm

Reply With Quote
  #6  
Old November 5th, 2003, 05:51 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
Private Sub Command1_Click()
Dim x As String
x = "Antonio Moreno"
deNwind.rsCustomers.Filter = "CompanyName='" & x & "'"
End Sub

Private Sub Command2_Click()
rptNwind.Show
End Sub

I tried to put the filtering into a command button in a form, but whenever the datareport shows up it shows no error and displays nothing on a blank data report, what should i do?

i tried to use first the Nwind database

Reply With Quote
  #7  
Old November 5th, 2003, 06:41 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Hi,crackerweb!Before u applicated the filter,u had connection & open the database??Which data control do U use in your project??

Reply With Quote
  #8  
Old November 6th, 2003, 04:00 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
oh ok, i haven't done any connection yet but thanks for telling me. I'm not using any data control, will it be more easier to use any kind of data control?

Reply With Quote
  #9  
Old November 11th, 2003, 05:50 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
Hi cleverpig, i have another problem in printing a datareport. Is it possible to print only odd records or even records?

Reply With Quote
  #10  
Old November 11th, 2003, 06:49 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
If u have indication number with each record,u can select the recordsets by indication number...

Reply With Quote
  #11  
Old November 12th, 2003, 04:53 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
Unfortunately, I don't think I have any indication number, is there still a way?

Reply With Quote
  #12  
Old November 13th, 2003, 06:33 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Ok,U can only add the record number counter manually when u query every record!..And judge the record number counter is odd or even...

Reply With Quote
  #13  
Old November 15th, 2003, 04:14 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
adding a record number do you mean adding another field? I thought of using For i=0 to table.recordcoun step 2, but i don't how will the datareport will show the records that has only been pass by the loop

Reply With Quote
  #14  
Old November 16th, 2003, 08:12 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
My meaning is that u can define a loop counter to record the loop number,and judge the counter is odd or even..
As it:
j=0
for i=0 to recordset.count-1
j=j+1
if (j mod 2)=0 then
'it's odd
else
'it's even
endif
loop

Reply With Quote
  #15  
Old November 23rd, 2003, 01:52 PM
crackerweb crackerweb is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 787 crackerweb User rank is Private First Class (20 - 50 Reputation Level)crackerweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 18 h 18 m 15 sec
Reputation Power: 6
I've actually thought of that the problem is, I always got stuck on what syntax to use to display needed records. I always got stuck on this code

for i=0 to recordset.count
j=j+1
if (j mod 2)=0 then

'it's odd
'dataenvironment.rstable.......what's next i don't know
else

'it's even
'dataenvironment.rstable.......what's next i don't know

endif
next i

I don't know how will it show the odd records it always show the last odd record, for example if i have 10 records, and i have already identified if it is odd, only the ninth record will show and not the first, the third, the fifth, and the seventh

pls help

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > printing specific in datareport


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump