Report post processing

Stimulsoft Ultimate discussion
Post Reply
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Report post processing

Post by tpontow »

Hello Stimulsoft,

is it somehow possible to perform a post processing step after a report is rendered? For example i like to set some text fields of the output of a rendered DataBand (let's say first column in second row ) to bold. In the definition of the DataBand the StiText objects are set to non bold.

In general, is it somehow possible to manipulate the attributes of text components after rendering?

Thanks and kind regards
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Report post processing

Post by tpontow »

I found a way and i hope that is the correct way to to that.

I registered the CompiledReport.EndRender event. In the event handler method i loop over all Components of the RenderedPages. They are all StiText components which i can manipulate the way i like to (for example set TextBrush to red :-)).

Code: Select all

CompiledReport.EndRender += ListReportEndRender;

Code: Select all

 void ListReportEndRender(object sender, EventArgs e)
        {
            DoPostProcessing();
        }

        private void DoPostProcessing()
        {
            StiComponentsCollection componentsCollection = RenderedPages[0].GetComponents();
            foreach (var component in componentsCollection)
            {
                StiText text = component as StiText;
                if (!ReferenceEquals(text, null))
                {
                    text.TextBrush = new StiSolidBrush(Color.Red);
                }
            }
        }
Is it ok to do it that way?

Kind regards
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report post processing

Post by HighAley »

Hello.

Yes, you could do so if you need.

Thank you.
Post Reply