473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Best way to output results?

I am interested to know of other peoples 'best ways' to print calculation
results to the screen and printer, using VB6. My usual out put is a single
page up to four pages mostly text and figures and only sometimes with a
drawn graphic.

A single form seems inadequate because it is shorter in length that an A4
sheet of paper, and I would like to produce something like WYSIWYG.

Until recently I have been using MSdataReportDesigner, but this needs to be
linked to a database, whether you use one or not which I don't, and graphics
are not supported.

I am thinking should I be looking at a MDIform approach, or is there another
better way?
Regards

Martin

Jul 17 '05 #1
8 4994
Martin wrote:
I am interested to know of other peoples 'best ways' to print calculation
results to the screen and printer, using VB6. My usual out put is a single
page up to four pages mostly text and figures and only sometimes with a
drawn graphic.


Have you tried formatted output to a multiline text box or rich text
box? It's easy, and (I can't test this right now, I'm on a linux box) I
believe there's a print method on both controls.

' Untested untested untested
' but *something* like:
txtBox.SelLength = Len(txtBox.Text)
txtBox.SelText = "Add this line to the text box" & vbCrLf
....
txtBox.Print

If this is what you're looking for, let me know and I'll post Genuinely
Working Code (R).

Nick.
Jul 17 '05 #2
On Tue, 27 Jul 2004 15:47:23 +0000 (UTC), "Martin"
<ca****@btconnect.com> wrote:
I am interested to know of other peoples 'best ways' to print calculation
results to the screen and printer, using VB6. My usual out put is a single
page up to four pages mostly text and figures and only sometimes with a
drawn graphic.


Obj.Print

Where Obj is either a Picturebox or the Printer

Best wrapped in a Class, and ultimately probably internally using APIs
instead of the native VB commands
Jul 17 '05 #3

"J French" <er*****@nowhere.com> wrote in message
news:41***************@news.btclick.com...
On Tue, 27 Jul 2004 15:47:23 +0000 (UTC), "Martin"
<ca****@btconnect.com> wrote:
I am interested to know of other peoples 'best ways' to print calculation
results to the screen and printer, using VB6. My usual out put is a singlepage up to four pages mostly text and figures and only sometimes with a
drawn graphic.


Obj.Print

Where Obj is either a Picturebox or the Printer

Best wrapped in a Class, and ultimately probably internally using APIs
instead of the native VB commands


Understood so far (I think). But my problem is at design time trying to
produce a complete A4 height sheet. I can make a picture box on a form any
height I wish but the form itself is limited to a height 11520twips at
design time, I need about 19000-20000twips. No problem at run time but I can
not lay the page out full height at design time.

As I say I have been using MSreportDesigner to date, and in trying for a
better alternative I hit the above snag. I have used two child forms one
below the other to give one solution, a little contrive?. This is why I am
wondering if there is a best way?

Martin
Jul 17 '05 #4
On Wed, 28 Jul 2004 10:43:18 +0000 (UTC), "Martin"
<ca****@btconnect.com> wrote:

<snip>
Understood so far (I think). But my problem is at design time trying to
produce a complete A4 height sheet. I can make a picture box on a form any
height I wish but the form itself is limited to a height 11520twips at
design time, I need about 19000-20000twips. No problem at run time but I can
not lay the page out full height at design time.

As I say I have been using MSreportDesigner to date, and in trying for a
better alternative I hit the above snag. I have used two child forms one
below the other to give one solution, a little contrive?. This is why I am
wondering if there is a best way?


Not entirely contrived, but a bit of .. overkill

Try just having a Picturebox that you size up to .. whatever
- stick some scroll bars around it, or within it, and mess around
scrolling it up and down as a viewport

Then try using Picture1.Print and Picture1.PaintPicture

Just do it in 'Hullo World' style and you will soon catch on

Giving your users print preview is quite flashy and saves a lot of
paper for both you and them

98% of what you can send to a Printer can also go to a Picturebox
Jul 17 '05 #5
"Martin" <ca****@btconnect.com> wrote in message news:<ce**********@sparta.btinternet.com>...
<cut>
Understood so far (I think). But my problem is at design time trying to
produce a complete A4 height sheet. I can make a picture box on a form any
height I wish but the form itself is limited to a height 11520twips at
design time, I need about 19000-20000twips. No problem at run time but I can
not lay the page out full height at design time.


http://groups.google.com/groups?q=vb...ie=UTF-8&hl=en
Jul 17 '05 #6
I just use the printer object
Printer.print ...
printer.FontSize = 12 (etc)
you can position the cursor anywhere - then print

"Martin" <ca****@btconnect.com> wrote in message
news:ce**********@sparta.btinternet.com...
I am interested to know of other peoples 'best ways' to print calculation
results to the screen and printer, using VB6. My usual out put is a single
page up to four pages mostly text and figures and only sometimes with a
drawn graphic.

A single form seems inadequate because it is shorter in length that an A4
sheet of paper, and I would like to produce something like WYSIWYG.

