printing stringgrid

Posted on 2006-04-22
Last Modified: 2010-04-05
hi all, i would like to print stringgrid, what i have do not make job correctly, my grid have linefeed and cariage return in some cells (#13#10), and the procedure i have dont not make it just making some square,, if someone can help me it would appreciate.....

thanks you
Question by:popy

    Author Comment

    me be someone would like have to code i already have there is the print but dont making linefeed and cariage return

    procedure PrintGrid(sGrid: TStringGrid; sTitle: String);
     X1, X2 : Integer;
     Y1, Y2 : Integer;
     TmpI   : Integer;
     F      : Integer;
     TR     : TRect;
     Printer.Canvas.Font.Name:='Times New Roman';
     Printer.Canvas.Font.Style:=[fsBold, fsUnderline];
     Printer.Canvas.TextOut(0, 100, Printer.Title);
     For F:=1 to sGrid.ColCount-1 do begin
       For TmpI:=0 to (F-1) do
       For TmpI:=1 to F do
       TR:=Rect(X1, Y1, X2-30, Y2);
       Printer.Canvas.TextRect(TR, X1+50, 350, sGrid.Cells[F, 0]);
       For TmpI:=1 to sGrid.RowCount-1 do begin
         TR:=Rect(X1, Y1, X2-30, Y2);
         Printer.Canvas.TextRect(TR, X1+50, Y1+50, sGrid.Cells[F, TmpI]);
    LVL 5

    Accepted Solution

    Here a nice object that i found which will help you:

    look for...
    TObjectPrinter V2.0.7

    Download the version of delphi you are using and simple as:

    With ObjectPrinter1 do

    Peace Scay7

    Author Comment

    Wow, exactly what i looking for

    thanks alot

    Author Comment

    i have a question

      i would like to bypass the preview, can i..???
    LVL 5

    Expert Comment

    Yes you should beable to in the options menu...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now