Delphi Problems Solved on Rave Reports (ZZ)

xiaoxiao2021-03-06  54

I solved more problems on the Delphi section Rave report, and found that there is a lot of similarity (I have submitted a few FAQ, but I don't know when to review it), so I will first sort out my own point. Experience, I hope to bring you a little help, if you feel that there is nothing to see. :) The following program is debugged in XP D6 RAVE5.1, Question 1: Dynamic Settings Reports Uses rvclass, RVProj, RVCsStd; var MyPage: TRavePage; MyText: TRaveText; begin RaveProject1.Open; With RaveProject1.ProjMan do begin MyPage: = FindRaveComponent ( 'Report1.Page1', nil) as TRavePage; // Find PAGE MyText: = FindRaveComponent ( ' Text1 ', mypage) as travelText; // Find text mytext.text: =' Boland Delphi '; // Settings the text content mytext.color: = CLGreen; // Set color end; {with} raveProject1.executereport (' Report1 '); RaveProject1.Close; end;

Question 2: Save the report as HTML or PDF format (Chinese does not support Chinese) rvproject1.projectfile: = 'E: /DELPHI/RAVE / FILES/test.rav'; rvproject1. open; rvproject1.selectreport ('Report1', true); RvSystem1.DoNativeOutput // report you want to print: = false; RvSystem1.DefaultDest: = rdFile; // save to a file RvSystem1.RenderObject: = RvRenderHTML1; // save to HTML format or RPRenderPDF1; RvSystem1.OutputFileName: = 'files / test.html'; // Store RVSystem1.SystemSetups: = rvsystem1.systemSetups- [SSALLLOWSETUP]; TRY RVPROJECT1.EXECUTE; Except ShowMessage ('Generate Report File Errors!'); END; For only one page report That is no problem, but for multiple pages in D6 and D7 vary. D6 can generate a lot of pages, but D7 is not, I don't know why? The RAVE version under D6 is 5.1, Question 3: Intraweb and Rave Seamless connection to my ideas is to save the report into html or PDF format, then call const aipoptions: string = 'Toolbar = y, status = no, menubar = yes, scrollbars = yes, resizable = yes, location = no, directories = no, width = 1000, height = 700 '; var aipurl: string; rvproject1.Open; rvproject1.SelectReport (' report1 ', true); RvSystem1.DoNativeOutput // report you want to print: = false; RvSystem1 .DefaultDest: = rdfile; // Save into file RVSystem m1.RenderObject: = RvRenderHTML1; // save to HTML RvSystem1.OutputFileName: = 'files / test.html'; // the path for RvSystem1.SystemSetups: = RvSystem1.SystemSetups- [ssAllowSetup]; try rvproject1.Execute; / / Generate Reports Aipurl: = WebApplication.urbase '/ Files /' 'Test.html'; // IE Opens the first page Report AddToinitProc ('NewWindow ("' aipurl ", "Agenda", "' AiPOptions '");'); Except WebApplication.showMessage ('Generate Report File Errors!');

Question 4: Let the end user dynamically modify the report format. With rvproject1 do beg, dllfile: = 'd: /rave5/redist/ravesolo.dll'; // If this file does not specify this file, the error is reported when running the error ProjectFile: = 'E : /Delphi/rave/files/test.rav '; // Specify RAV file loadDesigner: = true; if design1 begin if Messagedlg (TRANS (' SAVE CHANGES TO PROJECT ') PROJECTFILE '? ', MTConfirmation, [Mbyes , MBNO, Mbcancel], 0) = mryes the beginning; {if} end; {if} end; {with} This program is powered by D6 RAVE5.1. Using RAVE under D7 .dll

Issue 5: design a program to dynamically add a report TEXT uses RVClass, RVProj, RVCsStd, RvCsRpt; var MyBand: TRaveBand; MyRegion: TRaveRegion; MyPage: TRavePage; MyText, mytext1: TRaveText; begin RvProject1.Open; With RvProject1.ProjMan do begin MyPage: = FindRaveComponent ( 'Report1.Page1', nil) as TRavePage; myRegion: = FindRaveComponent ( 'Region1', MyPage) as TRaveRegion; MyBand: = FindRaveComponent ( 'Band1', myRegion) as TRaveBand; MyText: = TRaveText .Create (myband); mytext.parent: = mypage; mytext.name:=Getuniquename('Text125' ,mypage, false; mytext.top:=0.2; mytext.wid: = 0.7; MyText.width: = 200; Mytext.height: = 200; mytext.text: = 'delphi'; mytext.font.size: = 20; // Setting the font attribute mytext.font.color: = CLRED; mytext.font.name: = '书' Addcomponent; end; {with} rvproject1.executereport ('report1'); rvproject1.close; problem 6: Insert a DATATEXT control while inserting a date or page number in the report, its DATAF IELD attribute has related settings in Report Variables, there is a currentpage current page, Totalpages Total page, Dateshort Pow, Datelong Long Date, Timelong Long Time Question 7: Parameters Values ​​to Reports, and Question 1 It is a bit the same with RaveProject1 Do Begin Open SetParam ('paramname', 'paramvalue'); ExecuteReport ('report1'); close; end; {with} Question 8: Remove the Output Options dialog box when printing previews The SSALLOWSTUP in Rvsystem.SystemSetup is set to False Problems 9 : NDR format is transformed into pdf var ndrstream: tmemorystream; begin ndrstream: = tmemorystream.create; try ndrstream.loadfromfile ('files / test.ndr');

RvRenderPDF1.PrintRender (NDRStream, 'files / test.pdf'); finally NDRStream.Free; end; {tryf} ShowMessage ( 'NDR Converted'); end; Question 10: display columns (snaking columns) name1 name6 name2 name7 name3 name8 name4 name5 form, add the following controls Rvsystem1, table1, DataSource1 procedure TForm1.Button1Click (Sender: TObject); begin ReportSystem1.Execute; end; procedure TForm1.ReportSystem1Print (Sender: TObject); begin With (Sender as TBaseReport), table1 do BeGin SetFont ('Times New Roman', 20); bold: = true; underline: = true; home; printCenter ('name listing "; section / 2.0); sectionTop: = 1.0; marginbottom: = 0.75; Home; While NOT Table1.EOF do begin SetColumns (2,0.5); {OnNewColumn will be called after each call to SetColumns and on each new column after that} While (ColumnLinesLeft> 0) aND (NOT Table1.EOF) do begin If FieldByName ( 'NAME ') .Sstring <>' 'THEN BE Gin Println ('Name'). Asstring; end; {if} Table1.next; end; {while} if not table1.eof dam newpage; end; {if} end; {while} end; {while} } end; procedure TForm1.ReportSystem1BeforePrint (Sender: TObject); begin Table1.First; end; procedure TForm1.ReportSystem1NewColumn (Sender: TObject); begin With Sender as TBaseReport do begin SetFont ( 'Times New Roman', 14); Bold: = True; underline: = true; adjustline; println; setfont ('arial', 12); adjustline; end; {with} end;

procedure TForm1.ReportSystem1PrintFooter (Sender: TObject); begin With Sender as TBaseReport do begin MarginBottom: = 0.5; PrintFooter ( 'Page' Macro (midCurrentPage) 'of' Macro (midTotalPages), pjCenter); MarginBottom: = 0.75; End; {with} end; problem 11: Print Table directly into the text directly into the form in the form, add, TextFiler, button; projectfiler1.FileName, TEXTFILER, Button; Proceder: TOBJECT); Begin TextFiler1.FileName : = 'e: /rave/program/txtprint/tmp.txt'; TextFiler1.Execute; end; procedure TForm1.TextFiler1Print (Sender: TObject); var DoHeader: boolean; begin With Sender as TBaseReport, Table1 do begin ClearTabs; SetTab (0.5, PJLEFT, 3.0, 0, BoxLinenone, 0); Settab (Na, Pjleft, 3.0, 0, Boxlinenone, 0); Settab (Na, Pjleft, 1.5, 0, Boxlinenone, 0); First; doHeader: = true While NOT EOF Do Begin if LineSleft <= 0 THEN BEGIN NewPage; DoHeader: = true; end; {i} if doheader the begin printcen Ter ('Customer Listing', PageWidth / 2.0); NewLine; NewLine; PrintTab ('Name'); PrintTab ('SEX'); PRINTTAB ('Age'); NewLine; DoHeader: = False; End; {if} PrintTab (FieldByname ('Name'); PrintTab (FieldByName ('SEX'); asstring); PrintTab (FieldByName); newline; next; end; {while} end; {with} end; { Question 12: Designing the Rave Report File How to pack to the exe file There is a Storera in the attribute of RVProject, you only need load .rav file

Question 13: Formatting strings How to format the fields removed from the data source such as Price in Table 12345.25 Now to display Data View Dictionary-> DataView1-> DataViewPrice when designing DISPLAYFORMAT is $ #, . ####, ### 0000; Q14: often USES unit to RvCsStd: TRaveText, TRaveMemo, TRaveSection, TRaveSection, TRaveMetaFile, TRaveFontMaster, TRavePageNumInit RvClass: TRaveComponent, TRaveControl, TRaveContainerControl, TRaveContainerComponent, TRaveProjectItem, TRavePage RvCsData: TRaveDataText, TRaveDataMemo, TRaveCalcText, TRaveDataMirrorSection, TRaveDataCycle, TRaveCalcOp, TRaveCalcTotal, TRaveCalcController RvCsBars: TRavePostNetBarCode, TRaveI2of5BarCode, TRaveCode39BarCode, TRaveCode128BarCode, TRaveUPCBarCode, TRaveEANBarCode

RvCsDraw: TRaveLine, TRaveHLine, TRaveVLine, TRaveRectangle, TRaveSquare, TRaveEllipse, TRaveCircle RvDataField: TRaveStringField, TRaveIntegerField, TRaveBooleanField, TRaveFloatField, TRaveCurrencyField, TRaveBCDField, TRaveDateField, TRaveTimeField, TRaveDateTimeField, TRaveBlobField, TRaveMemoField, TRaveGraphicField, TRaveInt64Field RvDatabase: TRaveDatabase

RVDIRECTDATAVIEW: TRAVEDATAVIEW TRAVEDRIVERDATAVIEW RVPROJ: TRAVEPORT, TRAVEPROJECTMANAGER

Rvsecurity: TraveSimpleSecurity, TravelookupSecurity, TRAVSECURITYCURITY

RVCSRPT: TraveRegion, Traveband, TraveDataBand, TraveIteband, TraveBandStyle, Travedatacycle, Some Information from RAVE Developer Guide Ravedevguide5 News Group News.nevrona.com Rave Official Home www.nevrona.com/rave

Question 16: Print JPEG 1: Add JPEG Controls on Rave Bitmaps, Not Jpegs. You'll Need The Jpegadd-On That's Available from The Nevrona Web Site, http://www.nevrona.com/ Rave / addons.shtml.

Installation Instructions for Travejpegimage ------------------------------------------ 1: Extract The Files in This Archive In Your Rave Main Directory (Normal D: / Rave5). Make SURE TOEX DIRECTORYES SO That The SourceWill Be Placed in It's Own Directory.

2: Copy The Ndcsjpeg.Pas File Into The Appropriate Directory for The Versionof Delphi or C Builder That You Are Using (For Delphi 6.0 It Would Normal BE D: / RAVE5 / D6).

3: Start Rave, Go to the Preferences Dialog (Edit | Preferences), Select Thepackages Tab Andd The D: /RAVE5/nd_jpeg.bpl package file to the list ofinstalled package and click OK.

Method, the program is controlled, specifically refer to //www.nevrona.com/rave/tips/rvtip31.html

转载请注明原文地址:https://www.9cbs.com/read-115506.html

New Post(0)