How to apply a conditional margin to a textbox?
How to apply a conditional margin to a textbox?
Hello,
I want to have a conditional margin for a textbox in such a way that check for an "IF" condition and apply different margins related to the condition result.
Is it possible and how?
Thanks
I want to have a conditional margin for a textbox in such a way that check for an "IF" condition and apply different margins related to the condition result.
Is it possible and how?
Thanks
How to apply a conditional margin to a textbox?
Hello,
You can use following script in BeforePrintEvent of text component:
Thank you.
You can use following script in BeforePrintEvent of text component:
Code: Select all
if (condition)Text1.Margins = new Stimulsoft.Report.Components.StiMargins(1, 2, 3, 4);
else if (condition)Text1.Margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
How to apply a conditional margin to a textbox?
Thanks for you fast reply,
My condition is different in each row so the textbox margins may have different values in each row. but in your suggested solution, the final condition in the last row is checked and the related margin is applied to all of the rows.. in other words only the last row's condition defines the margin for all of the rows...
My condition is different in each row so the textbox margins may have different values in each row. but in your suggested solution, the final condition in the last row is checked and the related margin is applied to all of the rows.. in other words only the last row's condition defines the margin for all of the rows...
How to apply a conditional margin to a textbox?
There is no solution?
How to apply a conditional margin to a textbox?
Hello,
Could you explain your issue in more details?
Thank you.
Please send us your .mrt file with database for analysis on support@stimulsoft.com.rezanew wrote:My condition is different in each row so the textbox margins may have different values in each row. but in your suggested solution, the final condition in the last row is checked and the related margin is applied to all of the rows.. in other words only the last row's condition defines the margin for all of the rows...
Could you explain your issue in more details?
Thank you.
Re: How to apply a conditional margin to a textbox?
Any solution for that Topic? Stimulsoft is still behaving in the same way today!
I tried to set a different margin (10 instead of 5) for a text component only on second line. But it does not work. All lines are affected.
Thanks
Thorsten Pontow
I tried to set a different margin (10 instead of 5) for a text component only on second line. But it does not work. All lines are affected.
Code: Select all
if (Line == 2)DataTabelle1_Konto.Margins = new Stimulsoft.Report.Components.StiMargins(20,0,0,0);
else DataTabelle1_Konto.Margins = new Stimulsoft.Report.Components.StiMargins(5,0,0,0);
Thorsten Pontow
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to apply a conditional margin to a textbox?
Hello,
Please send us a sample report with test data which reproduces the issue for analysis
Thank you.
Please send us a sample report with test data which reproduces the issue for analysis
Thank you.
Re: How to apply a conditional margin to a textbox?
Take any sample Report and set that above code to BeforePrint-Event of any text component you like.
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to apply a conditional margin to a textbox?
Hello,
Please check the following code:
Thank you.
Please check the following code:
Code: Select all
Text1.Properties = Text1.Properties.Clone() as Stimulsoft.Base.StiRepositoryItems;
if (Line > 3) Text1.Margins = new Stimulsoft.Report.Components.StiMargins(20, 0, 0, 0);
else Text1.Margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
Re: How to apply a conditional margin to a textbox?
Hi Lech,
that solution works. Great! Thanks for your kind help and support.
Best regards
Thorsten Pontow
that solution works. Great! Thanks for your kind help and support.
Best regards
Thorsten Pontow
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)