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

Programatically Add Columns in Detail Band

I want to add columns to a Detail Band. I supply the left margin and have the width etc and then use
Report.ColumnPositions.Clear;
ln loop:
sPos := (incremented sPos by iWidth)
Report.ColumnPositions.Add(sPos);

I want all widths to be the same.
I find that the borders of each column do not correspond.
If I just say Report.Columns := 10 they do.
But then I need to supply the right margin as well.

I know I can calculate the desired right margin because I have the
the paper size, but would like to add the columns by saying
...addcolumn(iWidth) more accurately, or even say
Column[i].width := ... or something.

Thanks

Comments

  • edited July 17
    Hi Lawrence,

    Report columns all need to be the same width although they can be positioned on the page as needed. There are no column borders, all positions are absolute.

    If you wish to define the column positions manually using the ColumnPositions property, be aware that these measurements are made from the left edge of the paper (not including the page gutter or margin) which needs to be taken into account when making alignments.
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Using the columnpositions method and all column widths are the same, what happens if the positions are not equally spaced, what is the/ column width? Can I set the width of the set of columns

    During setup I set the borders visible so I can check the layout on the label print.

    If I set the columns = iCols they seem to line up perfectly but their width seems to be how they fit on the page. I would like to place the first column myself and define their width manually so I do not have to set right margins. With labels this is easier to set up.

    Also I have found it safest to set the cilumn
  • In the end I think I have got to work:

    SubReport1.Report.ColumnPositions.Clear;
    SubReport1.Report.Columns := 5;
    SubReport1.Report.ColumnWidth := 20;

    I think there is a problem if the Columns in the pagesetup is too high, it works if I set it to 0 or 1.

    Since I want the columns to touch, I don't need to use the ColumnPositions.Add which was difficult to achieve what I wanted, and what was needed in the configuration.

    I guessed the ColumnWidth, but I could not find in the designer.

    Thanks for your help.

    Lawrence
Sign In or Register to comment.