Disable page befor other page

Stimulsoft Reports.NET discussion
Post Reply
Michal
Posts: 2
Joined: Fri Jun 01, 2012 8:39 am

Disable page befor other page

Post by Michal »

Hi,

i have problem with Page2.Enabled = false; .
When I set this parametr in event "BeforePrint" or in "Conditions" of page (by checkBox "Component is Enabled") page is correct disabled and is not in result. Bud page after (for example Page3) this Page2 is as well not in result. It looks like Page3 is Enabled = false too.

I want disable only Page2. Page1 and Page3 i want to be print.


Thanks for help Michal
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Disable page befor other page

Post by Alex K. »

Hello,

Please send us you report with test data which reproduces the issue for analysis.

Thank you.
Michal
Posts: 2
Joined: Fri Jun 01, 2012 8:39 am

Disable page befor other page

Post by Michal »

Hi, i found solution.

Now I have in codebehind this:

Code: Select all

        public Report()
        {
            this.InitializeComponent();
		
			this.Rendering += new EventHandler(report_Rendering);
        }
		

		void report_Rendering(object sender, EventArgs e)
		{
			if (Invoice_Type.dts != "Y")
			{
				if (this.Pages.Contains(Page4))
					this.Pages.Remove(Page4);
			}
			
			if (Phone_number.fixed_number == "" && Phone_number.mobile_number == "")
			{
				if (this.Pages.Contains(Page3))
					this.Pages.Remove(Page3);
			}
		}
"Invoice_Type.dts", "Phone_number.fixed_number" and "Phone_number.mobile_number" are items from datasource. These items must be already filled for condition. Event Report.Rendering is calling many times, but Remove only once.

Before i have condition in Page.Conditions or in Page.BeforePrint event and i set Page.Enabled. It doesn't work whith page after.


Michal
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Disable page befor other page

Post by Andrew »

Great!

Thank you.
KONAN
Posts: 5
Joined: Fri Jun 03, 2016 9:09 pm

Re: Disable page befor other page

Post by KONAN »

Hi Michal !!
I tried your code but there are a message of error:

The error of compilation The error of compilation is found in the 'Rendering' event of the 'Report' component: Expected class, delegate, enum, interface, or struct
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Disable page befor other page

Post by HighAley »

Hello.

Where do you use this code?
Could you describe your issue more detailed?

Thank you.
KONAN
Posts: 5
Joined: Fri Jun 03, 2016 9:09 pm

Re: Disable page befor other page

Post by KONAN »

i use this code in the rendering page
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Disable page befor other page

Post by HighAley »

Hello.

Sorry, we can't reproduce your issue.
Could you send us your report template with sample data for analysis?

Thank you.
Post Reply