Click to See Complete Forum and Search --> : creating reports
kgambit
Aug 20th, 2005, 01:22 PM
I really need some help please, My vb6 program works great for my boss, but he wants it to print reports, there are not numerical figures involved, most if not all text. How do I make an app as simple as this show a report capable of printing. (I have Crystal Report 8.5) Thanks.- kgambit
Private Sub cmdPrint_Click()
'this is supposed to show the report.
End Sub
Private Sub cmdSave_Click()
'add a new entry the table.
With Data2.Recordset
.AddNew
!CompliedBy = txtComplied
!CaseNumber = DataCombo1.Text
!Date = txtDate
!OtherOfficers = txtOther
!Subject = txtSubject
!details = txtDetail
!ReportNumber = txtReportNumber
.Update
End With
Data2.Refresh
End Sub
RobDog888
Aug 20th, 2005, 04:42 PM
Welcome to the Forums.
You can use your ADO rs set as the DataSource for your report if the recordset is what you want/need to display. I have an example in my signature. ;)
kgambit
Aug 21st, 2005, 07:09 PM
Thanks for the welcome and information, but could you epound some more on how to do it.
RobDog888
Aug 21st, 2005, 08:47 PM
Ok, but where is your data going to come from? Data2, database, textfile, controls on your vb form, etc.
kgambit
Aug 22nd, 2005, 05:34 PM
The data is comming from controls on the form and i want to be able to pull up data and print from the database too, but if i can pull the info from the form then I'll be okm with the rest
RobDog888
Aug 22nd, 2005, 05:44 PM
If you have a database and the info on the form is also from the db then its best to pull it from the db using ADO. Then we can set the DataSourceof the report to the recordset and be done, so to speak. ;)
kgambit
Aug 24th, 2005, 12:28 PM
Is there anywhere I can find a simple example of this or is it small enough you can explain please, because my program is working great, only waiting for the reports, either data report or crystal report 8.5, anyone will work great for me, because as I said its mostly text, no fomulas.
ieesab
Aug 28th, 2005, 12:24 PM
If you have simple text to report in vb then you can use the word automation and it is very easy to generate text reports in MS Word. I am also working on this path although beginner, but getting much. If you are interested, i can present my little help
RobDog888
Aug 28th, 2005, 09:59 PM
Use CR's IDE to create a report as you would like to view it as. Then you can use the CR Viewer control in VB to open the report and populate its DataSource. The CR Viewer has buttons that can automatically print or export to a number of formats. ;)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.