944,127 Members | Top Members by Rank

Ad:
Oct 27th, 2009
0

Tform1.print Save

Expand Post »
Hi guys,

I got a another question. i want to know how to go about saving a form1 to disk instead of printing it, so that i can email it to someone in a format that can be opened and read by the recepient. like for instance a home loan application form. i can print it yes but i am stumped about coding my app to save the file to disk.
can someone please help

Thanx
Vdub.za
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Vdub.za is offline Offline
11 posts
since Oct 2009
Oct 31st, 2009
0
Re: Tform1.print Save
Hi
This code is For Saving your Form to Disk. For Example You can use this code as OnClik routine of your Form.
Pascal and Delphi Syntax (Toggle Plain Text)
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. Var
  3. Bitmap:TBitMap;
  4. R:TRect;
  5. begin
  6. BitMap:=TBitMap.Create;
  7. Try
  8. BitMap.Width:=Form1.ClientWidth;
  9. BitMap.Height:=Form1.ClientHeight;
  10. R:=Rect(0,0,Form1.ClientWidth,Form1.ClientHeight);
  11. BitMap.Canvas.CopyRect(R,Form1.Canvas,R);
  12. Bitmap.SaveToFile('Form1.BMP');
  13. Finally
  14. Bitmap.Free;
  15. End;
  16. end;
Reputation Points: 12
Solved Threads: 10
Junior Poster in Training
fayyaz is offline Offline
66 posts
since Jun 2007
Nov 1st, 2009
0
Re: Tform1.print Save
hi

when i originally posted this question i was told it was to safe a form1 to disk now i am told no, the question is actually how do i save a rave report - to disk instead of printing it. are there any differences or not? i tried the code that was supplied but i get an error saying "undeclared identifier 'clientwidth' " and i take it will say the same for height and all other measurements. sorry to keep on bugging you guys about it.



Thank you
Vdub.za
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Vdub.za is offline Offline
11 posts
since Oct 2009
Nov 10th, 2009
0
Re: Tform1.print Save
Have you checked the rave help for a savetofile or savetocsv?
Do you need the raw data or the report as an image?
Do you need it to be automated from code, or just a way the user can do it for a given on-screen report?

Anyway, try using a PDF printer, for instance, PDFCreator can save in PDF, but also in JPEG if neccesary, so you can paste it into an email.

This printer can be commanded for your app via registry or via com object, so you can autosave to a folder with the names you need and in the format you need (not exactly easy, but possible and works ok).
Reputation Points: 12
Solved Threads: 5
Junior Poster in Training
BitFarmer is offline Offline
51 posts
since Nov 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Draw chart in delphi
Next Thread in Pascal and Delphi Forum Timeline: daysbetween function





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC