Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Albo,</p> <p>I think it might be useful to set a breakpoint at</p> <pre><code> '//draw the cell text g.DrawString(PrintGrid.Cell(i, j).CText, PrintGrid.Cell(i, j).Font, New SolidBrush(PrintGrid.ForeColor), New RectangleF(CurrentX - PrintGrid.Cell(i, j).Width, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height), sf) </code></pre> <p>To see exactly what's going on. Without running such a breakpoint, and from this resource <a href="http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx" rel="nofollow">here</a>, my first guess might be something like this:</p> <pre><code>If j = PrintGrid.Columns - 1 Then Dim pattern As String = "MM-dd-yy" If DateTime.TryParseExact(PrintGrid.Cell(i, j).CText, pattern, Nothing, DateTimeStyles.None, PrintGrid.Cell(i, j).CText) Then g.DrawString(PrintGrid.Cell(i, j).CText, PrintGrid.Cell(i, j).Font, New SolidBrush(PrintGrid.ForeColor), New RectangleF(CurrentX - PrintGrid.Cell(i, j).Width, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height), sf) Else g.DrawString(PrintGrid.Cell(i, j).CText, PrintGrid.Cell(i, j).Font, New SolidBrush(PrintGrid.ForeColor), New RectangleF(CurrentX - PrintGrid.Cell(i, j).Width, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height), sf) End If </code></pre> <p>This attempts to parse the text of the column (in your case, the PrintGrid.Columns - 1th cell) as a date, if it succeeds, then it puts the newly formatted text back into the column before it sends it to the print sub. I highly doubt this code would work as-is, but with some debugging and application of correct string to datetime formatting...I think this is the right direction.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload