Page 1 of 2

select report columns by end user

Posted: Thu Dec 27, 2012 7:58 am
by farhad.websman
hi,i have a stimulsoft report file
i want show the report culmns checkbox list programically and after selection,show the selected columns in report
is there a way to do this?
i can not find a way to get sti Report columns

Re: select report columns by end user

Posted: Thu Dec 27, 2012 11:57 am
by HighAley
Hello.

Which version do you use?

Thank you.

Re: select report columns by end user

Posted: Tue Apr 05, 2016 5:46 am
by Abbas
I want to do like this...
what do i do for this one????
i use stimulsoft 2015.2 in my mvc app...
thanks

Re: select report columns by end user

Posted: Tue Apr 05, 2016 6:48 am
by Alex K.
Hello,

Please check the sample report in the attachment.

Thank you.

Re: select report columns by end user

Posted: Tue Apr 05, 2016 11:10 am
by Abbas
Hello
thanks Aleksey
but i want to that end user select columns in program not in report....
can i show list of columns in c# code???and make visible and invisible unselected/selected columns in report from c# code???
can you send me sample code??

Re: select report columns by end user

Posted: Wed Apr 06, 2016 7:44 am
by Alex K.
Hello,

Please check the sample report in the attachment. You can find the code in the BeforePrint event of the Page1.

Thank you.

Re: select report columns by end user

Posted: Sun Apr 10, 2016 12:43 pm
by Abbas
Hello
I use this story for select columns by end user and i have problem:
i desiend a form for user that see all columns of report
user can select column
in my controller... columns that user didnt select been width=0 and enable=false
my code in controller

Code: Select all

 foreach (var col in unselectCols)
                {
                    var component = report.GetComponents()[col] as StiText;
                    var componenth = report.GetComponents()[col] as StiText;
                    if (component != null && componenth != null)
                    {
                        component.Enabled = false;
                        componenth.Enabled = false;
                        component.Shift = true;
                        componenth.Shift = true;
                        component.ShiftMode = StiShiftMode.DecreasingSize;
                        componenth.ShiftMode = StiShiftMode.DecreasingSize;
                        component.Width = 0;
                        componenth.Width = 0;
                    }
                }
then
i write these code:

Code: Select all

 foreach (StiComponent comp in dataBand.Components)
                {
                    if (!comp.Enabled)
                    {
                        continue;
                    }
                    width += comp.Width;
                    comp.Shift = true;
                    comp.ShiftMode = StiShiftMode.IncreasingSize;
                }
                foreach (StiComponent comp in headerBand.Components)
                {
                    if (!comp.Enabled)
                    {
                        continue;
                    }
                    comp.Shift = true;
                    comp.ShiftMode = StiShiftMode.IncreasingSize;
                }
                var factor = width / dataBand.Width;
                foreach (var comp in headerBand.Components.Cast<StiComponent>().Where(comp => comp.Enabled))
                {
                    comp.Width /= factor;
                }
                foreach (var comp in dataBand.Components.Cast<StiComponent>().Where(comp => comp.Enabled))
                {
                    comp.Width /= factor;
                }
but when 2nd or 3rd (except 1st ) column select by user.... report has blank space between column(2nd picture).... how i can delete this space???

but when user select 1st column every thing is good....
(1st picture)

Re: select report columns by end user

Posted: Mon Apr 11, 2016 7:29 am
by Alex K.
Hello,

Please send us a sample which reproduces the issue for analysis.

Thank you.

Re: select report columns by end user

Posted: Tue Apr 12, 2016 5:02 am
by Abbas
Hello
I find Out why space create between some columns.....

I could set "Left" property to true value....
for example for first column set to 0 and for second set to"1st column width"
thanks

Re: select report columns by end user

Posted: Tue Apr 12, 2016 6:28 am
by Alex K.
Hello,

We are always glad to help you!

Thank you.