Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
amitkumarmadhukar
Starting Member
45 Posts |
Posted - 2004-08-06 : 05:20:24
|
hello guysi used code for printing looks likeDo While Not .EOFPrinter.Print Space(15); "" + Name + ""; Space(5); "" + Amount+"".move nextLoopand may be the value of in 3 loops are [Amit] [2522.52][Sumit] [2523.53][Raja Ram] [5223.63]and the output over paper i receive is Amit-----------------2552.52Sumit-----------------2523.53Raja Ram-----------------5223.63i mis ordered allignement because Amit if of 4 length, sumit is of 5 length and Raja Ram is or 8 lengthand i want to the output on paper asAmit-----------------------2552.52Sumit----------------------2523.53Raja Ram-------------------5253.63Can u suggest the right printer format string instead ofPrinter.Print "Space(15); "" + Name + ""; Space(5); "" + Amount+"" "amit kumar madhukar |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-08-08 : 19:02:43
|
Try declaring your strings as fixed-length. Then they will be automatically padded to the correct length for printing.Or you could write a function to pad a string to a given length: newStr = str & Space(newLength - len(str))Or you could set the column positioning using the VB CurrentX and CurrentY properties. This is probably the most reliable, as it allows also for non-fixed width fonts.Tim |
|
|
amitkumarmadhukar
Starting Member
45 Posts |
Posted - 2004-08-09 : 14:27:21
|
Hello, Timmy Thanks for taking interest into my question.Thanks for Advice.But Sorry to inform that i solved my problem already. and in that process Dr. Mr JSmith,USA and One Person From UAE help me to get at the point of solution.however this is not the matter of Fixed Length,I think that u know better in bussiness world alwayas there is no fixed length vairable, Amounts, Description, Number vary time to time so we can use fixed length variables.and u talk about the function to pad the length of varible then my dear that was my question not my solution. and u also talk about the Current X and Current Y feature of Printer. have u any idea about the length of coding to control Current X and Curren Y if you have to Print 100 of pages with thousand of word.so now i think u learned that how far u actually from the even question.amit kumar madhukar |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-08-09 : 19:39:01
|
Just trying to help. I won't in future if that's your attitude..... |
|
|
|
|
|