Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
Infragistics Document Engine (for reporting) - How to place text and graphics side-by-side?
posted

How do I place text and graphics side-by-side?

 

I got it working using a Site object, but the problem is that it uses absolute positioning.  If the paragraph text is twice as long, you get overlap.

Parents
  • 37774
    Verified Answer
    posted

    One solution is to use a Table, with the text in the first cell and the image in the second (or vice versa), such as:

    Report r = new Report();
    ISection section = r.AddSection();
    ITable table = section.AddTable();
    ITableRow row = table.AddRow();

    row.AddCell().AddText().AddContent("This is a really long string that isn't particularly interesting to read yet should illustrate the purpose of using a table to get text and an image on the same line");
    row.AddCell().AddImage(new Infragistics.Documents.Graphics.Image("test.PNG"));

    You can set the width of a particular cell as necessary using FixedWidth or RelativeWidth.  Additionally, if you want to have multiple lines like this all with the same width per cell in a column, you could look into the Grid object.

    -Matt 

     

Reply Children
No Data