Processing duplicates and oddstyles
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Processing duplicates and oddstyles
Is it possible to have oddstyles and evenstyles for the generated rows in a databand, that uses one style for merged duplicates?
I want something like this.
Row 1 - single item - white background
Row 2 - merged with row 3 - gray background
Row 3 - merged with row 2 - gray background
Row 4 - single item - white background
I want something like this.
Row 1 - single item - white background
Row 2 - merged with row 3 - gray background
Row 3 - merged with row 2 - gray background
Row 4 - single item - white background
Processing duplicates and oddstyles
Yes, it is possible.
For this you need declare 2 variables in the report Dictionary:
bool OddLine - to determine changing of the Text value from Row to Row.
string MyVar - to store value of the previous text line.
In the GetValue of the StiText please type the following:
HighlightCondition of the Text component should contain the following:
You can see that report in the Demo.exe sample Application. To download it please use link bellow:
Thank you.
For this you need declare 2 variables in the report Dictionary:
bool OddLine - to determine changing of the Text value from Row to Row.
string MyVar - to store value of the previous text line.
In the GetValue of the StiText please type the following:
Code: Select all
if (e.Value != MyVar)
{
OddLine = !OddLine;
MyVar = e.Value;
}
Code: Select all
OddLine
Thank you.
- Attachments
-
- 8.ProcessingDuplicatesAndOddStyle.zip
- (3.35 KiB) Downloaded 280 times
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Processing duplicates and oddstyles
It does work, but Im having some trouble with the highligt condition. If I use the gray background on the highlight-condition based on the expression "OddLine", then I get to many gray lines. I need someway to retrieve the former rows background-color on the condition, rather than using a specified style/background-color.
Processing duplicates and oddstyles
In that case you can use BeforePrint Event of the StiText component for setting its background. You can do this as following:incognito_gbg wrote:It does work, but Im having some trouble with the highligt condition.
Code: Select all
Text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Silver);
It is no problem. All you need is to add your custom counter for the odd lines which are produced by the ProcessingDuplicates property. And then to include this counter in the HighLightCondition.incognito_gbg wrote:If I use the gray background on the highlight-condition based on the expression "OddLine", then I get to many gray lines. I need someway to retrieve the former rows background-color on the condition, rather than using a specified style/background-color.
Also the same result can be achieved without using HighLightCondition.
In the attachment you can get such report template which I've made without using of the HighLightCondition.
Variables:
string MyVar
int LineNumberOdd - counter for the lines after ProcessingDuplicates property.
BeforePrint event of the Text1:
Code: Select all
if ((LineNumberOdd&1)==0)
{
Text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Silver);
}
else
{
Text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.White);
}
Code: Select all
if (e.Value != MyVar)
{
LineNumberOdd++;
MyVar = e.Value;
}
Thank you.
- Attachments
-
- 9.ProcessingDuplicatesAndOddStyle2.zip
- (3.44 KiB) Downloaded 243 times
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Processing duplicates and oddstyles
First off, I want to thank you for all the help. It is very appriciated. 
It works quite well now, but Im still having trouble when the lines have more that one column.
If I use your example with the Before Print event and GetValue event on the column thats using the 'Processing Duplicates = merged'-property, then it works perfectly. But when I try to add the event-handles on my other columns, then all rows become gray. If dont add that eventhandler, and just add the colorproperties for text2, text3...etc in the Beforeprint-event for Text 1 (the column with Processing Duplicates = merged'-property), then it still just changes the color for itself and leaves the other columns unchanged.

It works quite well now, but Im still having trouble when the lines have more that one column.
If I use your example with the Before Print event and GetValue event on the column thats using the 'Processing Duplicates = merged'-property, then it works perfectly. But when I try to add the event-handles on my other columns, then all rows become gray. If dont add that eventhandler, and just add the colorproperties for text2, text3...etc in the Beforeprint-event for Text 1 (the column with Processing Duplicates = merged'-property), then it still just changes the color for itself and leaves the other columns unchanged.
Processing duplicates and oddstyles
Please send sample to
for analysis.
Thank you.

Thank you.
Processing duplicates and oddstyles
In that case please set Columns on the Page, not on the Database. If you still need to use columns on the Databand, please set DownThenAcross mode for them in the ColumnDirection property.
Please send sample to
for analysis.
You may do the modifications in my previous sample.
Thank you.
Please send sample to

You may do the modifications in my previous sample.
Thank you.
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Processing duplicates and oddstyles
I will send an email later this day as soon as I have time.
With columns, I dont mean that Im using the colum properties for the databand. I mean the generated columns that appear on the report from the Text-controls that I have connected with an XML-file and schema.
With columns, I dont mean that Im using the colum properties for the databand. I mean the generated columns that appear on the report from the Text-controls that I have connected with an XML-file and schema.
Processing duplicates and oddstyles
Please use for this sample latest prerelease build of the StimulReport.Net. The sample will not run on the 2007.1 release version because we've made some enchantments in that direction.incognito_gbg wrote:If I use your example with the Before Print event and GetValue event on the column thats using the 'Processing Duplicates = merged'-property, then it works perfectly. But when I try to add the event-handles on my other columns, then all rows become gray.
Thank you.
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Processing duplicates and oddstyles
Hmm. I´ve tried several different ways of solutions, but I cant get it to work properly.
I use this function in the getValue-event for text1.
if (e.Value != MyVar)
{
LineNumberOdd++;
MyVar = e.Value;
}
And then I use this in the before-print-event.
if ((LineNumberOdd&1)==0)
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.White);
}
else
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.Silver);
}
But when I change the Before Print-event to this, then background-color for text2 is changed, but not always on the same rows where the background-color for text1 is changed.
if ((LineNumberOdd&1)==0)
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.White);
text2.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.White);
}
else
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.Silver);
text2.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.Silver);
}
The getValue-event is only specificed for text1 here, ie the one that is using the Process Duplicates.
The thing is that I want text2, text3, text4...etc to always change on the same rows as for text1. I´ve tried using the the examples that have been posted here, but I cant get exactly what I want even with them.
I have mailed a sample now to support [@] stimulsoft.com
I use this function in the getValue-event for text1.
if (e.Value != MyVar)
{
LineNumberOdd++;
MyVar = e.Value;
}
And then I use this in the before-print-event.
if ((LineNumberOdd&1)==0)
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.White);
}
else
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.Silver);
}
But when I change the Before Print-event to this, then background-color for text2 is changed, but not always on the same rows where the background-color for text1 is changed.
if ((LineNumberOdd&1)==0)
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.White);
text2.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.White);
}
else
{
text1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.Silver);
text2.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush
(System.Drawing.Color.Silver);
}
The getValue-event is only specificed for text1 here, ie the one that is using the Process Duplicates.
The thing is that I want text2, text3, text4...etc to always change on the same rows as for text1. I´ve tried using the the examples that have been posted here, but I cant get exactly what I want even with them.
I have mailed a sample now to support [@] stimulsoft.com