Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 5th, 2004, 05:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default Printing Report

I have not written a VB program that needs a report generated. So far the programs I have written in VB are to update/add records. Please let me know if there is a book about reading a database then generating a report. If someone could guide me or has an example program I could look at so I will be familiar on how to code or go about this project.

Thanks,
Judy
 
Old February 5th, 2004, 06:15 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How are you planning on printing the report? Crystal Reports? Access? A different third party tool? Generating your own?
 
Old February 6th, 2004, 01:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

I was planning on generating my own. I heard that I could pass it off into a Word Document but I will start with just the basic if this will be simpler. I am planning to do incorporate Crystal Report later on as soon as I know the basic report generation code.

Thanks,
Judy
 
Old February 16th, 2004, 10:38 AM
Authorized User
 
Join Date: Aug 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do not think that there is such a thing like "basic report generation code".
I feel that it is more like emptying your database and giving a meaningfull structure to the data gathered from the database.

I usually generate the reports directly to word using VBA but basically it is just looping throug recordsets or datasets and structuring the information so the user knows what it means and presenting it in a readable and printable medium. (Could be a RichTextBox, word, excel ,...)
 
Old February 16th, 2004, 10:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

How do you it through VBA? Is it totally different from VB? Is there a book I can read to do this?


I usually generate the reports directly to word using VBA but basically it is just looping throug recordsets or datasets and structuring the information so the user knows what it means and presenting it in a readable and printable medium. (Could be a RichTextBox, word, excel ,...)
 
Old February 19th, 2004, 07:23 AM
Authorized User
 
Join Date: Aug 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

VBA is not that different from Visual Basic. I just use it in a Visual basic project.

Basically is VBA a set objects and commands by which you can manipulate word or excel or different appliations.

For example:

First Select the Reference 'Microsoft Word 10.0 Object Library' (are the version you have)

Then in you visual basic project you can do the following

Dim woApp as Word.application
Dim woDoc as word.document
Dim woFont as word.font
Dim woSel as word.Selection

Set woApp = CreateObject("Word.Application")
woApp.Visible = true

set woDoc = woApp.Documents.Add("")

set woSel = woApp.Selection
set woFont = woSel.Font

'now you can use the woSel object to type text and the woFont object to format the font.

woFont.Bold = 1
woFont.Size = 14
woSel.typeText "Some text here"
woFont.Reset

'You can mix this VBA code with normal Visual Basic Code.
'So you can use recordsets and loops

Do until rsDb.EOF

  woSel.TypeText rsDb.Fields("SomeField") & vbCrLf

  rsDb.movenext

loop




I hope this gives you a strart.

There are books that you can buy but when you search google for +vba +word you will be able to find some examples.

Greetz

Tom
 
Old February 20th, 2004, 01:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

Thanks for the suggestion Tom. This will give me a place to start.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing a Report gregalb Reporting Services 0 July 23rd, 2007 05:14 PM
Printing report Vince_421 Access VBA 0 May 2nd, 2007 05:39 AM
Printing Report rfarmer VB How-To 1 September 27th, 2006 06:39 AM
printing report Tasha Access VBA 0 August 25th, 2004 08:22 PM
Error While printing report (Crystal report) vikaspaweb Pro VB 6 0 March 8th, 2004 09:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.