Until recently I have been using MSdataReportDesigner, but this needs to be linked to a database, whether you use one or not which I don't, and graphics are not supported.

I am thinking should I be looking at a MDIform approach, or is there another better way?
Regards

Martin

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.721 / Virus Database: 477 - Release Date: 7/16/2004
Jul 17 '05 #7

"J French" <er*****@nowhere.com> wrote in message
news:41****************@news.btclick.com...
On Wed, 28 Jul 2004 10:43:18 +0000 (UTC), "Martin"
<ca****@btconnect.com> wrote:

<snip>
Understood so far (I think). But my problem is at design time trying to
produce a complete A4 height sheet. I can make a picture box on a form anyheight I wish but the form itself is limited to a height 11520twips at
design time, I need about 19000-20000twips. No problem at run time but I cannot lay the page out full height at design time.

As I say I have been using MSreportDesigner to date, and in trying for a
better alternative I hit the above snag. I have used two child forms one
below the other to give one solution, a little contrive?. This is why I amwondering if there is a best way?


Not entirely contrived, but a bit of .. overkill

Try just having a Picturebox that you size up to .. whatever
- stick some scroll bars around it, or within it, and mess around
scrolling it up and down as a viewport

Then try using Picture1.Print and Picture1.PaintPicture

Just do it in 'Hullo World' style and you will soon catch on

Giving your users print preview is quite flashy and saves a lot of
paper for both you and them

98% of what you can send to a Printer can also go to a Picturebox

__________________________________________________ ____

Many thanks, I've learnt a little more.

I have tried all of these methods so far, but what I did miss was although I
can not make a form of any length at design time (Oh why not?) I can make a
picture box of any length.

There seems little to choose between the MDIform (with two child forms per
page) and a single form with picture box and scrollbars.

The standard form with picture box has visually poor scrollbars and to use
the full height of the picturebox at design time one has to drag the box up
and down. But the programming is simple.

The MDIform does involve two forms per page (say top half and bottom half)
but these forms do have a grid available at design time which helps layout
of labels etc. And the MDI comes with nice scrollbars (automatically). True
that a little more programming is required to position the two page halves
but not too much.

Any more ideas or have we exhausted them?!!

Regards

Martin
Jul 17 '05 #8
On Thu, 29 Jul 2004 15:35:43 +0000 (UTC), "Martin"
<ca****@btconnect.com> wrote:

<snip>

98% of what you can send to a Printer can also go to a Picturebox_________________________________________________ _____

Many thanks, I've learnt a little more.

I have tried all of these methods so far, but what I did miss was although I
can not make a form of any length at design time (Oh why not?) I can make a
picture box of any length.


True ... but you might want to limit things to printing one page at a
time in a PicBox
There seems little to choose between the MDIform (with two child forms per
page) and a single form with picture box and scrollbars.
I would never agree there
The standard form with picture box has visually poor scrollbars and to use
the full height of the picturebox at design time one has to drag the box up
and down. But the programming is simple.
You can make them look Ok
The MDIform does involve two forms per page (say top half and bottom half)
but these forms do have a grid available at design time which helps layout
of labels etc. And the MDI comes with nice scrollbars (automatically). True
that a little more programming is required to position the two page halves
but not too much.
Forget MDI unless you are printing a complex document and need some
sort of 'window list'
Any more ideas or have we exhausted them?!!


Well ... for simple reports I print the whole lot to a file and then
kick off a totally separate EXE to View/Print them.

Actually the Windows print spooler does pretty much that
Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Karthikesh Raju | last post by:
Hi All, i am wondering about the best way to read in a configuration file that goes like: ########### source_dir = '/home/karthik/Projects/python' data_dir =...
6
by: Robin Siebler | last post by:
I have two directory trees that I want to compare and I'm trying to figure out what the best way of doing this would be. I am using walk to get a list of all of the files in each directory. I...
15
by: John J | last post by:
I've written the following code into a class to search for and display the results of all races entered (The complete code is in a previous thread). I wish to amend the code so as to display the...
4
by: Janaka | last post by:
Hi this is kind of an ASP.NET/ADO.NET question. I've got a stored procedure on SQL Server that returns a results set. It also sets 3 output parameters in a seperate Select statement. When...
2
by: continium | last post by:
I have been learning python during the past weeks and I have been able to program some interesting things. Python is my first and only programing language from which I wish to enter the programing...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
6
by: kamsmartx | last post by:
I'm new to programming and need some help figuring out an algorithm. I need to design some kind of algorithm which will help us define capacity for one of our portfolios....here's the problem...
11
by: ankitmathur | last post by:
Hi, I'm trying to overcome a situation whereby I have to search through 4-5 columns and produce the results with an order by according to the values matched in these columns. Example: My...
10
by: Tammy | last post by:
Hello all, I am wondering what is the best way to declare a struct to be used in other c and c++ files. Such as for a C API that will be used by others. 1. Declaring the typedef and the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.