Click here to Skip to main content
15,923,051 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Validator Pin
Christian Graus24-Mar-08 10:19
protectorChristian Graus24-Mar-08 10:19 
GeneralEnabling/disabling linkbutton in Grid Pin
iamdking24-Mar-08 6:19
iamdking24-Mar-08 6:19 
GeneralRe: Enabling/disabling linkbutton in Grid Pin
Christian Graus24-Mar-08 10:39
protectorChristian Graus24-Mar-08 10:39 
Generalhii Pin
bunny.varun24-Mar-08 5:40
bunny.varun24-Mar-08 5:40 
GeneralRe: hii Pin
wEb GuRu...24-Mar-08 5:47
wEb GuRu...24-Mar-08 5:47 
GeneralRe: hii Pin
Christian Graus24-Mar-08 10:24
protectorChristian Graus24-Mar-08 10:24 
GeneralRe: hii Pin
Vasudevan Deepak Kumar24-Mar-08 20:46
Vasudevan Deepak Kumar24-Mar-08 20:46 
QuestionArray Output Sorting Issue Pin
LittlBUGer24-Mar-08 5:39
LittlBUGer24-Mar-08 5:39 
Hello. First of all I'm programming in VB.NET/ASP.NET doing a page for a website. Now, to my question....

I have a simple array of integer numbers (15 characters in length) which can hold up to 2000 items. What I basically need to do is output these numbers to a PDF file I'm creating on the fly and I can only fit a certain amount of numbers per page. What I need to do is just output these on each page in numerical order vertically NOT horizontally. Based on page size restrictions, the amount of numbers I can output per page is 19 rows x 7 columns (or 133 items total).

Now, I already have the PDF creation going fine, including adding more pages as there's more numbers being added, etc. It's just the sorting of these numbers that I'm outputting I'm having trouble with. What I'm doing currently (which is archaic), since I can only output horizontally at the moment, is outputting the first number, then skipping the next 18, and then outputting the next number, then skipping the next 18, etc. Once I get to the 7th number (1st row, 7th column), I output it, skip backwards to the 2nd number in the array, and output it as I'll now be in the 2nd row (2nd row, 1st column). I keep doing this until all numbers in the array are output. The only problem is that, other than being finicky and definitely not an efficient way of doing it, is if the array has fewer than 133 numbers (or if by chance there's fewer than 133 numbers on any one page), the output structure is all messed up.

For more info on what I'm currently doing, here's some code examples:

Dim theTagArray(2000) As String<br />
' theTagArray is filled before this next section...<br />
<br />
Dim thecount2 As Integer = 0<br />
Dim thecount3 As Integer = 0<br />
Dim thenum As Integer = 19<br />
' Nice mess to print tags in numeric order down each column, left to right...<br />
' Basically, start with first element, then skip 18 and put next, skip 18 put next, etc. and so forth...<br />
' pdfText2a.Add is the function that's basically outputting the array element... to the PDF...<br />
    If thecount3 = 7 Then<br />
	thecount2 += 1<br />
	thecount3 = 0<br />
	pdfText2a.Add(theTagArray(thecount2 + (thecount3 * thenum)) & " | ")<br />
	thecount3 += 1<br />
    Else<br />
	pdfText2a.Add(theTagArray(thecount2 + (thecount3 * thenum)) & " | ")<br />
	thecount3 += 1<br />
    End If


I want it to look kind of like this:

982000018301450 | 982000018561709 | ...<br />
982000018561265 | 982000018561724 | ...<br />
...


Though 7 across, 19 down.

So, this is why I'm asking if there's a way to output an array vertically instead of horizontally in either a slightly more efficient way than I'm doing it, or by using a much better method altogether. Please help if you can. Thanks for your help.

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein

AnswerRe: Array Output Sorting Issue Pin
geekfromindia24-Mar-08 6:11
geekfromindia24-Mar-08 6:11 
GeneralRe: Array Output Sorting Issue Pin
LittlBUGer24-Mar-08 6:16
LittlBUGer24-Mar-08 6:16 
GeneralRe: Array Output Sorting Issue Pin
ChrisKo24-Mar-08 9:33
ChrisKo24-Mar-08 9:33 
GeneralRe: Array Output Sorting Issue Pin
Christian Graus24-Mar-08 10:40
protectorChristian Graus24-Mar-08 10:40 
GeneralRe: Array Output Sorting Issue Pin
LittlBUGer24-Mar-08 11:26
LittlBUGer24-Mar-08 11:26 
GeneralRe: Array Output Sorting Issue Pin
Christian Graus24-Mar-08 11:41
protectorChristian Graus24-Mar-08 11:41 
GeneralRe: Array Output Sorting Issue Pin
LittlBUGer24-Mar-08 11:47
LittlBUGer24-Mar-08 11:47 
GeneralRe: Array Output Sorting Issue Pin
Christian Graus24-Mar-08 12:09
protectorChristian Graus24-Mar-08 12:09 
GeneralRe: Array Output Sorting Issue Pin
LittlBUGer24-Mar-08 12:46
LittlBUGer24-Mar-08 12:46 
GeneralTo Change the Date Format. Pin
udaymohan24-Mar-08 4:24
udaymohan24-Mar-08 4:24 
GeneralDouble post - please ignore Pin
pmarfleet24-Mar-08 4:31
pmarfleet24-Mar-08 4:31 
QuestionCode Placement Pin
ahlaj7724-Mar-08 4:10
ahlaj7724-Mar-08 4:10 
GeneralRe: Code Placement Pin
pmarfleet24-Mar-08 4:24
pmarfleet24-Mar-08 4:24 
GeneralRe: Code Placement Pin
Not Active24-Mar-08 4:38
mentorNot Active24-Mar-08 4:38 
GeneralRe: Code Placement Pin
pmarfleet24-Mar-08 4:54
pmarfleet24-Mar-08 4:54 
GeneralRe: Code Placement Pin
Not Active24-Mar-08 5:53
mentorNot Active24-Mar-08 5:53 
GeneralRe: Code Placement Pin
pmarfleet24-Mar-08 6:14
pmarfleet24-Mar-08 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.