Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to print report like this


Report(Heading Center)

company name

customer name:XXXX_____________________Bill No.:XXX

_______________________________________Date____:15/5/12
------------------------------------------------------
description___________________qty_____rate______Amount
------------------------------------------------------
cap____________________________10_____150_______1500
watch___________________________2____1299_______2598
pin___________________________100_______1________100
paper___________________________1_______1__________1
----------------------------------------------------





(______________________________)*It Refers the empty space between the letters*





but me getting trouble in allignment

from the database i read the vales that also written in noptepad file but its not in correct arranged format.
so give me the code to print the txt file

me getting result like


company name

customer name:XXXX Bill No.:XXX

Date :15/5/12
------------------------------------------------------
description qty rate Amount
------------------------------------------------------
cap 10 150 1500
watch 2 1299 2598
pin 100 1 100
paper 1 1 1
----------------------------------------------------


Please Help Me i need to get the output is alligned


thanks
Posted
Updated 16-May-12 11:06am
v3
Comments
Sandeep Mewara 16-May-12 7:27am    
give me the code to print the txt file
It does not work like this here.

Update the question with what have you tried.

1 solution

VB
.WriteLine(ComStr1.PadRight(15, ""c) & _
  Space(2) & _
 ControlChars.Tab & ComStr2.PadLeft(3," "c) & _
 Space(4) & _
 ControlChars.Tab & ComStr3.ToString.PadLeft(4," "c) & _
 Space(3) & _
 ControlChars.Tab & ComStr11.ToString.PadLeft(5, " "c))




//Comstr1=Description
//ComStr2=Qty
//Comstr3=Rate
//Comstr11=Amount
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900