|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
U can select the special recordset to print:Select the recordset which match the criteria,and print them.
|
|
#3
|
|||
|
|||
|
Where can i find the 'special recordset'? can you please show me a sample and where to put the codes
|
|
#4
|
|||
|
|||
|
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
|
|
#5
|
|||
|
|||
|
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
|
|
#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 |
|
#7
|
|||
|
|||
|
Hi,crackerweb!Before u applicated the filter,u had connection & open the database??Which data control do U use in your project??
|
|
#8
|
|||
|
|||
|
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?
|
|
#9
|
|||
|
|||
|
Hi cleverpig, i have another problem in printing a datareport. Is it possible to print only odd records or even records?
|
|
#10
|
|||
|
|||
|
If u have indication number with each record,u can select the recordsets by indication number...
|
|
#11
|
|||
|
|||
|
Unfortunately, I don't think I have any indication number, is there still a way?
|
|
#12
|
|||
|
|||
|
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...
|
|
#13
|
|||
|
|||
|
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
|
|
#14
|
|||
|
|||
|
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 |
|
#15
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > printing specific in datareport |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|