473,403 Members | 2,270 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,403 software developers and data experts.

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
Nov 20 '05 #1
4 1936
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)
Nov 20 '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.
==================================================
Nov 20 '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
Nov 20 '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!
Nov 20 '05 #5

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

Similar topics

4
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...
4
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...
8
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
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...
0
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
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
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...
6
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.