reports in VB 6.0
hi,
i have got an Access database named 'db1' and the table is named 'table1'. It contains the fields ''staff, project and hoursworked''. I'm using VB 6.0. How can i generate reports so that i know which staff has worked on which projects for how many hours? what are the code or what are the steps to follow? Should i create an interface to enter the name of the staff? Where should i put the code?Where should i enter the name of the staff so that, the system i'm developing generate the report for that particular staff? How do i generate the reports?
Need your help urgently.
thanks.
[665 byte] By [
deena2209] at [2007-11-11 9:58:55]

# 1 Re: reports in VB 6.0
There is a sample project that comes with VB6 as part of the MSDN Help system. This project uses the Northwind sample database and creates a datareport in VB. The sample project on my system ended up in this location:
C:\Program Files\Microsoft Visual Studio\MSDN\2001OCT\1033\SAMPLES\VB98\DataRept
Yours may vary depending on your install of VB6 but basically find the MSDN folder and the folder for the MSDN version on your system will have the samples. My version as per the location above, was the Oct 2001 release of the MSDN help files. If the Samples are not there you may need to go back to your VB6 install disks and make sure to add the samples.
# 2 Re: reports in VB 6.0
FYI: To create a Data report in VB6 requires using A DataEnviornment to base the report on and then adding a data report where you design the layout. It is very similar; but no way near as powerful as Access's own Report Designer. Another way to build a report is to use a third party product like Crystal Reports. Other wise you would have to use the Printer Object, which works like a PictureBox control where you would have to calculate the locations of each piece of text that you want to print, including figureing out when to page break, drawing the next page etc.
If you know HTML you could write a routine that dumps the records in HTML format and create a nice report that way.
Also check here for code samples: http://www.freevbcode.com/
# 3 Re: reports in VB 6.0
hi,
i have got an Access database named 'db1' and the table is named 'table1'. It contains the fields ''staff, project and hoursworked''. I'm using VB 6.0. How can i generate reports so that i know which staff has worked on which projects for how many hours?
You may pass to the database a SQL command to do that like :
db.open "SELECT * FROM tabel1 WHERE project=your_specified_project"
and then customize your output for report .
what are the code or what are the steps to follow?
my previous method is by adding reference to such a version of ado for example and connect to it .
Should i create an interface to enter the name of the staff?
You need only to get from the user the project name [or the inverse you get the stuff to display projects]
Where should i put the code?Where should i enter the name of the staff so that, the system i'm developing generate the report for that particular staff? How do i generate the reports?
Need your help urgently.
thanks.
Put this code in such a command button which get the variable staff from a textbox for example , regarding to look in the samples in Access itself to know more about reports and how to creat marcos to execute them from your project and get those reports [all time your report formula must be created in access] .
Amahdy at 2007-11-11 17:25:31 >
