Helpful Information
 
 
Category: Visual Basic Programming
Printing Report VB

Can anyone recommend a way to generating and printing reports with Visual Basic. The report content is mainly data from ADO recordsets. Currently I'm writing HTML code formatted into tables and using FONT tags to chage the font but it seems a long winded way of doing things.

I have heard of Crystal Reports but i'm looking for something a little less expensive.

Any help would be appreciated.

Crystal reports and other database reporting tools like it are the only automated way to do this.
You mention writing html code. Are you doing this in visual basic or asp?

I'm writing it in Visual Basic. HTML I found was the easiest way to get nicer fonts, text formatting (center justified, italics/bold/underline etc). After I generate the report (I write a .html file) I open it in the default browser on the machine and the user can use IE's or Netscapes print routines to get a hard copy. It works well but it's a pain having to write the HTML code for each report.

You can always make a hidden form with no border and no background color. Then create the text or label controls dynamically according to your content and then you have vb's formatting controls to use. But this approach can be as difficult as doing html.

Yeah I was looking for something that can give me headers and footers as well. Not to worry ! If you hear of anything keep me in mind. Thanks again for your quick reply.

If you want to use html then why not use excel. Through vba you can open the html and convert it to .xls files.

We have a lot of Crystal reports and we are trying to phase them out. The only thing that Crystal handles well are level-break reports, other than that it is crap software.

you can use MS Word - most users has it and it's easy to manipulate through automation (check it's objects in the object browser).
Just create your report on the fly with the ADO data.










privacy (GDPR)