Hello. This will probably sound stupid and may not make any sense at first, but for some reason I can't figure it out. It's not really that difficult to understand after you've read it all through... 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. 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.
Please, is there anyone that can help? I'd even be willing to pay a small fee if you can. For more info. on what I'm currently doing, here's some code examples: Dim theTagArray(2000) As String Dim thecount2 As Integer = 0 Dim thecount3 As Integer = 0 Dim thenum As Integer = 19 ' Nice mess to print tags in numeric order down each column, left to right... ' Basically, start with first element, then skip 18 and put next, skip 18 put next, etc. and so forth... ' pdfText2a.Add is the function that's basically outputting the array element... to the PDF... If thecount3 = 7 Then thecount2 += 1 thecount3 = 0 pdfText2a.Add(theTagArray(thecount2 + (thecount3 * thenum)) & " | ") thecount3 += 1 Else pdfText2a.Add(theTagArray(thecount2 + (thecount3 * thenum)) & " | ") thecount3 += 1 End If Code (markup): I want it to look kind of like this: Though 7 across, 19 down. Thanks.
A lot will depend on the capabilities of the PDF component.... looking at your code I cannot see the difference between the two pdfText2a commands to even try and guess how it functions.
Well, since I posted this, I was trying to do things slightly different. Instead of grab the numbers from my database and put them into an array, I was trying to put them into a datatable in the format or order I need them, so that I could then just spit them out as needed. Well everything I try just doesn't seem to work, so I'm still stuck. The PDF creation code is from iTextSharp and pdfText2a is a paragraph variable, such as: Dim pdfText2a As iTextSharp.text.Paragraph = New iTextSharp.text.Paragraph(New Chunk("", FontFactory.GetFont(FontFactory.HELVETICA, 10, iTextSharp.text.Font.NORMAL, New iTextSharp.text.Color(0, 0, 0)))) Code (markup): Thanks again for your help.