Page 1 of 1
Disable page befor other page
Posted: Fri Jun 01, 2012 8:49 am
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
Disable page befor other page
Posted: Mon Jun 04, 2012 2:55 am
by Alex K.
Hello,
Please send us you report with test data which reproduces the issue for analysis.
Thank you.
Disable page befor other page
Posted: Mon Jun 04, 2012 3:31 am
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
Disable page befor other page
Posted: Mon Jun 04, 2012 7:58 am
by Andrew
Great!
Thank you.
Re: Disable page befor other page
Posted: Sat Jun 04, 2016 2:01 pm
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
Re: Disable page befor other page
Posted: Mon Jun 06, 2016 6:54 am
by HighAley
Hello.
Where do you use this code?
Could you describe your issue more detailed?
Thank you.
Re: Disable page befor other page
Posted: Tue Jun 07, 2016 1:41 pm
by KONAN
i use this code in the rendering page
Re: Disable page befor other page
Posted: Wed Jun 08, 2016 11:31 am
by HighAley
Hello.
Sorry, we can't reproduce your issue.
Could you send us your report template with sample data for analysis?
Thank you.