How do I refer to a Text box in an Event?
How do I refer to a Text box in an Event?
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?
{((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?
Hello,
Please try to use following code in the GetValue event of Text13:
Thank you.
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 = "";
}
How do I refer to a Text box in an Event?
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:
Thanks,
Chen.
"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 = "";
};
}
Chen.
How do I refer to a Text box in an Event?
Sorry, I forgot to mention that I have this Text13 in a Group Footer Band.
Thanks,
Chen.
Thanks,
Chen.
How do I refer to a Text box in an Event?
Hello,
Can you say which version of Stimulsoft Reports you are use?
Thank you.
Can you say which version of Stimulsoft Reports you are use?
Thank you.
How do I refer to a Text box in an Event?
Hi, yes it's version 2009.3.600.0.
Thanks,
Chen.
Thanks,
Chen.
How do I refer to a Text box in an Event?
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.
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?
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.
Thanks,
Chen.
How do I refer to a Text box in an Event?
Hello,
Can you please send us a sample report with data, which reproduce the issue, for analysis?
Thank you.
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?
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:
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.
Code: Select all
{IIF(SumBaseWTgtRate == SumTgtRateWBase, null, Div(SumBaseWTgtRate, SumTgtRateWBase)*100 - 100)}
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.