Solved

More on Visual Basic Printing

Posted on 2006-07-19
4
366 Views
Last Modified: 2013-11-25
Hello,
I've been trying to improve the report printing in our application and have studied numerous answers on EE, other websites, books, MSDN code samples in the KB etc.  It is a huge hodge podge mess of partial answers and not clear at all on what approach to take.

Can any Printer experts out there tell me what is the best way to offer:

- user selection of printer, orientation, pages to and from, etc.  There are a lot of samples of how to set those in code but the examples on how to get them from the printer dialog are sketchy.  I tried many of them and none of them worked.  Is the ONLY way to get that info to use the Microsoft printer dialog control replacement instead of the common dialog????

- there is an MSDN article offering a new updated printer dialog com object to replace the common dialog typically used.  Has anyone used that?  Does it work well?  Even if you use that how do you handle the To and From pages when you don't know the pagination of a report?

- there is a qbdprinter2 code with a lot of API code... anyone used it?  

- I also need Print Preview... I realize I think I need to create a form and draw to that... but is there something better?

I've found some commercial products:
- Visual Reports 2.0 looks promising
- VB Gold's Smart Print Control
- qPrinter2

I just need everything and then some and I can't tell if I need to cobble several solutions together to get what I need or whether there is some end all be all print control that will do it all for me.

Your advice or help will be appreciated.

Regards,
-Tim
0
Comment
Question by:torrid333
  • 2
4 Comments
 
LVL 6

Expert Comment

by:Hit_MN
ID: 17154096

Hello,

I can help partially, because my experience is limited to qPrinter2.

1) user selection of printer...

As far as I know, the only way is to use the common dialog, and to set the related printer properties.

2) there is an MSDN article offering ...

Where? Are you sure that it is a com component, and not a .NET one?

3) there is a qbdprinter2 code with a lot of API code... anyone used it?  

I used it... and actually I'm *still* using this as my default print (preview) control. This is freeware (actually, it is donation - ware), and works fine (at least for my needs). Just an advice: if you are going to use it, then contact the author and ask him for the latest version he has... the one on the web site is older...

The only problem I found with this is that whatever you need, you have to write-it-your-own by code. It has some pre-defined methods to print (preview) standard controls like listview, grid, etc... but if you need a report you have to write yourself all the code needed to implement that.

4) I also need Print Preview.

qPrinter2 can do that...

Just my 2 cents...
HTH,
Marco
0
 

Author Comment

by:torrid333
ID: 17157186
Thanks Marco.  

The common dialog selection of properties does not work.  User can select prefernces and when it returns to code the properties aren't changed.  MS recommends using a print dll they offer as replacement plus a bunch 'o code....
KB article:  

http://support.microsoft.com/kb/322710/en-us

qbprinter2 does not help with selecting "number of  copies", "landscape/portrait", "color/black" etc.?
If not we would need to implement the MS printer dll AND qbdprinter.

How do you like the QBDPrinter as far as creating documents to save and reloiad and reprint?  We like that as a big improvement and flexibility for clients, but there's some sort of limitation... Can't recall what.  Are there any other limitation you can think of with QBDprinter2???

-Tim
,
0
 
LVL 6

Accepted Solution

by:
Hit_MN earned 500 total points
ID: 17165766
Hello, Tim

qPrinter has a default dialog when printing to select the pages that shall be printed and the number of copies to print. The landscape / portrait selection has to be done in the code before creating the document, and it is global for the whole document (i.e. you can't select it for any page, as far as I know).

I know that there is a feature in qPrinter to save and reload documents to show later, but to be sincere I never used it, so I can't tell you...
For other points, I suggest you to download it from

http://www.qbdsoftware.co.uk/moth/qprinter2/qPrinter2-latest.zip

and have a look to all its features. I think that the feature set is quite complete, as far as you don't need "complex" reports: I mean, if you need to print a table, an invoice, a letter, something like that it is ok. I used it once to create a complex report with subtotals, sections, and so on, and it was quite complicated (I had to write all the code by hand).
Another limitation that bears in my mind right now is this: the line style (for borders) is only "solid": no way to print dotted, slash, etc... lines.

Let me know if you need more help
Marco

HTH,
Marco
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question