I have some code and string i want the string to be fixed length of 15 if string length is less than 15 than i want to add spacing to make my string 15 character wide for printing purpose
i have tried
(string.format("{xxxxxxxxxxxxxxx}",myRow.Cells["PREMIER REG"].Value.ToString())
Input string was not in correct format exception thrown
myGraphic.DrawString("S# | DESCRIPTION | QTY | PRICE
| SUBTOTAL", myFont, Mybrash, xMargin, ySpacing);
ySpacing += 7;
myGraphic.DrawLine(myPen, xMargin, yMargin, 50, 0);
ySpacing += yMargin;
foreach (DataGridViewRow myRow in dataGridViewBill.Rows)
{
int i = 1;
myGraphic.DrawString(
i+ "" +
myRow.Cells["gvProductTitle"].Value.ToString() +
myRow.Cells["gvQuantity"].Value +
myRow.Cells["gvPrice"].Value +
myRow.Cells["gvTotal"].Value
, myFont, Mybrash, xMargin, ySpacing);
ySpacing += yMargin;
}
The problem in printing gvquantity
value is being to pulled to product column