dbTexts side by side
Hi Everybody,
My problem is: I have a report with many dbtexts side by side. How to
determine their width? I mean, I don?t want a part of a text above another
text. Is there any property as we have for many elements in a vertical way
similar to "relative to"? Well...I don?t know if I make myself clear... I
hope so!
Thanks a lot!!!
Bruno Nepomuceno
My problem is: I have a report with many dbtexts side by side. How to
determine their width? I mean, I don?t want a part of a text above another
text. Is there any property as we have for many elements in a vertical way
similar to "relative to"? Well...I don?t know if I make myself clear... I
hope so!
Thanks a lot!!!
Bruno Nepomuceno
This discussion has been closed.
Comments
coming from the datapipeline for the current record. Try this code out:
uses
ppTypes, ppUtils;
procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
var
lCanvas: TCanvas;
lsText: String;
ldWidth: Double;
ldSpace: Double;
begin
ppDBText1.Left := 0;
lsText := ppReport1.DataPipeline.GetFieldAsString(ppDBText1.DataField);
lCanvas := ppReport1.Printer.Canvas;
lCanvas.Font := ppDBText1.Font;
ldWidth := lCanvas.TextWidth(lsText);
ldWidth := ppToMMThousandths(Round(ldWidth), utPRinterPixels,
pprtHorizontal, ppReport1.Printer);
ldWidth := ppFromMMThousandths(Round(ldWidth), ppReport1.Units,
pprtHorizontal, ppReport1.Printer);
ppDBText1.Width := ldWidth;
ldSpace := 0.25;{inches in my report}
ppDBText2.Left := ppDBText1.Left + ppDBText1.Width + ldSpace;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com