Page 1 of 2
How do I refer to a Text box in an Event?
Posted: Mon Jun 28, 2010 12:29 pm
by MerChen
I have a text box which has the expression:
{((Div(SumIf(DataBand1,ReportData.NUM_EES_PARENT_CHILD*ReportData.AVG_BASE_PARENT_CHILD_VALUE,ReportData.TARGET_RATE1>0),SumIf(DataBand1,ReportData.NUM_EES_PARENT_CHILD*ReportData.TARGET_RATE1,ReportData.AVG_BASE_PARENT_CHILD_VALUE>0)))*100) - 100}
The text box is named Text13. If the value is -100, I want it to display a null. I thought of doing this using the Before Print Event but I don't know how to refer to Text13 in the code. Can anybody help please?
How do I refer to a Text box in an Event?
Posted: Tue Jun 29, 2010 5:11 am
by Ivan
Hello,
Please try to use following code in the GetValue event of Text13:
Code: Select all
if (((Div(SumIf(DataBand1, ReportData.NUM_EES_PARENT_CHILD * ReportData.AVG_BASE_PARENT_CHILD_VALUE, ReportData.TARGET_RATE1 > 0), SumIf(DataBand1, ReportData.NUM_EES_PARENT_CHILD * ReportData.TARGET_RATE1, ReportData.AVG_BASE_PARENT_CHILD_VALUE > 0))) * 100) - 100 == -100)
{
e.Value = "";
}
Thank you.
How do I refer to a Text box in an Event?
Posted: Tue Jun 29, 2010 10:28 am
by MerChen
Thanks for your reply Ivan. I tried that and it errored with the following message
"No overload for method 'Sum' takes 4 arguments "
If it's of any use, I clicked into the code, and it shows this:
Code: Select all
public void Text13_GetValue(object sender, Stimulsoft.Report.Events.StiGetValueEventArgs e)
{
if (((Stimulsoft.Report.Dictionary.StiFunctionsMath.Div(Totals.Sum(DataBand1, this, "GetTotal1", ReportData.TARGET_RATE1 > 0), Totals.Sum(DataBand1, this, "GetTotal2", ReportData.AVG_BASE_PARENT_CHILD_VALUE > 0))) * 100) - 100 == -100)
{
e.Value = "";
};
}
Thanks,
Chen.
How do I refer to a Text box in an Event?
Posted: Tue Jun 29, 2010 10:31 am
by MerChen
Sorry, I forgot to mention that I have this Text13 in a Group Footer Band.
Thanks,
Chen.
How do I refer to a Text box in an Event?
Posted: Tue Jun 29, 2010 4:34 pm
by Jan
Hello,
Can you say which version of Stimulsoft Reports you are use?
Thank you.
How do I refer to a Text box in an Event?
Posted: Tue Jun 29, 2010 5:58 pm
by MerChen
Hi, yes it's version 2009.3.600.0.
Thanks,
Chen.
How do I refer to a Text box in an Event?
Posted: Wed Jun 30, 2010 4:57 pm
by Ivan
Hello,
We made some improvements in that direction about a few week ago.
Please check the last prerelease build and let us know about the result.
Thank you.
How do I refer to a Text box in an Event?
Posted: Thu Jul 01, 2010 3:11 am
by MerChen
Is that to be able to refer to a text box from code? Or something to do with the GetValue event? Or both? For now, I'm stuck with this version - is there any workaround?
Thanks,
Chen.
How do I refer to a Text box in an Event?
Posted: Thu Jul 01, 2010 3:37 am
by Ivan
Hello,
Can you please send us a sample report with data, which reproduce the issue, for analysis?
Thank you.
How do I refer to a Text box in an Event?
Posted: Thu Jul 01, 2010 12:09 pm
by MerChen
After speaking with a colleague, we came up with a workaround in the end which was to set up 2 variables and have these roll up in the Rendering Event of the DataBand. Then the expression for Text13 became:
Code: Select all
{IIF(SumBaseWTgtRate == SumTgtRateWBase, null, Div(SumBaseWTgtRate, SumTgtRateWBase)*100 - 100)}
Ivan, I'm interested in your previous post regarding the improvements. How would these improvements have helped for this issue? Is there a list of improvements of what the latest version includes compared to my current version? I have seen the topic "Stimulsoft Reports.Net version 2010.2 list of changes" but wondered if there was any more detail on that.
Also, rounding back to my original question, I take it there's no way to reference the value from a text box from code? Is that because of the version I'm on?
Thanks,
Chen.