473,513 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HLP: Printing an Array

I've a 3D array --> myArray(14, 20)

This array contains both Text and Numbers.

What I'd like to do is to have a "Simple" output to Print.

Nothing fancy on Text and stuff (the default of FixedSys font I will use is
plenty).

But I want to line up my information in 'fixed' Columns. And the numbers range
from 0 to 60 (and can contain decimals to 2 places).

Any feed back appreciated.

Regards,

Bruce
Jul 21 '05 #1
4 1110
Hi Bruce,

There was a question about formatting only yesterday. This is what I gave:

There are loads of ways of formatting things

The ToString method of numbers and strings takes formatting parameters which
you can read about here.

Formatting in .NET
http://msdn.microsoft.com/library/en...ttingtypes.asp
There's also the good old VB Format function which is described here:

Format Function
http://msdn.microsoft.com/library/en...afctFormat.asp

And then there are quite a few functions for playing with strings.
For instance you could use
sSomething.PadLeft (10, " "c) 'Right-aligned in a 10-width column

Regards,
Fergus

--
==================================================
Thought for the day

Herfried: I don't need/want human interaction.

==================================================
(There's a feud going on)
Jul 21 '05 #2
Hi Bruce,

Ok, that was some pointers for the formatting. Let's look at this array.

You say 3D but there are only two indices in your array which makes
it 2D. This is much easier to display, of course, but you may have left out
the third index.

What you need to show us is an example of how you'd like the printout
to look. Give us some array values and the corresponding output.

Regards,
Fergus

--
(Please ignore this - there's a feud going on)
==================================================
Thought for the day

Herfried: I don't need/want human interaction.
==================================================
Jul 21 '05 #3
With Deft Fingers, "Fergus Cooney" <fi****@post.com> wrote:
You say 3D but there are only two indices in your array which makes
it 2D. This is much easier to display, of course, but you may have left out
Duh! Sorry... I meant 2D (banging head on wall). Sheesh! (:
What you need to show us is an example of how you'd like the printout
to look. Give us some array values and the corresponding output.


Hmmm.... The basic format will be:

String1 String2 String3 String4 Numer1 Number2 ... etc. to Number 7
String5 (whole line)

In reality it is the output of a Weekly Time sheet:
Project Number + Project Name + Cost Code # + Code Code Description + Sat Hrs
+ Sun Hrs + Mon Hrs ... to Fri Hrs

Then String5 is Description of Work.

I did find an example of a ListView being displayed (5 columns). Then a print
preview which they created a 'Table' (3 columns) and populated it with
selected columns out of the original 5 columns.

Pretty slick. I'll have to see if I can figure it out cause it seems to word
wrap in each cell in the print preview. A bit more 'fancier' than I was going
for. But I'll probably tackle this after I just get the output in a plain
Jane flavour.

Thanks (as usual)

Bruce
Jul 21 '05 #4
With Deft Fingers, "Fergus Cooney" <fi****@post.com> wrote:
There was a question about formatting only yesterday. This is what I gave:
Hmm... didn't see that one.
The ToString method of numbers and strings takes formatting parameters which
you can read about here.
Yeah... I use to do something like that in VB6. The only big thing I've run
across is since each 'character' is not the physically same 'width', it's just
a lot of screwing around to get the formatting just right. IE: a 'P' is not
the same width as a '-'. So you get 150 "P" on a line... and 240 "-". Argh!

And when you are dealing with strings having different lengths!

I think it was back in some older VB there use to be a way you could setup a
format of a line mixing strings and number. Kinda like:

LineFormatLike = "/ / '###.##' / / / /"

.... where you could place text between the / / (and they would control
the number of characters depending on how many 'spaces'). ### dealt with
numbers.
Formatting in .NET
http://msdn.microsoft.com/library/en...ttingtypes.asp
http://msdn.microsoft.com/library/en...afctFormat.asp
I'll look them up.
And then there are quite a few functions for playing with strings.
For instance you could use
sSomething.PadLeft (10, " "c) 'Right-aligned in a 10-width column
Hmmm... didn't know the " "c option. Kewl!

Thanks (as ususal) I:
================================================= =
Thought for the day


LOL... I've hundreds of One-Liners....

* All of my REALLY GOOD Sigs are one character too lon
* Don't play stupid with me... I'm better at it!
* Girls with the most streamlined curves offer the most resistance!
* I think I'm suffering from mood poisoning, it must be something I hate!
* It takes a lot of brains to enjoy satire, humor and wit - but none to be
offended by them.
* No, there are no more bugs! (what the?) ///\oo/\\\ ///\oo/\\\
* There are 3 kinds of people: those who can count & those who can't!
* Without my ignorance, your knowledge would be meaningless!
Jul 21 '05 #5

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

Similar topics

4
4834
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
8
2878
by: Mr. B | last post by:
VB.net (standard) I'm experiencing some difficulties in printing multiple pages using Print Preview. The following is my main parts of my printing subs (excess info deleted for your viewing...
0
1596
by: MLH | last post by:
I have the following code partially built from stuff I cut 'n pasted from A97 help... 120 Dim Msg, Style, Title, Help, Ctxt, Response, MyString 140 Msg = "You started to enter...
4
9181
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
2
1516
by: Thiago Guedes | last post by:
Hi, how can I open a .hlp file by a link in a asp.net page? *** <asp:hyperlink id="HyperLink1" runat="server" NavigateUrl="help/help.HLP">Help</asp:hyperlink> **** When the link open I dont...
4
1938
by: Mr. B | last post by:
I've a 3D array --> myArray(14, 20) This array contains both Text and Numbers. What I'd like to do is to have a "Simple" output to Print. Nothing fancy on Text and stuff (the default of...
6
4072
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
0
1300
by: Madmax | last post by:
I am trying to use the .hlp file (an old help from for an existing app) in my application .Although the file shows up but it does not open the desired search string this is what I am doing ...
2
1755
by: HornyAZNBoy | last post by:
I've just wrote a hlp file to a program I just completed. Now I want to open that hlp file with a command on my program. I've tried using the Call Shell(C:/WINDOWS/Cris/desktop/MS Skill Book/Skill...
0
7391
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
7553
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
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.