Arrange text around images
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Arrange text around images
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
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
- Attachments
-
- foto2_stimul.png (59.49 KiB) Viewed 4254 times
-
- without image in field.png (39.82 KiB) Viewed 4254 times
-
- with image in field.png (125.35 KiB) Viewed 4254 times
Re: Arrange text around images
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.
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.
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Re: Arrange text around images
hello,
could you show me an exemple?
thank you
could you show me an exemple?
thank you
Re: Arrange text around images
Hello,
You can use the following code in the BeforePrint event of the DataBand5:
Thank you.
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;
}
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Re: Arrange text around images
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
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
- Attachments
-
- text close image (2).png (112.81 KiB) Viewed 4165 times
-
- text surrounding image.png (128.61 KiB) Viewed 4165 times
Re: Arrange text around images
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
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
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Re: Arrange text around images
No problem. Thank you very much.
Re: Arrange text around images
Hello, Fabio.
You could also try to use the RenderTo property.
This will allow you to render the text in several components.
Thank you.
You could also try to use the RenderTo property.
This will allow you to render the text in several components.
Thank you.
- Attachments
-
- Report.mrt
- (239.05 KiB) Downloaded 184 times
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Re: Arrange text around images
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
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
- Attachments
-
- renderto2.png (75.95 KiB) Viewed 3851 times
-
- file1
- renderto1.png (71.8 KiB) Viewed 3851 times
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Arrange text around images
Hello,
Thank you for the provided solution.
Thank you for the provided solution.