Cant print 2 different Tpprichtext w/mailmerge
Hi:
im using D7 with Rbuilber 10.06
im trying to print two different tpprichtext with mailmerge active, the
trick is that report has to print one or another depending of the value of a
field, im using the following code:
procedure TFcartas.ppDetailBand6BeforeGenerate(Sender: TObject);
begin
ppRichText2.visible := (VrecordatoriosIDIOMA.asstring = 'I');
ppRichText1.visible := (VrecordatoriosIDIOMA.asstring <> 'I');
end;
but it seems that only the first one that is used by the program is the only
one printed, the other one is never printed, it shows only a blank space
where the text should be.
What im doing wrong?
TIA
im using D7 with Rbuilber 10.06
im trying to print two different tpprichtext with mailmerge active, the
trick is that report has to print one or another depending of the value of a
field, im using the following code:
procedure TFcartas.ppDetailBand6BeforeGenerate(Sender: TObject);
begin
ppRichText2.visible := (VrecordatoriosIDIOMA.asstring = 'I');
ppRichText1.visible := (VrecordatoriosIDIOMA.asstring <> 'I');
end;
but it seems that only the first one that is used by the program is the only
one printed, the other one is never printed, it shows only a blank space
where the text should be.
What im doing wrong?
TIA
This discussion has been closed.
Comments
Hard to say.
Did you try the OnBeforePrint event?
Also, try the following code:
ppRichText2.visible := True;
ppRichText1.visible := not ppRichText2.visible;
Does it work correctly? And how about the following:
ppRichText2.visible := false;
ppRichText1.visible := not ppRichText2.visible;
Does that print correctly?
Ed Dressel
Team DM
sign your posts and change the settings of your new reader.
I'm not understanding. Is there a condition when both might be printed?
(Your code is either one or the other).
out of the office tomorrow).
Ed Dressel
Team DM
that report, it uses a mysql database with a very complex query.
I have more information that maybe gives you an idea about how to help me to
solve my problem...
1.- I recall the reporte was working fine until i installed Teechart
components.
2.- If i modify the query to get only records that match
VrecordatoriosIDIOMA.asstring='I' and execute the report the corresponding
ppRichtext prints ok; if i close the application and open it again and try
with records (VrecordatoriosIDIOMA.asstring<>'I') the other ppRichtext
prints ok too, but if i try to do it without closing the application, only
prints the ppRichtext that correspond with the first record readed.
Because im desperate, im trying another workaround, im trying with only one
ppRichtext and filling it with the appropiate text, but it seems ppRichtext
does not support UFT8 character set, i cant print Ñs or hyppen letters (my
text is in spanish), instead of that i got funny characters.
Any Ideas?
Willo Berguer
You could dump the data to a TClientDataSet. Or you could use the DBDemos
data.
That would not affect RichText.
Try calling Report.Reset prior to calling Report.Print
TppRichText is a wrapper for the Delphi TRichEdit component, which is a
wrapper for the Windows RichEd dll. I recommend using an RTF editor to edit
the RTF data. If you read the RTF specification you will find that RTF data
is always saved as Ansi, though it can contain Unicoded encoded data. This
is done by escaping the Unicode code characters, something like
\U+CodePoint.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
is using customer table at DBDemos
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
attachment.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
I will post a follow up here.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
RB 11 trial version from our web site and perform the same test.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
it works on RB 11
but also WAS working on RB 9 and RB 10, thats the weird thing in this.
Upgrading is not possible now, we'll try to find a workaround. Thanks anyway
for you time.
info, send your serial number and registration details to
info@digital-metaphors.com. Please do not use gmail or other free email
accounts.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com