Page 1 of 2
Previous () Function Not Working
Posted: Thu Dec 10, 2015 7:38 pm
by Don Brown
I am trying to condition highlighting on a comparison between the current row value and the previous row value. I added a Highlight Condition and put the following values in the Conditions form:
Value | String | rptTable.Op1_Color
not equal to | Previous (DataBand1, rptTable.Op1_Color)
Highlighting set to Light Gray.
I get no response from the Previous ()function in the above. So I tried one more thing: I created a temporary text box on the report with this in the text box: {Previous(DataBand1,rptTable.Op1_Color)}. It is always empty, even though the previous row always has a value.
There is no reference in any of your Help documents about the Previous () function, examples, formats, or any help at all.
I need your help. Do the Print State functions actually work? If so, show me how to compare one line to the previous.
Re: Previous () Function Not Working
Posted: Fri Dec 11, 2015 6:05 am
by Alex K.
Hello,
Please try to use the Expression type for the "Field Is" option in the Condition and use the following expression:
Code: Select all
rptTable.Op1_Color != Previous(rptTable,"Op1_Color")
Thank you.
Re: Previous () Function Not Working
Posted: Mon Dec 14, 2015 9:39 pm
by Don Brown
I set a Highlight condition for 'Field Is" Expression and entered the expression field you suggested
rptTable.Op1_Color != Previous (rptTable, "Op1_Color").
When I run the report in Preview, no warnings. When I save it and run it from the Application, I get the message box with message: "Unable to use Report File C:\ . . .\Report.mrt. Please have its validity verified."
Something is still wrong with the solution.
Re: Previous () Function Not Working
Posted: Tue Dec 15, 2015 10:57 am
by Alex K.
Hello,
Please clarify which product and which version are you use?
Thank you.
Re: Previous () Function Not Working
Posted: Tue Dec 15, 2015 3:07 pm
by Don Brown
I am using Stimulsoft Reports.Ultimate.2011.2 for this project.
I also have Stimulsoft Reports.Net 2014.3, but when I use 2014.3 the Panel 1 container in the report turns Red. It does not work with this report.
Re: Previous () Function Not Working
Posted: Wed Dec 16, 2015 11:27 am
by Alex K.
Hello,
Can you please send us your report with test data for analysis.
Thank you.
Re: Previous () Function Not Working
Posted: Tue Dec 22, 2015 3:09 pm
by Don Brown
I have added a MS SQL Server 2012 database and a copy of the report to this email.
The purpose of using the Previous() function is to change all text boxes on the DataBand1 line to display a background of Light Gray when the value on the current row is different from the value on the previous row.
The report has only one text box Text15 containing the condition and filter code set with the Appearance properties set to rptNeedleAssignments.Op1_Thread != Previous (rptNeedleAssignments, "Op1_Thread"). After Text15 works we will use the same code to set all 14 text boxes to the right to the same condition.
Re: Previous () Function Not Working
Posted: Wed Dec 23, 2015 11:25 am
by Alex K.
Hello,
The Previous function return object value and your column is string. Pleas try to use the following expression:
rptNeedleAssignments.Op1_Thread != Previous(rptNeedleAssignments,"Op1_Thread").ToString()
Thank you.
Re: Previous () Function Not Working
Posted: Wed Dec 23, 2015 4:02 pm
by Don Brown
I put in exactly what you said (rptNeedleAssignments.Op1_Thread != Previous(rptNeedleAssignments,"Op1_Thread").ToString()) and got the same result--the message ". . .mrt. Please have its validity verified". The Expression condition does not seem to work with any condition. I even tried entering a very simple 1==1 expression and got the same error message. Does the Value Condition even work or is it broken??
Re: Previous () Function Not Working
Posted: Thu Dec 24, 2015 6:24 am
by Alex K.
Hello,
Please check the modified report in the attachment.
Thank you.