如何將Quick Report的報表轉成圖檔或PDF檔… |
答題得分者是:hagar
|
channel
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
|
hagar
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
Save QReports pages as BMP: http://www.nsonic.de/Delphi/txt_WIS00489.htm
procedure TForm5.Button4Click(Sender: TObject); var BMP: TBitMap; StoredUnits: TQRUnit; i: integer; StoreDir: string; begin StoreDir:=''; {!!! Assign folder to store here (with ending '\'), leave blank to store in the .exe's folder} QuickRep1.Prepare; StoredUnits:=QuickRep1.Units; QuickRep1.Units:=Pixels; try for i:=1 to QuickRep1.QRPrinter.PageCount do begin BMP:=TBitMap.Create; try BMP.Width:=Round(QuickRep1.Page.Width); BMP.Height:=Round(QuickRep1.Page.Length); QuickRep1.QRPrinter.PageNumber:=i; BMP.Canvas.Draw(0, 0, QuickRep1.QRPrinter.Page); BMP.SaveToFile(StoreDir 'Page' IntToStr(i) '.bmp'); finally BMP.Free; end; end; finally QuickRep1.Units:=StoredUnits; end; end;--- Everything I say is a lie. |
channel
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
引言: Save QReports pages as BMP: http://www.nsonic.de/Delphi/txt_WIS00489.htmhagar版主: 感謝您這麼快速的回應,3Q… 我會試一下您的程式碼,結果再跟您報告,有問題會再向您請教… 真是太感謝您提供程式碼…procedure TForm5.Button4Click(Sender: TObject); var BMP: TBitMap; StoredUnits: TQRUnit; i: integer; StoreDir: string; begin StoreDir:=''; {!!! Assign folder to store here (with ending '\'), leave blank to store in the .exe's folder} QuickRep1.Prepare; StoredUnits:=QuickRep1.Units; QuickRep1.Units:=Pixels; try for i:=1 to QuickRep1.QRPrinter.PageCount do begin BMP:=TBitMap.Create; try BMP.Width:=Round(QuickRep1.Page.Width); BMP.Height:=Round(QuickRep1.Page.Length); QuickRep1.QRPrinter.PageNumber:=i; BMP.Canvas.Draw(0, 0, QuickRep1.QRPrinter.Page); BMP.SaveToFile(StoreDir 'Page' IntToStr(i) '.bmp'); finally BMP.Free; end; end; finally QuickRep1.Units:=StoredUnits; end; end;--- Everything I say is a lie.
------
~小弟淺見,參考看看~ |
hagar
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
|
channel
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
引言: 小弟不會 QReport, 只是找到這麼一篇 剛在 google 搜尋時, 有提到說 report 內若有 qrimage 時 似乎會不 work? 另外, 底下也有一篇: http://groups.google.com.tw/groups?hl=zh-TW&lr=&ie=UTF-8&inlang=zh-TW&th=3293737e593a1cb0&rnum=29 --- Everything I say is a lie.hagar版主: 佩服…佩服…您找資料的工夫了得… 小弟就是想將報表用Mail的方式傳送,才會想將報表轉成圖檔或PDF… 轉成Bmp的檔案有點大,本來想繼續發問要如何轉成jpg(檔案比較小),沒有想到版主又幫小弟找到一篇了…真是太感謝您了…
------
~小弟淺見,參考看看~ |
channel
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
|
hagar
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
找到一篇(見 Girish Patil 的回答):
http://groups.google.com.tw/groups?hl=zh-TW&lr=&ie=UTF-8&inlang=zh-TW&th=93ada631d63769a&rnum=1
var AFilter: TPsQRPDFFilter; begin AFilter := TPsQRPDFFilter.Create('MyRep.pdf'); try QuickRep.Prepare; QuickRep.ExportToFilter(AFilter); finally QuickRep.QRPrinter.Free; QuickRep.QRPrinter := nil; AFilter.Free; end; end;其它相關 Tool 的連結: http://www.paperlessprinter.com/ http://www.leadtools.com/ http://www.wptools.de/ --- Everything I say is a lie. |
channel
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
引言: 找到一篇(見 Girish Patil 的回答): http://groups.google.com.tw/groups?hl=zh-TW&lr=&ie=UTF-8&inlang=zh-TW&th=93ada631d63769a&rnum=1再一次感謝hagar版主的回應… DownLoad TPsQRPDFFilter元件的連結不見了,小弟有找到一個http://www.torry.net/quickreport.htm (DownLoad:PsQRFilters v.2.11) hagar版主,可不可以再麻煩您一下,幫我找一下,可不可以不需透過別人寫的元件,用程式碼一行一行Code,因為使用別人的元件會有版本的問題,小弟目前也很積極的再找,希望hagar版主再幫一下…感激不盡… 小弟有找到一篇,看不太懂,煩有心人士幫我解釋一下…var AFilter: TPsQRPDFFilter; begin AFilter := TPsQRPDFFilter.Create('MyRep.pdf'); try QuickRep.Prepare; QuickRep.ExportToFilter(AFilter); finally QuickRep.QRPrinter.Free; QuickRep.QRPrinter := nil; AFilter.Free; end; end;其它相關 Tool 的連結: http://www.paperlessprinter.com/ http://www.leadtools.com/ http://www.wptools.de/ --- Everything I say is a lie. procedure TForm1.Button1Click(Sender: TObject); var AcroApp : Variant; PDDoc : Variant; InsertPDDoc : Variant; iNumberOfPagesToInsert: Integer; iLastPage : Integer; begin AcroApp := CreateOleObject('AcroExch.App'); PDDoc := CreateOleObject('AcroExch.PDDoc'); InsertPDDoc := CreateOleObject('AcroExch.PDDoc'); AcroApp.Hide; PDDoc.Open('c:\mainfile.pdf') ; InsertPDDoc.Open('c:\insertfile.pdf') ; iNumberOfPagesToInsert := InsertPDDoc.GetNumPages; showMessage (intToStr(iNumberOfPagesToInsert)); PDDoc.InsertPages(iLastPage, InsertPDDoc, 0, iNumberOfPagesToInsert, True); PDDoc.save(1,'c:\a.pdf'); AcroApp.CloseAllDocs; AcroApp.exit; end;
------
~小弟淺見,參考看看~ |
amide
一般會員 ![]() ![]() 發表:4 回覆:13 積分:13 註冊:2002-07-11 發送簡訊給我 |
|
crispin2k
初階會員 ![]() ![]() 發表:7 回覆:42 積分:33 註冊:2002-07-24 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |