1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

please what is the best way to print this

Discussion in 'Delphi Help&Requests' started by Maher Tannous, Jul 12, 2015.

  1. Maher Tannous
    Offline

    Maher Tannous DF Junior

    please i want to print listview items with label in the same paper
    what i will do for that ?
    how to print listview items ? what is the best report package for that ?
    i want an advice
    thanks a lot
    show attachment please
     

    Attached Files:

    • 5.jpg
      5.jpg
      File size:
      94.1 KB
      Views:
      17
  2. Maher Tannous
    Offline

    Maher Tannous DF Junior

    RE:

    any help ?
     
  3. hatm
    Offline

    hatm DF Junior

    RE:

    Standard TTreeView and TListView allow to print the contents to any canvas (bitmap or printer etc). All what you need is to send the WM_PRINT message.
    The code below demonstrate how you may print to bitmap file:
    - to print listview
    Code:
    var
      bmp: TBitmap;
    begin
      bmp := TBitmap.Create;
      try
        bmp.Width := ListView1.Width;
        bmp.Height := ListView1.Height;
        bmp.Canvas.Lock;
        try
          ListView1.Perform(WM_PRINT, bmp.Canvas.Handle, PRF_CHILDREN or PRF_CLIENT or PRF_NONCLIENT);
        finally
          bmp.Canvas.UnLock;
          bmp.SaveToFile('d:\tree.bmp')
        end;
      finally
        bmp.Free
      end;
    end;


    Source: #163: How can print the TTreeView and/or TListView?
     
  4. Maher Tannous
    Offline

    Maher Tannous DF Junior

    RE:

    thanks i will try it
     
  5. formeram
    Offline

    formeram DF Junior

    Thank you for help!
     
  6. Maher Tannous
    Offline

    Maher Tannous DF Junior

    thanks all is good
    I have moved label and listview and all that I want to print to a new form
    and then replaced listview with form
    like this

    Code:
    var
      bmp: TBitmap;
    begin
      bmp := TBitmap.Create;
      try
        bmp.Width := form1.Width;
        bmp.Height := form1.Height;
        bmp.Canvas.Lock;
        try
          form1.Perform(WM_PRINT, bmp.Canvas.Handle, PRF_CHILDREN or PRF_CLIENT or PRF_NONCLIENT);
        finally
          bmp.Canvas.UnLock;
          bmp.SaveToFile('d:\tree.bmp')
        end;
      finally
        bmp.Free
      end;
    end;
     

Share This Page