First, let me say that this is a great product. I have been able to accomplish most everything quite easily. The only issue I am having is with images.
We have a report where we layout a number of rows/cell with data. At the end of the report, we need to add some images to it that stack one on top of the other. I have this working for the most part and I have restricted the overall column width of the image from columns 1 to 5. The problem is that when adding images, you have to also specify the starting and ending row as well. This can skew an image as well as make the overlap because we had to use a fixed height in cells for the images.
Below is the code portion that adds the images:
//Add Images
var files1 = Directory.EnumerateFiles (picPath);
int i = 0;
int iImageHeightInCells = 20;
TClientAnchor imgAnchor = new TClientAnchor();
imgAnchor.AnchorType = TFlxAnchorType.MoveAndResize;
imgAnchor.Row1 = iImageRowStart;
imgAnchor.Row2 = iImageRowStart + iImageHeightInCells;
imgAnchor.Col1 = 1;
imgAnchor.Col2 = 5;
foreach (var file in files1) {
if (file.EndsWith ("jpg")) {
TImageProperties imgP = new TImageProperties();
if (i > 0) {
imgAnchor.Row1 = imgAnchor.Row1 + iImageHeightInCells + 2;
imgAnchor.Row2 = imgAnchor.Row2 + iImageHeightInCells + 2;
}
imgP.Anchor = imgAnchor;
xls.AddImage(file, imgP);
imgP = null;
i++;
}
}
We chose a random height in cells (iImageHeightInCells) for the images that works most of the time for our images being 5 columns wide. Sometimes depending on the picture size, this isn't always the best way to do it.
What would be nice is to have a starting row where the images need to be added and then calculate the number of rows that it will take up if the width of the image is restricted to 5 columns so that the image would scale properly and maintain aspect ratio.
The, image 2 would go after image 1 and the "height in rows" would be calculated by the TImageProperties somehow.
Is there functionality like this alread that I might be missing?
Thanks in advance.
Bo