Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Problem setting TppDBText.DisplayFormat at runtime

edited June 2002 in General
Hi,

The following code always executes correctly the first time a report is
generated, and executes successfully for multiple fields in the report. It
also executes correctly on subsequent report generations, if none of the
fields have changed. But sometimes on subsequent generations, it gets an
Access Violation when it assigns the DisplayFormat property of the TppDBText
object.

I've used the debugger to check the value that's passed in, and it's the
same value when an AV is generated, and when it's not.

So the problem has to do with the SetDisplayFormat method. Our app is
modifying report properties at runtime, and we're doing something to leave
the report in an incoherent state. Some assumption that SetDisplayFormat
makes is not being satisfied.

I guess I could compile RBuilder with debug on to see what's going on, but I
was hoping not to have to do that. Is there some kind of Clear() method we
should be calling for the report band, to put it back in the state it was
before we added components to it the first time?

Thanks.

Mike Carroll
Sigma Data Systems, Inc.
=========================
lDBText := TppDBText.Create(Self);
lDBText.Band := ColumnReport.DetailBand;
lDBText.DataPipeline := ppDBPipeLine1;
lDBText.DataField := lFieldName;
if lField.DataType = ftString then
begin
lDebug := Replicate( 'c', lDisplayWidthField.Value);
lDBText.DisplayFormat := lDebug;
end;

Comments

This discussion has been closed.