hide subreport

Stimulsoft Reports.NET discussion
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

hide subreport

Post by majidsoft »

hi
i have a sub report that contain a information
i want one of my filed in sub report if have no data or null data sub report not shown
on of my field in sub report have data that cause subreport show but i want if another field have no data then subreport not shown too
thanks
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

hide subreport

Post by Jan »

Hello,

You can disable SubReport component with help of Enabled property. For example, code in BeforePrintEvent:

Code: Select all

if (condition)
  SubReport1.Enabled = false;
Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

hide subreport

Post by majidsoft »

hi
i want to write something like this
if (text3.text=0)
subreport1.enable=false
this textbox is in sub report1 that calculate avg of on field
thanks
if you can send me sample please
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

hide subreport

Post by Ivan »

Hello,

During report rendering exist two instance of each component (minimum two instance). One instance - component in report template. Second instance - component which created for rendered report. During creation of second instance report engine calculate expressions and write it to second instance. When you write expression like this:
{Text1.Text}
you call instances from report template which does not contain calculated values from expressions.

You can:
1. Instead of "{Text1.TextValue}" expression use the same expression as in Text1.Text property, or
2. Use variables. In this case you can calculate value in variable, and then use this variable in expressions.

Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

hide subreport

Post by majidsoft »

hi
i dont understand you for example i have textbox in my subreport i want if textbox have 0 value subreport not shown please if you can send me on sample
thank you
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

hide subreport

Post by Alex K. »

Hello,

Please see the sample in the attachment.

Thank you.
Attachments
530.Sampe_HideSubReport.mrt
(17.64 KiB) Downloaded 552 times
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

hide subreport

Post by majidsoft »

hi
look my friend i have one variable with int type i want to send number to this variable in my program and stimul check it
for example "if mp=2 then subreport .enable=false"
thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

hide subreport

Post by Alex K. »

Hello,

Please see the sample in the attachment.

Thank you.
Attachments
548.Sampe_HideSubReport.mrt
(17.74 KiB) Downloaded 461 times
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

hide subreport

Post by majidsoft »

hi
thank you
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

hide subreport

Post by Andrew »

Hello,

Let us know if you need any additional help.

Thank you.
Post Reply