Hosein Masoomi
Hosein Masoomi

Reputation: 197

Show/Hide Field Label in StimulSoft

This is the scenario

First i have created a .mrt file(report), with some labels like

> |-------------------------------|
> | lbl1 lbl2 |
> | lbl3 lbl4 | 
> | lbl5 lbl6 |
> | lbl7 lbl8 |
> | lbl9 lbl10 |
> | lbl11 lbl12 |
> |-------------------------------|

I put some value on the label at the time of report creations and now I want to do enable false lbl1 and lbl2 on c# code, with the help of above code achieved this.Both the labels are not displaying when report creates in pdf format. But when the labels (lbl1 and lbl2) are disable, the first row sets blank and empty row displays. I want to shift second row at first place, third row at second, fourth row at third and so on.

I set CanShrink true for all lables and set add the Decreasing Size mode to the Shift Mode property of the all labels.

but it didn't solve my problem.

Upvotes: 0

Views: 2483

Answers (2)

Farzad Aghapour
Farzad Aghapour

Reputation: 1

2 solution can solve this :

1- try to replace your label text in code side (Run time) something like :

Stimulsoft.Report.Components.StiText lbl9= rpt.GetComponents()["lbl9"] as StiText;
Stimulsoft.Report.Components.StiText lbl10= rpt.GetComponents()["lbl10"] as StiText;
Stimulsoft.Report.Components.StiText lbl11= rpt.GetComponents()["lbl11"] as StiText;
Stimulsoft.Report.Components.StiText lbl12= rpt.GetComponents()["lbl12"] as StiText;

lbl9.Text = lbl11.Text;
lbl10.Text = lbl12.Text;

lbl11.Enabled = false;
lbl12.Enabled = false;

2- try to create table. You can get an idea of this link

https://www.stimulsoft.com/ru/samples/winforms/create-a-new-report-with-table-in-runtime

Upvotes: 0

Hosein Masoomi
Hosein Masoomi

Reputation: 197

I Solved it Set CanShrink=true and DockStyle property, set to Top for the Text components.

Upvotes: 0

Related Questions