I need to print data from a DataGridView on both sides of a preprinted form but:
- Each side has different arrangement for that info.
- Each side can only hold info from tree rows, so:
- 1st, 2nd and 3rd row go on side 1;
- 4th, 5th and 6th row go on side 2;
- 7th, 8th and 9th row go on side 1;
- 10th, 11th and 12th go on side 2; and so on.
I will select which group to print.
I’m planning to do it this way:

- ((row.Index) +1) / 3,
- round it up, with no decimals, to get an integer, (like in the above excel
image), - MOD that integer by 2, (like in the above excel image).
If the result of that MOD by 2 is 1, then it will print Side 1 arrangement,
if the result of that MOD by 2 is 0, then it will print Side 2 arrangement.
- How do I do it in C#? I’m using VS2010 Express Edition. Also, I
wanted to use System.Math.Ceiling but I get a Namespace, decimal,
double-precision and floating-point number warnings or errors.
I don’t see that you need to use anything like that:
Test code:
Output: