Page 1 of 1
How can I change text size in run time mode with a datapad
Posted: Fri Jun 12, 2015 4:41 pm
by claveweb
Hi,
I need to change the text size in run time with a value obtained from a datapad
For example
Text1.Fontsize = {pa_Datapad.ValueSize}
The problem is that I find the correct syntax (if you can assign the size )
What event should include the code? ( I guess before printing the page).
Thank you for your help.
Re: How can I change text size in run time mode with a datap
Posted: Mon Jun 15, 2015 6:03 am
by Alex K.
Hello,
As a way, you can use the Condition(in which set the necessary font size) for the Text component for this task.
Thank you.
Re: How can I change text size in run time mode with a datap
Posted: Tue Jun 16, 2015 7:18 am
by claveweb
Hello Aleksey
Not, I need the text size from a variable. The value of this size should be obtained from a datapad .
Thank you
Re: How can I change text size in run time mode with a datap
Posted: Wed Jun 17, 2015 11:32 am
by Alex K.
Hello,
As a way you can use the following code in the BeforePrint event:
Text1.Font = new System.Drawing.Font("Arial", pa_Datapad.ValueSize);
Thank you.
Re: How can I change text size in run time mode with a datap
Posted: Thu Jun 18, 2015 7:45 am
by claveweb
Hello and thanks again
I write the following code in BeforePrint Event of the Text1 object
Text1.font=new System.Drawing.Font("Arial",pa_infCertificateAttendance.Ds_CertificateText1Size);
I get the following error:
1. The error of compilation
The error of compilation is found in the 'BeforePrint' event of the 'Text1' component:
'Stimulsoft.Report.Components.StiText' no contiene una definición de 'font' ni se encontró ningún método de extensión 'font' que acepte un primer argumento de tipo 'Stimulsoft.Report.Components.StiText' (¿falta una directiva using o una referencia de ensamblado?)
Sorry, i select UI Language English but part of the message is displayed in Spanish.
A rough translation would be:
1. The error of compilation
The error of compilation is found in the 'BeforePrint' event of the 'Text1' component:
'Stimulsoft.Report.Components.StiText' not have a definition of 'font' and no extension method 'font' accepting a first argument of type 'Stimulsoft.Report.Components.StiText' (¿lack a directive using or a assembly reference?)
Re: How can I change text size in run time mode with a datap
Posted: Fri Jun 19, 2015 2:08 pm
by Andrew
Hello,
In your code, please write Text1.font where the word Font must be in the capital letter.
The line must be Text1.Font=new System.Drawing.Font("Arial",pa_infCertificateAttendance.Ds_CertificateText1Size);
Does this help you solve the problem?
Re: How can I change text size in run time mode with a datap
Posted: Mon Jun 22, 2015 8:30 am
by claveweb
OK Andrew, it´s perfect
Thank you very much
But i have more problems.
Where I can find documentation about the methods and properties that can be applied to these and other objects ?
For example , I need to dynamically change also the color of the text object or the color of an object panel.
Thanks again for all your help .
Regards.
Re: How can I change text size in run time mode with a datap
Posted: Mon Jun 22, 2015 11:21 am
by Alex K.
Hello,
Unfortunately, there is not documentation by the similar task.
The simple way - is a create necessary report in the standalone designer, set the necessary properties then open Code tab and use the similar code.
Thank you.