Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6562589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:43:37+00:00 2026-05-25T13:43:37+00:00

I need to print data from a DataGridView on both sides of a preprinted

  • 0

I need to print data from a DataGridView on both sides of a preprinted form but:

  1. Each side has different arrangement for that info.
  2. Each side can only hold info from tree rows, so:
  3. 1st, 2nd and 3rd row go on side 1;
  4. 4th, 5th and 6th row go on side 2;
  5. 7th, 8th and 9th row go on side 1;
  6. 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:
enter image description here

  1. ((row.Index) +1) / 3,
  2. round it up, with no decimals, to get an integer, (like in the above excel
    image),
  3. 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.
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:43:38+00:00Added an answer on May 25, 2026 at 1:43 pm

    I don’t see that you need to use anything like that:

    int zeroBasedRow = row - 1;
    int side = ((zeroBasedRow / 3) % 2) + 1;
    

    Test code:

    using System;
    
    class Test
    {
        static void Main(string[] args)
        {
            for (int row = 1; row <= 12; row++)
            {
                int zeroBasedRow = row - 1;
                int side = ((zeroBasedRow / 3) % 2) + 1;
                Console.WriteLine("Row {0} goes on side {1}", row, side);
            }
        }
    }
    

    Output:

    Row 1 goes on side 1
    Row 2 goes on side 1
    Row 3 goes on side 1
    Row 4 goes on side 2
    Row 5 goes on side 2
    Row 6 goes on side 2
    Row 7 goes on side 1
    Row 8 goes on side 1
    Row 9 goes on side 1
    Row 10 goes on side 2
    Row 11 goes on side 2
    Row 12 goes on side 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to print out data into a pre-printed A6 form (1/4 the size
I need to read and print data from a file. I wrote the program
I need to collect data from a visitor in an HTML form and then
I need to print what a string in Python contains. I'm collecting data from
I need to get data from an Excel file to print them in a
I need to send some data from my form in html to webservice. (For
I need to print a receipt from my web based apps using dot matrix
I need to print last 20 characters of string, but only whole words. Delimiter
I am writing C# application that need to print data to POS STAR printer
I need some help reading data from a text file into my ArrayList .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.