?? faq.txt
字號:
1. BUGS.
1.1. FR does not prints correctly on my printer.
1.2. Can't set the user-defined paper size.
1.3. FR objects don't shift when I change the left margin.
1.4. Export filters (word, html, text) work ugly.
1.5. All captions and hints in the FR dialogs are wrong.
1.6. When installing FR, Delphi asks for some packages that I don't have.
1.7. FR Object Inspector disappeared, can't get it back.
1.8. The SUM function works incorrect.
1.9. Problems with Delphi's Translation Tool.
1.10. Access to the internal datasets from the script doesn't works.
1.11. The TOTALPAGES variable always returns 0.
1.12. Error when assigning a string value to the FR variable.
1.13. FR designer shows "Untitled" in the caption.
1.14. FR2.4 can't open the frf files created in the previous version.
1.15. Printout is little differs from the preview screen.
2. QUESTIONS.
2.1. How to make some report?
2.2. Can FR work with some library?
2.3. What is "script"?
2.4. How to show the Summary band at the bottom of the page?
2.5. How to print the group total in the group header?
2.6. I want to keep a group together.
2.7. I want to keep a MasterFooter together with MasterData.
2.8. How to change the TabOrder of the dialog controls?
2.9. How to change the language in the FR dialogs on-the-fly?
2.10. Can I run the FR designer as a MDI Child?
2.11. How to work with TfrUserDataset?
2.12. Can I print the A3 report on two A4 papers?
2.13. How to print on Dot Matrix Printers?
2.14. How to make particular object non-printable, but visible in the preview?
2.15. FR prints multi-page reports in the order 1,1,2,2. How to change it to 1,2,1,2?
2.16. Can I assign other paper bin for the first page of the report?
2.17. How to fax/email the prepared report?
2.18. How to change a query parameter from the script?
2.19. How to disable some report pages?
2.20. How to determine that report was builded succesfully?
2.21. How to hide some buttons in the designer?
2.22. How to use own function?
2.23. How to fill the data dictionary programmatically?
2.24. I don't want to show some datasets in the data dictionary and in the report.
2.25. How to pass a value to the report?
2.26. How to make the TChart with several series?
2.27. How to switch pages in the designer?
2.28. I want to show variables and data fields in one insert dialog.
2.29. How to hide "export options" dialog?
2.30. I store my reports in a BLOb. How to change the "Open/Save" dialogs in the designer?
2.31. How to access to the report object from Delphi?
2.32. How to define own hotkeys in the TfrPreview?
2.33. How to print a report without previewing it?
2.34. How to print a picture that stored in a file?
+=============================================================================+
| |
| BUGS |
| |
+=============================================================================+
1.1. FR does not prints correctly on my printer.
(variants: exception when selecting a printer; printer skips some pages;
some chars are turned on 90 degrees; the printout is messed up and etc.)
(problem is known with printers: Xerox, Canon and HP).
Try to uncomment the {$DEFINE PRN_RESET} line in the FR_Prntr.pas file,
recompile the FR package and your application. In most cases problem is gone.
If problem is still exists, try to install the newest printer driver or driver
from the similar printer model.
===============================================================================
1.2. Can't set the user-defined paper size.
(The dialog "Page options" in the designer, the paper width and height edit
boxes always disabled).
FR uses only papers supported by the printer driver. If the driver reports
that it can support the user paper (paper number 0x100h in the WinAPI), FR
allows these edit boxes when user selects the "user-defined paper".
Some drivers use another paper number for the user-defined paper - FR can't
works in such cases.
===============================================================================
1.3. FR objects don't shift when I change the left margin.
The left and right margins affects only to Cross-tab reports. But you can set
the BandAlign property of text objects to baLeft and that objects will slick
to the left margin automatically.
===============================================================================
1.4. Export filters (word, html, text) work ugly.
(text is shifted, empty lines and so on)
What you want? :) FR coordinates measured in the pixels; MSWord, html, txt has
line-oriented data representation. When exporting to such formats, FR
inevitably distorts the layout. Try to play with X and Y factors in the export
options.
(some objects are not exported, for example, Rich)
Try other export filter (for example, one from the powerpack). There are also
commercial export filters from the Pragnaan Software (link is in my site).
===============================================================================
1.5. All captions and hints in the FR dialogs are wrong.
a) wrong language resources are installed. To install correct resources, go
FR\RES\your_resource and run the mk.bat file. Rebuild the FR package and your
application.
b) resources conflicts with other third-party library. FR uses the range
53000..59000. Change the frRes constant in the file FR_Const.pas and
recompile the FR.
===============================================================================
1.6. When installing FR, Delphi asks for some packages that I don't have.
(for example, Delphi wants IBO40CRT, TEE45, RXCTL6, mwEdit_D6 and so on)
The file FRx.dpk (x - Delphi version) referenced such packages. But references
are in {$IFDEF} directives. Reference is used if you uncommented appropriate
line in the FR.inc file.
When installing FR, Delphi may asks you to save changes in the .dpk file. If
you say "Yes", Delphi removes all {$IFDEF} directives and you'll get such error.
Get an original dpk file, install FR again and don't save changes in this file.
===============================================================================
1.7. FR Object Inspector disappeared, can't get it back.
ATTENTION! You may corrupt the Windows if you don't have an experience!
Run the Windows registry editor (regedit.exe), open the key
HKEY_CURRENT_USER\Software\FastReport\name_of_your_project\Form\TfrInspForm
and check and correct if need the XPosition, YPosition, Width, Height values.
===============================================================================
1.8. The SUM function works incorrect.
(in the report with two masterdata bands can't get sum the second band)
FR can't determine which band to sum. Use the extended SUM syntax (also for MIN,
MAX, AVG):
SUM([CustNo], MasterData2)
===============================================================================
1.9. Problems with Delphi's Translation Tool.
(error "Resource TfrProgressForm not found" when running a project that
uses FR)
Include all FR files in the uses list. Or compile your project with run-time
packages.
===============================================================================
1.10. Access to the internal datasets from the script doesn't works.
(I write: frDialogForm.Query1.Open)
Write without "frDialogForm":
Query1.Open
===============================================================================
1.11. The TOTALPAGES variable always returns 0.
The report must be two-pass (go File|Report options in the designer).
===============================================================================
1.12. Error when assigning a string value to the FR variable.
(code like frReport1.Dictionary.Variables['Range'] := '10..50')
FR trying to calc such string values. Add quotes:
frReport1.Dictionary.Variables['Range'] := '''' + '10..50' + '''';
or use frVariables for static data.
===============================================================================
1.13. FR designer shows "Untitled" in the caption.
(I store the report in the BLOb. When I load the report and run the designer,
it shows "Untitled" in the caption)
Before run the designer, do this:
frReport1.FileName := 'MyReport';
===============================================================================
1.14. FR2.4 can't open the frf files created in the previous version.
(FreeReport .frf files can't be opened with FR2.4)
Change the first byte in the report file to 16h and do the following
modifications in source code. After these modifications, load the report and
save it. Finally, return back the original code.
FR_Class:
function ReadString(Stream: TStream): String;
begin
{ if frVersion >= 23 then}
Result := frReadString(Stream) {else
Result := frReadString22(Stream);}
end;
procedure ReadMemo(Stream: TStream; Memo: TStrings);
begin
{ if frVersion >= 23 then}
frReadMemo(Stream, Memo){ else
frReadMemo22(Stream, Memo);}
end;
FR_Utils:
procedure frReadMemo(Stream: TStream; l: TStrings);
var
s: String;
b: Byte;
n: Word;
begin
l.Clear;
l.Text := frReadString(Stream); exit;
Stream.Read(n, 2);
if n > 0 then
repeat
Stream.Read(n, 2);
SetLength(s, n);
Stream.Read(s[1], n);
l.Add(s);
Stream.Read(b, 1);
until b = 0
else
Stream.Read(b, 1);
end;
function frReadString(Stream: TStream): String;
var
s: String;
n: Integer;
b: Byte;
begin
Stream.Read(n, 4);
SetLength(s, n);
Stream.Read(s[1], n);
if (n > 0) and (s[n] = #$0A) then
SetLength(s, n - 2);
// Stream.Read(b, 1);
Result := s;
end;
===============================================================================
1.15. Printout is little differs from the preview screen.
FR2.4 has not full WYSIWYG. Wait for FR3.0.
+=============================================================================+
| |
| QUESTIONS |
| |
+=============================================================================+
2.1. How to make some report?
Better ask this in the FR mailing list (forum). With FR you can build almost
all types of reports, but you must read the documentation first.
===============================================================================
2.2. Can FR work with some library?
FR works with all DB access components that are based on TDataSet. Besides,
FR can works with IB_Objects, that is incompatible with TDataSet.
===============================================================================
2.3. What is "script"?
This is a piece of code written in the Pascal-like language. FR can run such
code - it gives you ability to change the report's behavior during the
building process. See the documentation for details.
(does a band have a script?)
Yes, it does - select the band and select "OnBeforePrint" property in the
FR Object Inspector (or press Ctrl+Enter).
(does a page have a script?)
Yes, it does. Click on empty space of the page and select "OnBeforePrint"
(OnActivate if the page is the dialog form) property in the FR Object Inspector.
(can I access objects from the script?)
Yes, you can - use full name of the object:
Memo1.Font.Name
(what properties can be accessed?)
Complete list of properties is in the documentation.
(I have two objects on a band, which script will run first?)
Object that you've created first will run first (that called Z-Order).
Preferred way is to write a script in the band.
===============================================================================
2.4. How to show the Summary band at the bottom of the page?
Look at the "Summary at the bottom" report in the demo FR\DEMOS\REPORTS
===============================================================================
2.5. How to print the group total in the group header?
Look at the "Group totals in header" report in the demo FR\DEMOS\REPORTS
===============================================================================
2.6. I want to keep a group together.
Look at the "Keep group together" report in the demo FR\DEMOS\REPORTS
===============================================================================
2.7. I want to keep a MasterFooter together with MasterData.
Write this in the MasterData script:
begin
if FreeSpace < MasterFooter1.Height then
NewPage;
end
===============================================================================
2.8. How to change the TabOrder of the dialog controls?
a) use Bring to front/Send to back toolbar buttons.
b) install the TabOrder wizard from the powerpack.
===============================================================================
2.9. How to change the language in the FR dialogs on-the-fly?
a) use resources in a DLL. Compile the resource DLL (run mkdll.bat file from
the FR\RES\your_resource folder) and write in your program:
frLocale.LoadDll('FR_ENGL.DLL');
If you want to use default resources, write:
frLocale.UnloadDll;
b) resources in the text file or ini file or in other form. Use the event
frLocale.OnLocalize. It puts StringID and gets ResultString. For example:
frLocale.OnLocalize := MyClass.OnLocalize;
procedure TMyClass.OnLocalize(StringID: Integer; var ResultString: String);
begin
if StringID = 53000 then
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -