Out of resources
I very often get Out of resources when using a RichText in my reports.
is it me that are doing something wrong or is this problem due to something
else.?
I usually get this problem if I step back one page in the preview.
What I do is something like this:
procedure TDllReportForm.ppRichText1Print(Sender: TObject);
var
p : pointer;
begin
if not ppDetailBand3.OverFlow then
begin
FDefaultFont.Name := 'Tahoma';
FDefaultFont.Size := 10;
if
BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[BlockItemArray[ppjitplBlockI
tem.RecordIndex-1]].Data <> nil then
begin
if TQuote(LocalTreeView.Items[0].Data).PreviewSettings.ArtNo then
ppRichText1.SelText:=
FormatArtNo(TBlockItem(BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[Block
ItemArray[ppjitplBlockItem.RecordIndex-1]].Data).ArtNo) + CRLF;
ppRichText1.SelText:=
TBlockItem(BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[BlockItemArray[pp
jitplBlockItem.RecordIndex-1]].Data).Descr
//ppRichText1.LoadFromRTFStream(RTFHelper.StrToStream(TBlockItem(BlockNode.I
tem[ppjitplBlock.RecordIndex-1].Item[BlockItemArray[ppjitplBlockItem.RecordI
ndex-1]].Data).descr));
end;
p :=
PChar(TBlockItem(BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[BlockItemAr
ray[ppjitplBlockItem.RecordIndex-1]].Data).descr);
if TRTFTag(P^)<>'{\rtf' then
begin //It's not an RTF stream
ppRichText1.SelectAll;
ppRichText1.SelAttributes.Assign(FDefaultFont);
end;
end;
is it me that are doing something wrong or is this problem due to something
else.?
I usually get this problem if I step back one page in the preview.
What I do is something like this:
procedure TDllReportForm.ppRichText1Print(Sender: TObject);
var
p : pointer;
begin
if not ppDetailBand3.OverFlow then
begin
FDefaultFont.Name := 'Tahoma';
FDefaultFont.Size := 10;
if
BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[BlockItemArray[ppjitplBlockI
tem.RecordIndex-1]].Data <> nil then
begin
if TQuote(LocalTreeView.Items[0].Data).PreviewSettings.ArtNo then
ppRichText1.SelText:=
FormatArtNo(TBlockItem(BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[Block
ItemArray[ppjitplBlockItem.RecordIndex-1]].Data).ArtNo) + CRLF;
ppRichText1.SelText:=
TBlockItem(BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[BlockItemArray[pp
jitplBlockItem.RecordIndex-1]].Data).Descr
//ppRichText1.LoadFromRTFStream(RTFHelper.StrToStream(TBlockItem(BlockNode.I
tem[ppjitplBlock.RecordIndex-1].Item[BlockItemArray[ppjitplBlockItem.RecordI
ndex-1]].Data).descr));
end;
p :=
PChar(TBlockItem(BlockNode.Item[ppjitplBlock.RecordIndex-1].Item[BlockItemAr
ray[ppjitplBlockItem.RecordIndex-1]].Data).descr);
if TRTFTag(P^)<>'{\rtf' then
begin //It's not an RTF stream
ppRichText1.SelectAll;
ppRichText1.SelAttributes.Assign(FDefaultFont);
end;
end;
This discussion has been closed.
Comments
It seams like this OutOf Resources comes when the RichText wraps to more
than One page.
if it fit on the page everything is ok.
BR
Magnus
transparent.
It is a known issue that some printers do not support transparent objects.
If the problem is only occuring when the ppRichText is transparent, this is
most likely the issue. For this specific printer, the transparency property
will need to be set to False.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The problem is when I try to make a preview. Are there any printer driver
used then?
BR
Magnus
Yes, the printer driver is used to render the report to the screen as well
as to the printer. If you would like, you can send us a small example
report that shows this behavior and we can test on our printers.
support@digital-metaphors.com.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com