发信人: wpf (Itouchthebluesky), 信区: BorlandDev
标 题: quickreport q/a 6
发信站: 哈工大紫丁香 (2001年06月09日20:10:22 星期六), 站内信件
. Every time I preview a report with my custom preview, I lose some memory.
A. You will want to check your preview's FormClose event. If you are using
code from Quick Report 2, that code may not work correctly. You may want t
o compare your close event code with the code used by the standard preview.
------------------
Q. I can't find the qrbonus unit.
A. The classes that were the qrbonus unit are now in the qrextra unit.
------------------
Q. I have a report with some controls on a TQRBand and the preview is empty
.
A. You must have a detail band, this is required for Quick Report 3. Using
reports without detail bands was an undocumented feature of Quick Report 2
and was never supported.
------------------
Q. (Delphi 3) I am getting an error when I compile with runtime packages en
abled. With out runtime packages, it works fine.
A. The package list will not get updated automatic when you install QR3 ove
r QR2 and you may have the QR2 runtime package (qrpt30.dpl) on the list inst
ead of the Quick Report 3 runtime package (qrpt43.dpl)
------------------
Q. I have a report that does not print the DetailBand (DetailBand1BeforePri
nt() sets PrintBand to False). With version 2 of QuickReport, SUM() express
ions in groups incremented their values whether or not the detail band print
ed. In version 3.0.4, it appears that the SUM() expression only increments
if the detail band prints. What can I do to change this behavior back to ho
w version to handled this?
A. This was actually a change that had been requested by other users. Ther
e is a simple work around that you can use in the BeforePrint event. Instea
d of setting PrintBand to False, set the band height to 0. If you need to r
estore the height, set the tag property of the band to the height and restor
e the height from the tag in the band's AfterPrint event. The report will s
till think that it printed the band, but the size will be 0 so you will not
see the band and your sum will include the data from the hidden records.
------------------
Q. My users can not see the buttons on the preview's toolbar.
A. What version of comctl32.dll is on your system? The preview uses a TToo
lbar control and that control will not display glyphs from an imagelist when
the destination computer has an older version of this dll. It was compile
d for version 4.72. You have a couple of options. You can get the free upd
ate from MS for the current comctl32.dll, or you can recompile the QR packag
e against the old version of comctl32.dll (not recommended), modify the stan
dard preview in the qrprev unit so that it does not use TToolbar, or you cou
ld use a custom preview that does not use a TToolbar control. We have Custo
m Preview examples on our download page and with QR3, you can change the pre
view on a global basis. There is an MDI demo example on our download page t
hat shows how to do this.
Delphi 4 requires (and installs version 4.72) You can download the file dir
ectly from Microsoft at the URL http://msdn.microsoft.com/developer/download
s/files/40comupd.htm. It has been reported that this link is no longer vali
d, an alternative would be ftp://ftp.microsoft.com/softlib/mslfiles/40comupd
.exe
------------------
Q. With QuickReport 2, I could set OnGenerateToPrinter to nil to keep the r
eport from being regenerated. How do I do this in Quick Report 3?
A. The OnGenerateToPrinter property is a QR2 only property, it doesn't exis
t in QR3. There are a couple of ways to do this in QR3. You can set the re
port.qrprinter.master property to nil in the BeforePrint event of the summar
y band. If you don't need a summary band, you can set PrintBand to false in
that event. You could also use a custom preview and change the print butto
n to call the preview's qrprinter.save to a temporary file and then qrprinte
r.load. You would then call the qrprinter.print method to print the loaded
report.
------------------
Q. I think I have installed version QuickReport 3 correctly with Delphi 3,
and it prints short reports if I call the PRINT command. If I use preview ho
wever, I receive a "Control has no parent window error" when I press the pri
nt button. I didn't have this problem with Version 2.0K.
A. The DLL needs a reference to the calling application so that the DLL's f
orms are children of the application. Please see the Delphi help page for T
Application.Handle.
------------------
Q. I am trying to compile a report from QuickReport 2 and I get the message
"Undeclared identifier TQRDetailLink."
A. The TQRDetailLink class was a QuickReport 1 object. QuickReport 2 had p
artial support for this control and it was treated as an alias to the TQRSub
Detail control. QuickReport 3 does not have any support for reports that we
re ported from QuickReport 1. If you replace the TQRDetailLink controls wit
h TQRSubDetail controls, your report should run like it did under QR2. The
TQRDBCalc control from QR1 will also produce the same error. This was repla
ced with the TQRExpr control.
------------------
Q. I am creating an end user report generator and use the TQRDesigner to en
able objects edit and selection functions, but I couldn't find it in the new
version.
A. The TQRDesigner is no longer part of the package, we use the Delphi form
designer to edit the report.
------------------
Q. I just installed Quickreport 3.03 Pro for Delphi 3 Client/Server and rec
ompiled (Build All) a project that worked fine with QR 2.0j. In order to ge
t it to compile, I had to remove unit QRHTML from all uses clauses because I
got a fatal compile error that QRHTML was compiled with under different ver
sion
A. The qrhtml unit is a QuickReport 2 only unit, it is not part of the QR3
file set, you can remove all of the references to it. If you may many repor
ts that use the unit, it would save time to create a stub unit named qrhtml
that didn't have anything in it. When you get that error message with Quick
Report 3, it usually means that the compiler is finding QuickReport 2 files.
------------------
Q. I have some variables defined in the report's functions property and I c
an't initialize them in the report's BeforePrint event.
A. The report's BeforePrint event is called before the elements in the repo
rt's functions property have been initialized. One way to initialize the fu
nction variables in code would be to use the BeforePrint event of the TitleB
and. If your report does not require a title band, set PrintBand to false i
n that event.
Example of setting an integer value at the start of the report:
procedure TfrmExpr.TitleBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
var
aQREvElement: TQREvElement;
begin
with QuickRep1.Functions do
begin
aQREvElement := GetConstant('test');
if (aQREvElement <> nil) and (aQREvElement.Value(nil).Kind = resInt) the
n
begin
SetIntegerConstant(aQREvElement, 10);
end;
end;
end;
------------------
Q. I get the error message "Undeclared identifier; 'TQREvaluator'" when I c
ompile a report that worked with QuickReport 2
A. We moved the expression classes to a new unit, qrexpr. If you add this
unit to your uses section, the report will compile again.
------------------
Q. I have a simple project which has a quick report, no bands, just a few l
abels, memo boxes, and pictures. It worked prior to my upgrade to a purchas
ed version. Now if I do a Preview, the screen is blank, no data, as well as
if I do a print, nothing happens.
A. QuickReport was designed to work with bands. Placing controls directly
on the band was a non-supported feature of the previous version. Try addin
g a detail band (set it's height to 1) and then set the report's PrintIfEmpt
y property to true. Your report should now work as it did with QuickReport
2.
------------------
Q. Delphi4 doesn't find the class "TQREvElementFunction" and my project wil
l not compile.
A. Make sure the qrexpr unit is in the uses clause, that is where the TQREv
Element structures are defined.
------------------
Q. The following code does not compile after upgrading: ReportForm.ExportTo
Filter(TQRHTMLExportFilter.Create(AttachmentFile));
A. The naming was changed. The following code will work: ReportForm.Export
ToFilter(TQRHTMLDocumentFilter.Create('c:\report.htm'));
------------------
Q. Can we use some TQRGroup with a TQuickAbstractRep control ?
A. Not really, the TQuickAbstractRep does not have a DataSet property or On
NeedData event. The mechanism for checking the group expression does not ex
ist and the band would be printed only once.
------------------
Q. Where are the documentation, help files, examples, QREditor, etc?
A. QuickReport 3 is still being finished up and the documentation and help
files are still being updated. We will release them, but our efforts are fo
cused on finishing up the package. The QREditor control will be in the rele
ase version of QuickReport 3 Pro.
------------------
Q. What is the TQuickAbstractRep control?
A. This is a descendant of the TCustomQuickRep base class that does not use
the TDataset. If your application does not use the BDe, this will shrink t
he code size.
------------------
Q. Why do report event use TCustomQuickRep instead of TQuickRep?
A. This is the base class that TQuickRep is descended from. This change ma
kes it easier to do variations QuickReport objects
------------------
Q. What happened to OnGenerateToPrinter?
A. This feature has not been finished yet and has been disabled until it ha
s been fixed.
------------------
Q. Are there any plans to continue support of QR1 in Delphi 4 like was done
in Delphi 3 with QR 1.1b?
A. This fileset is available from our sales department upon request.
------------------
Q. What is the TQRLoopBand control?
A. This is a band that is not connected to any dataset and will print for t
he number of times that it's PrintCount property is set to.
------------------
Q. What is the TQRStringsBand control?
A. This is a band with a items property that is a built in stringlist. It'
s name will appear in the expression builder and can be assigned to a TQRExp
r control. At runtime, this band will print for each line in the items prop
erty.
------------------
Q. How do you use the export filter controls?
A. Just drop them on a form in your project and they will show in the previ
ews.
------------------
Q. What is the new 'LinkBand' property?
A. This works like the LinkBand property in QuickReport 1. The Band compon
ents have a LinkBand property which is used to make several bands stick toge
ther. The LinkBand property can be set connected to another Band and QuickRe
port will then make a page break if there is not enough space left on the pa
ge for both bands. The second band can in turn be linked to a third band, an
d so on. It will not keep a series of bands together, like a group of detai
l bands. We have a demo project for QuickReport 3, QR3LSD4.ZIP, that shows
how to "link" a set of bands.
------------------
Q. How can I display a text file with QR3?
A. Qr3 has some new functions to make this an easy task.
#1 Create a report using the TQuickAbstractRep control instead of using the
TQuickRep control. The TQuickAbstractRep control does not use any data ware
controls and can shrink the size of your executable if you are not using an
y data ware controls in your application. You can use the TQuickRep control
, you just don't need to use it.
#2 Add a TQRStringsBand to the report. This is a band with a items property
that is a built in stringlist.
#3 Add a TQRExpr control to the band. Set the following properties
Autosize - False
AutoStretch - True
Expression - to the name of the band (like 'QRStringsBand1')
Width - to the width of the band (can be done at runtime)
#4 Before calling Print or Preview, load the text file into the items proper
ty of the TQRStringsBand like this:
QRStringsBand1.Items.LoadFromFile(SomeFileName)
#5 Call the preview or print methods.
------------------
[RichEdit controls]
==================
Q. How can I copy the text from a TRichEdit component to the QuickReport Ri
chText component?
A. You would use the lines property to copy the data. Example: QRRichText1
.Lines := frm.RichEdit1.Lines;
------------------
Q. I get an access violation when I have QRDBRichText on a subquery
A. This is a recently discovered problem that happens with TQuery's that do
not have persistent fields. Adding persistent fields will fix this. If yo
u can not do this, insert a line into the TQRDBRichText.Print method in qrct
rls.pas like the following example using the 2.0k beta code:
procedure TQRDBRichText.Print(OfsX, OfsY : integer);
begin
?Field := FDataSet.FindField(FDataField);?{ Add this line }
?if assigned(Field) then
??if (Field is TMemoField) or
??? (Field is TBlobField) then
???Lines.Assign(Field);
?inherited Print(OfsX,OfsY);
end;
------------------
Q. My RTF field will not span more than one page
A. There are some serious bugs in Microsoft's implementation of their RichT
ext common control. We are implementing work arounds to resolve as many of
these issues as we can. At this time we are still working on RTF fields tha
t span more than one page.
------------------
Q. My RTF field doesn't consistently print out the last line in the memo.
A. This is known problem with the MS RichText common control. There are tw
o works arounds. One is to add an extra blank line to the text, the other i
s to set the OnGenerateToPrint event of the report's qrprinter object to nil
. This will force the report to not render the report a second time.
Example:
procedure Tfrmqr.QuickRep1BeforePrint(Sender: TQuickRep; var PrintReport: bo
olean);
begin
QuickRep1.qrprinter.OnGenerateToPrinter := nil;
end;
------------------
Q. Can I print a richtext object that is in a field of a file with ole2 bmp
object inserted in it?
Q. My QRRichText control is ignoring the "\page" page break command.
A. I'm sorry, but the TRichEdit control that the QRRichText and QRDBRichtex
t controls link to is limited to text only and it does not appear to support
this feature. Our controls are limited to the functionality of Borland's R
ichEdit control, which is a wrapper for Microsoft's RTF control. The MS R
TF common control only supports a subset of the RTF control codes. To see w
hat sequences are supported, load your RTF text into WordPad. WordPad uses
the same common control and if it doesn't support an RTF control sequence, t
hen it wont work on Delphi.
------------------
Q. My QRDBRichText control is not resizing correctly.
A. If the design time height of a QRDBRichText control is greater than some
of the fields, it may not resize correctly. If you set the height to a sma
ll value like 10 and set autostretch to true, it should work.
------------------
Q. My QRRichText/QRDBRichText will not display or print embedded bitmaps.
A. The TRichEdit and TDBRichEdit controls do not support embedded objects a
nd since our RTF controls use the Borland RTF controls, we have the same lim
itation.
------------------
[Saved Reports (*.QRP)]
==================
Q. I am using the QRPrinter object and I can't get it to save to a text fil
e.
A. Saving as text uses the ASCII export filter and the export filters only
work with reports. When you use the qrprinter object directly, the only sav
e option is the default .QRP save.
------------------
Q. If I save a report with the Report's Options.Compression property set to
true, I can't load the saved the report back into the preview.
A. This is a bug in the TMetaFile component introduced with Delphi 3.02. T
his should be addressed in the next Delp
--
据说呆娃儿不笨
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.245.166]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:206.743毫秒