Results 1 to 21 of 21

Thread: not set left margin in printer please help quick

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    183

    not set left margin in printer please help quick

    Hello,
    i create a datareport6 and set LeftMargin = 720 and RightMargin = 720 but when i print on paper left margin is 1440 (its means 1 inch left side of paper) then print start on paper how can set leftmargin = 720 on datareport6 please help my paper size 8.5''
    i also used but faild

    Printer.CurrentX = 0.5 * 1440
    DataReport6.PrintReport False
    Last edited by kako0000000; Apr 26th, 2014 at 07:43 AM.

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: not set left margin in printer please help quick

    try setting the margin using vbInches....some printers will not allow left edge printing....yours may not...but try this

    Code:
     Printer.ScaleMode = vbInches
       Printer.CurrentX = 1
      Printer.CurrentY = 1
      Printer.Print "hello"
      Printer.EndDoc
    EDIT: I don't use datareports, so don't know if that would help you or not...but, if you run this small code, at least you can see if the printer will allow you to print at the left edge of your paper
    Last edited by SamOscarBrown; Apr 26th, 2014 at 08:39 AM.

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: not set left margin in printer please help quick

    I often set the left margin to 0 to get the printer to print closer to the left edge.
    Margin settings seem to start from the first printable area and in many cases that is up to 1/2 inch from the left then they add whatever margin to that

    btw I would not expect setting currentx to do anything at all in this case.
    The report settings will determine what gets printed and where.
    Currentx and currenty is for use with the printer.print method

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    183

    Re: not set left margin in printer please help quick

    not work datareport

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: not set left margin in printer please help quick

    did you try setting the margin to 0?

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    183

    Re: not set left margin in printer please help quick

    set datareport leftmargin 720 but when i using printer DataReport6.PrintReport False command printer print report is ok but left side left one inch.
    but i set leftmargin is 720

  7. #7
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: not set left margin in printer please help quick

    So set it to a lower value, did you try 0? If not then try it and see what happens.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: not set left margin in printer please help quick

    Printers (or their drivers) often limit the printable area on a sheet of paper with implied margins.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    183

    Re: not set left margin in printer please help quick

    i try but is not work please any idea how can print using leftmargin 0 start print on paper

  10. #10
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: not set left margin in printer please help quick

    Quote Originally Posted by dilettante View Post
    Printers (or their drivers) often limit the printable area on a sheet of paper with implied margins.
    That is what I said in Post #2, hence the small code to check to see if the printer would actually NOT limit the printable area or not...guess OP doesn't want to even check that....oh well.

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: not set left margin in printer please help quick

    Yes I know. I was just trying to repeat the point, hoping to get through to him.

  12. #12
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: not set left margin in printer please help quick

    As for the margin I do not use the datareport tool but assuming it has a property for leftmargin and it supports a value of 0 then that is turnign off any margin added by the report. Any margin that remains is coming from the printer or the driver.

    I would think that a setting of 0 would have reduced the margin from what it was when set at 720 which would have been reduced from when it was at 1440, unless of course you set the margin incorrectly.

    In any case since the OP did not tell us what happened when set to 0 ["not work" tells us nothing] nor do we have any idea how he/she is setting the margin there is not much more to say here.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    183

    Re: not set left margin in printer please help quick

    i not understand

  14. #14
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: not set left margin in printer please help quick

    See Bleed (printing).

    Many printers have a bleed area that they cannot print into.

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    183

    Re: not set left margin in printer please help quick

    but when i use MS Word and its papersize set leftmargin is 0 then printer good print on the paper left side where i write how can possible this only not set datareport leftsidemargin net set but thanks help

  16. #16
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: not set left margin in printer please help quick

    Seems to work fine here.

    Make sure you have VB6 SP6 installed. The DataReport got a lot of changes around the time of SP4, such as the Orientation property. This suggests there may have been margin handling changes as well.

    See: FIX: Error Message "Report Width Is Larger Than the Paper Width" When Showing Data Report in Landscape

    But no guarantees.

  17. #17
    New Member
    Join Date
    Jul 2018
    Posts
    7

    Re: not set left margin in printer please help quick

    Hello,
    I also have this problem. I want to set leftmargin set to 0. Post #2 code is working correctly. But I want for DataReport.
    I'm using thermal bill printer. When Post #2 code is used, left margin size is 5mm. But it is 10mm when DataReport is used.
    Please help.

  18. #18
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: not set left margin in printer please help quick

    Did you read post #16 (make sure you have SP6 installed) and go to the link dilettante provided?

  19. #19
    New Member
    Join Date
    Jul 2018
    Posts
    7

    Re: not set left margin in printer please help quick

    Dear SamOscarBrown,
    Many thanks for you. SP6 worked. But I have a another problem. DataReport adding option exist One PC(solved My problem). Other PC haven't. see the picture.Name:  VB.jpg
Views: 615
Size:  25.6 KB
    Please help.

  20. #20
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: not set left margin in printer please help quick

    If the following doesn't resolve your problem, you should start your own thread.

    - With your project loaded, press Ctrl+T (or select Components from Project menu)
    - When the components window opens, select the "Designers" tab near top of the window
    - Ensure "Data Environment" and "Data Report" are checked and click the "Ok" button
    - Now try to add your data report
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  21. #21
    New Member
    Join Date
    Jul 2018
    Posts
    7

    Re: not set left margin in printer please help quick

    Hello,
    In addition to Post 17, My problem is not solved yet. when I use Data Report and POS machine, can not adjust left margin size to 5mm(on paper. it is viewing as 0 margin on PC). But other all times ( Data Report with other printer, Post #2 code or any other document with POS machine), can adjust left margin size to 5mm. what I said on Post 19 as "SP6 worked", I misunderstood. It was with another printer. How can I solve this? Please help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width