Setting horizontal direction of a component programatically

Stimulsoft Reports.NET discussion
Post Reply
Naveen Aggarwal
Posts: 70
Joined: Wed Feb 24, 2010 11:08 am
Location: India

Setting horizontal direction of a component programatically

Post by Naveen Aggarwal »

Kindly let me know the code for setting horizontal direction of a component (including crosstab) programmatically.
I tried to use report.GetComponentByName("Text1") but didn't find any property/method to set the horizontal direction.

Best Regards !

Naveen
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Setting horizontal direction of a component programatica

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Naveen Aggarwal
Posts: 70
Joined: Wed Feb 24, 2010 11:08 am
Location: India

Re: Setting horizontal direction of a component programatica

Post by Naveen Aggarwal »

I just want to change the horizontal direction of a component say Text or crosstab at run time. For example, I have setup the horizontal direction of a crosstab to centre at design time but for some reason, i want to change the horizontal direction to width in my vb.net code. Kindly let me know, if it is possible to do so and how can i do it.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Setting horizontal direction of a component programatica

Post by Alex K. »

Hello,

Please try to use the SummaryDirection property for CrossTab:
CrossTab1.SummaryDirection = Stimulsoft.Report.CrossTab.Core.StiSummaryDirection.LeftToRight;

Thank you.
Naveen Aggarwal
Posts: 70
Joined: Wed Feb 24, 2010 11:08 am
Location: India

Re: Setting horizontal direction of a component programatica

Post by Naveen Aggarwal »

Thanks a lot for your reply sir !

Kindly let me know what should i do in case of a text component ?

Best Regards !!

Naveen
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Setting horizontal direction of a component programatica

Post by HighAley »

Hello.

If you need to change horizontal alignment, you should use next code:

Code: Select all

Dim comp = report.GetComponentByName("Text1")
DirectCast(comp, StiText).HorAlignment = StiTextHorAlignment.Right
Thank you.
ns4098
Posts: 3
Joined: Sat Aug 15, 2015 6:02 pm

Re: Setting horizontal direction of a component programatica

Post by ns4098 »

hi
i have a databand2 in my report and i need to change RightoLeft property of Databand2 in condition of befor print
i have a code like this on the condition
if(DataSource1.CAnswerTime==1)
{
this.DataBand2.Righttoleft=true
}
else
{
this.DataBand2.Righttoleft=true

}
please help me how to set databand horizental coulmn direction by code;
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Setting horizontal direction of a component programatica

Post by HighAley »

Hello.

The RightToLeft property of the Data Band does not change order of columns.
You should change position of each text component.

Thank you.
Post Reply