How to calc max width of memoview (without autowidth)



I'm create dynamic (runtime) report,


tmp := TfrxMemoView.Create(last.Parent);
tmp.CreateUniqueName;
tmp.Font.Name := 'Courier New';
tmp.Font.Size := 8;
tmp.ShiftMode := smDontShift;
tmp.AutoWidth := False;
tmp.WordBreak := False;
tmp.WordWrap := False;
tmp.tag := 1;

tmp.DataSet := frxDBDataset1;
tmp.DataField := ZQuery1.Fields[y].DisplayName;

if this ZQuery1.fields[y].Size is 20 --> field size in integer,
how to get / calculate tmp.width of TfrxMemoView (maximum width),
so if i got maximum width of memoview i want to set manual :

tmp.SetBounds(left, last.Top, width, last.Height)

i'm not use autowidth because i create more than 1 column.

thanks for respond



Comments

  • gpigpi
    edited 1:38PM
    Try to use TfrxMemoView.CalcWidth function. But you must set text in TfrxMemoView (go to through all records from your dataset and calculate max width)
  • edited 1:38PM
    gpi wrote: »
    Try to use TfrxMemoView.CalcWidth function. But you must set text in TfrxMemoView (go to through all records from your dataset and calculate max width)

    oh great... now i can print table direct fastest without use cross tab.

    Tq

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.