Page 1 of 1
Arrange text around images
Posted: Sat Dec 02, 2017 12:50 pm
by Fabio Pagano
Hi,
I need to set image in order to arrange text around images (see. attacched "with image in field"). When field image is null text will be formatting as the attached file "without image in field".
Thanks for reply
Re: Arrange text around images
Posted: Mon Dec 04, 2017 9:44 pm
by Alex K.
Hello,
As a way, you can use an additional code in the BeforePrint event, in which check Image and if it is empty set the DockStype=Top or increase Width for Text components.
Thank you.
Re: Arrange text around images
Posted: Wed Jan 03, 2018 6:23 pm
by Fabio Pagano
hello,
could you show me an exemple?
thank you
Re: Arrange text around images
Posted: Mon Jan 08, 2018 7:44 pm
by Alex K.
Hello,
You can use the following code in the BeforePrint event of the DataBand5:
Code: Select all
if (DataSourceName.ColumnImageName == null)
{
Image1.Enabled = false;
Text1.DockStyle = Stimulsoft.Report.Components.StiDockStyle.Top;
Text2.DockStyle = Stimulsoft.Report.Components.StiDockStyle.Top;
}
Thank you.
Re: Arrange text around images
Posted: Thu Jan 25, 2018 5:13 pm
by Fabio Pagano
Thank you for reply.
I've achieved to set the text close the image, and to extend text horizontally when image is missing.
I used this code in the BeforePrint event of the DataBand5:
if (DescrizioneLavoroDettagliata.Lavoro__Immagine == DBNull.Value)
{
Image12.Enabled = false;
Text183.Width = 12;
Text184.Width = 17;
}
else
{
Image12.Enabled = true;
Text184.Width = 12;
}
In this way when image12 il not null the text184 Width is just defined.
The text isn't around image as you can see in the attacched file (text close image)
Anyway i'd like to have text surrounding image (see file text surrounding image)
thanks in advance
Re: Arrange text around images
Posted: Fri Jan 26, 2018 7:33 am
by Edward
Hi Fabio,
That task is definitely much more complicated, and we either need to render in 3 text boxes, either change the text rendering in the one textbox so the image is displayed above the text, which would cause the problems with the export of that report. I think that Alex's solution and yours that is kindly explained here is the best approach we could think of, despite the fact that the text is not floating around the image as you needed it to. Sorry about that.
Thank you,
Edward
Re: Arrange text around images
Posted: Fri Jan 26, 2018 7:57 pm
by Fabio Pagano
No problem. Thank you very much.
Re: Arrange text around images
Posted: Tue Jan 30, 2018 3:25 pm
by HighAley
Hello, Fabio.
You could also try to use the RenderTo property.
This will allow you to render the text in several components.
Thank you.
Re: Arrange text around images
Posted: Mon Mar 26, 2018 5:10 pm
by Fabio Pagano
Hello, HighAley,
thanks for your great idea. Joining with mine I managed to reach my goal.
At the end to arrange text around image (to riproduce Office Word image property)
I Use 3 textbox (text1, text2, text3) and the Renderto property for text1 to text2 and text2 to text3 (file1 attacched)
To avoid leaving the empty image space if it is not inserted, in BeforePrint event of DATABAND I set this code:
if (
'condition'
)
{
Image1.Enabled = false;
Text2.Width = 19;
}
else
{
Image1.Enabled = true;
Text2.Width = 15;
}
Good job
Re: Arrange text around images
Posted: Wed Mar 28, 2018 6:42 am
by Lech Kulikowski
Hello,
Thank you for the provided solution.