I am generating an invoice report that can contain a company logo. If the company logo is not supplied, then I want the address block to move to the space occupied by the logo, so that there is no empty space.
The result should look like this:
With Logo :
[LOGO: Image] [Address Block: Textbox]
Without Logo:
[Address Block]
How can I make Address Block shift to the left to occupy the logo's space when the logo is empty? I tried playing with Auto Grow and Auto Shrink but it has no effect.
Thanks!
Auto-shift boxes
Auto-shift boxes
Last edited by fuhrj on Sat Aug 04, 2012 5:11 pm, edited 1 time in total.
Re: Auto-shift boxes
I've answered my own question. By using the code below in the Page Rendering event, I can
shift the address block to the left when the logo is null and to the right when it is not.
shift the address block to the left when the logo is null and to the right when it is not.
Code: Select all
if (Company.logo == null) {
Image2.Enabled = false;
Panel1.Left = .1;
} else {
if (Company.logo.Length == 0) {
Image2.Enabled = false;
Panel1.Left = .1;
} else {
StiReport report = new StiReport();
double imgWidth = report.Unit.ConvertToHInches(img.Width);
Panel1.Left = (imgWidth / 10000) + .2;
};
}
Re: Auto-shift boxes
Hello.
You could set the Can Shrink property of the image to true and enable Decreasing Size Shift mode of the text component.
Look at the attached report template. Thank you.
You could set the Can Shrink property of the image to true and enable Decreasing Size Shift mode of the text component.
Look at the attached report template. Thank you.