Tform1.print Save

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2009
Posts: 11
Reputation: Vdub.za is an unknown quantity at this point 
Solved Threads: 0
Vdub.za Vdub.za is offline Offline
Newbie Poster

Tform1.print Save

 
0
  #1
Oct 27th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 36
Reputation: fayyaz is an unknown quantity at this point 
Solved Threads: 6
fayyaz fayyaz is offline Offline
Light Poster
 
0
  #2
Oct 31st, 2009
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;
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 11
Reputation: Vdub.za is an unknown quantity at this point 
Solved Threads: 0
Vdub.za Vdub.za is offline Offline
Newbie Poster
 
0
  #3
Nov 1st, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 40
Reputation: BitFarmer is an unknown quantity at this point 
Solved Threads: 4
BitFarmer BitFarmer is offline Offline
Light Poster
 
0
  #4
Nov 10th, 2009
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).
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum


Views: 842 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC