Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

What I'm trying to do seems very simple, but it's been hard for me to ever find a solution.

 

I have an array of data that I want to display to the user. Just like in any type of reporting, I want to create a simple format for the data to appear in, then loop through the array and display each instance in some type of field on my form.

 

Any 'reporting' tools I've looked at for VB.net seem to require a database to hook into, and will not work with an array. Does anybody know of how I can apply some type of formatting / style template and then fill it in with contents of an array?

  • *Experts*
Posted

What's your output going to be? A grid, a printed report, something else?

 

Are you asking how to loop through the array, do the formatting, or how to get a formatted string into something viewable?

 

Let's say you had an array of strings (names) that you wanted to format and put in a textbox (simple code):

string[] mynames = new string[] {"Dan", "Bob"};
textBox1.Text = string.Empty;
foreach(string s in mynames)
   textBox1.Text += mynames + "\r\n";

 

If you wanted this string in a listbox:

string[] mynames = new string[] {"Dan", "Bob"};
listBox1.Items.Clear();
foreach(string s in mynames)
   listBox1.Items.Add(s);

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

I'd prefer that my output just be within a field on the form - like a textbox. I'm using VB.net. I'm not concerned with any of the coding (looping, array, etc. etc.) because I have all of that handled. What I'm trying to do is find a way to present a nice report of the data I've collected to the user.

 

The best way I can describe this is with students/report cards. Let's say I have data tracked on a bunch of students, varying from their names, birthdays, and grades. In my program I want to display a 'report card' page... that, when accessed, uses a standard template with a nice header, possibly colors, lines, etc... and then fills in the data from the student record in a format that I specifiy.

 

Basically all I'm trying to do is find a way to do on-screen reporting. There are expensive report-writer components for sale out there that would probably work - but all of them work off of databases... whereas I'm just trying to work from an array.

 

I hope that makes sense... thanks for your help so far!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...