Results 1 to 8 of 8

Thread: PRINTING again! FROM DELPHI 6

  1. #1
    Join Date
    Apr 2003
    Posts
    4
    Rep Power
    0

    Default PRINTING again! FROM DELPHI 6

    Help! I really cannot print the contents of my edit boxes, only the contents of the memos. the deadline is drawing near. HELPPP :'(

  2. #2
    Join Date
    Jun 2002
    Posts
    648
    Rep Power
    0

    Default Re:PRINTING again! FROM DELPHI 6

    Fill me in...why would you want to print the contents of your edit boxes?
    And I am assuming you mean to the printer?

    Also, I am curious:
    (a) where are you located?
    (b) What institution?

  3. #3
    Join Date
    Apr 2003
    Posts
    4
    Rep Power
    0

    Default Re:PRINTING again! FROM DELPHI 6

    Hi,
    let's get straight to the point. I need to print the contents of my edit boxes because they are the fields of my report forms. I have no software to do my reports, so I want to do it from the forms.
    I live in kingston, the institution I attend does not teach delphi, I'm teaching myself as well as doing my advanced project. so you see, I desperately need help.
    any suggestions I'm all ears (eyes). but before next friday! thanx

  4. #4
    Join Date
    Jun 2002
    Posts
    648
    Rep Power
    0

    Default Re:PRINTING again! FROM DELPHI 6

    Are you using databound controls? A databound control is one that is directly linked to (and usually displaying) the content of a database field. What edit boxes are you using? TEdit ? TDBEdit? It is very important for you to specify the control types when asking for help.

    Normally you would not print from controls on a form but from the database records itself. Doesn't your version of Delphi have a reporting tool? In Delphi 6 I think it is QuickReports - in Delphi 7, Borland has replaced QuickReports with Rave (a very good reporting tool). I do a lot of reporting so I actually use ReportBuilder (which is said to be the best).

    So, are you storing the form data in a database? If so, what database engine are you using?


  5. #5
    Join Date
    Apr 2003
    Posts
    4
    Rep Power
    0

    Default Re:PRINTING again! FROM DELPHI 6

    I am using the TEdit edit boxes and I have not linked it with a database engine, I should probably try Access, what do you think? In my copy of the Delphi 6 compiler (which I got from the net) the quick reports wizard seems to be bad minding me. I can't get to use it. could you offer some assistance please? ???

  6. #6
    Join Date
    Jun 2002
    Posts
    648
    Rep Power
    0

    Default Re:PRINTING again! FROM DELPHI 6

    Okay, so your program allows a user to input data into your form which consists of several edit boxes and then allowing them to print what they have entered.

    Now if you are not storing the input in a database, then what if your user needs to do a reprint some time in the future? Are you saying that they would have to re-enter the input? So you have to somehow store what your user has entered.

    One easy way is to use a database engine (for example Access) to do this. Yes, I recommend Access for your project (since this is just a school assignment) and use ADO as the middle-man between you delphi code and the database itself.

    With all this said, I think I need to have a better idea of what the assignment is.

  7. #7
    Join Date
    May 2003
    Posts
    3,041
    Rep Power
    0

    Default Re:PRINTING again! FROM DELPHI 6

    I will a$ume that a printer is already setup on your box, and works

    To print from a text file:

    RichEdit1.Lines.LoadFromFile('thedoc.txt' // absolute path
    RichEdit1.Print('From Text doc' // just a title

    To print from a edit box:

    RichEdit1.Lines.Add(edit1.Text); // some string or the other, lucky for us edit1.text is a string
    RichEdit1.Print('From Edit box' // just a title

  8. #8
    Join Date
    May 2003
    Posts
    35
    Rep Power
    0

    Default Re:PRINTING again! FROM DELPHI 6

    [quote author=benzgirl link=board=20;threadid=695;start=0#msg5041 date=1052413782]
    Help! I really cannot print the contents of my edit boxes, only the contents of the memos. the deadline is drawing near. HELPPP :'(

    [/quote]
    I wrote a small app for someone and its primary function was to enter info and print but I also gave the capability to store the info via .ini & .txt file (no DB) just in case the info printed was incorrect and needed editing or for whatever reason it needed to be printed again . Anyway, for printing the text from edit boxes, memos, etc. This was what I did...

    1. Add a new form to the project
    2. Put a QReport on that form and set HasTitle Band := True
    3. Put respective QRMemos and QRLabel in the Title band on the QReport for corresponding TEdits and Memos on the standard form
    4. Initialise the QRLabels and QRMemos with the values of the corresponding values TEdits and Memos before the QReport.print() is called; You can do a QReport.preview; to see what the printed version should look like before you do the actual printing. You can hide the form during printing if you don't want it to be visible.



    ;D

Posting Permissions

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