Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Begin printing at row x column y

Begin printing at row x column y

Scheduled Pinned Locked Moved C#
databasesql-serversysadmintutorialquestion
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roger CS
    wrote on last edited by
    #1

    I have written a report to print labels which works quite well as long as a full sheet is to be printed. Unfortunately in the real world people rarely print full sheets of labels. Instead they need to be able to specify a column and row to begin printing. The label report is actually a horizontal report that prints three rows then moves to the next column prints three rows and so on. The names and addresses are pulled from a SQL Server 2005 database. Is there a way to send printer codes to the printer to position the print head before printing begins? I've even thought about using dummy records to get the printer to skip to the right record, but I'm not sure how to do that or if it would even work. Any suggestions are appreciated.

    L D 2 Replies Last reply
    0
    • R Roger CS

      I have written a report to print labels which works quite well as long as a full sheet is to be printed. Unfortunately in the real world people rarely print full sheets of labels. Instead they need to be able to specify a column and row to begin printing. The label report is actually a horizontal report that prints three rows then moves to the next column prints three rows and so on. The names and addresses are pulled from a SQL Server 2005 database. Is there a way to send printer codes to the printer to position the print head before printing begins? I've even thought about using dummy records to get the printer to skip to the right record, but I'm not sure how to do that or if it would even work. Any suggestions are appreciated.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Roger CS wrote:

      Any suggestions are appreciated.

      I suggest you do some reading about how to do printing[^]

      R 2 Replies Last reply
      0
      • L led mike

        Roger CS wrote:

        Any suggestions are appreciated.

        I suggest you do some reading about how to do printing[^]

        R Offline
        R Offline
        Roger CS
        wrote on last edited by
        #3

        Anyone here who actually knows how to do what I'm asking about?

        D 1 Reply Last reply
        0
        • R Roger CS

          Anyone here who actually knows how to do what I'm asking about?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Your description isn't very clear, so I'm guessing at it too. How about this[^].

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          R 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Your description isn't very clear, so I'm guessing at it too. How about this[^].

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            R Offline
            R Offline
            Roger CS
            wrote on last edited by
            #5

            Dave Kreskowiak wrote:

            Your description isn't very clear

            I’ll try to be clearer. I am printing mailing labels. The sheet of labels has 3 columns and 10 rows (for a total of 30 labels). Normally people don't need to print exactly 30 labels or multiples of 30. Instead they may need to print 10, then later 6 more and so on. If the user starts with a fresh sheet and prints 10 labels, there will be 20 labels remaining. The next time the user prints labels they need to start printing at label 11. For this reason, the program allows the user a way to enter the row and column at which to start printing labels. In this case the user would enter row = 4 and column = 2. I want to know how to start printing labels at row 4, column 2. The information in the labels is pulled from a SQL Server 2005 database using a select query. Thanks for the pointer to the KB article! Roger -- modified at 17:35 Saturday 13th October, 2007

            1 Reply Last reply
            0
            • L led mike

              Roger CS wrote:

              Any suggestions are appreciated.

              I suggest you do some reading about how to do printing[^]

              R Offline
              R Offline
              Roger CS
              wrote on last edited by
              #6

              led mike wrote:

              I suggest you do some reading about how to do printing

              Yup, you were right. Everything I needed to know was there... I just had to extend PrintDocument and add some functionality. Thanks, Roger

              L 1 Reply Last reply
              0
              • R Roger CS

                I have written a report to print labels which works quite well as long as a full sheet is to be printed. Unfortunately in the real world people rarely print full sheets of labels. Instead they need to be able to specify a column and row to begin printing. The label report is actually a horizontal report that prints three rows then moves to the next column prints three rows and so on. The names and addresses are pulled from a SQL Server 2005 database. Is there a way to send printer codes to the printer to position the print head before printing begins? I've even thought about using dummy records to get the printer to skip to the right record, but I'm not sure how to do that or if it would even work. Any suggestions are appreciated.

                D Offline
                D Offline
                darkelv
                wrote on last edited by
                #7

                How are you printing the labels now? Direct sending ESC keys to printer or using print document?

                R 1 Reply Last reply
                0
                • D darkelv

                  How are you printing the labels now? Direct sending ESC keys to printer or using print document?

                  R Offline
                  R Offline
                  Roger CS
                  wrote on last edited by
                  #8

                  I wrote a report. I was just printing the report. I hadn't gotten any further than that when I posted this question. What I have learned since then is that I can print lables using the PrintDocument class. I just need to extend the functionality to meet my requirements.

                  1 Reply Last reply
                  0
                  • R Roger CS

                    led mike wrote:

                    I suggest you do some reading about how to do printing

                    Yup, you were right. Everything I needed to know was there... I just had to extend PrintDocument and add some functionality. Thanks, Roger

                    L Offline
                    L Offline
                    led mike
                    wrote on last edited by
                    #9

                    Roger CS wrote:

                    Thanks

                    See I did actually now something about it ;P Seriously though, one can never go wrong reading documentation. Even if it does not present your immediate solution you still gain knowledge.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups