What is the Use of Get Excel Value Event???

Stimulsoft Reports.NET discussion
Post Reply
jayakumargr
Posts: 85
Joined: Sat Jan 20, 2007 4:21 am

What is the Use of Get Excel Value Event???

Post by jayakumargr »

Hi,

i want to know about Get Excel Value Event. please provide the explanation with example.

Thanks in advance....!:
:brick:
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

What is the Use of Get Excel Value Event???

Post by Edward »

An ExcelValue property of the StiText component is used for the Excel export of the numbers with formating them as "numbers" in the resulted Excel file.
A GetExcelValueEvent is used with the same sense. But you may provide different values for the same component in this event.

Please see the example of the EventHandler for the GetExcelValueEvent of the Text1 component.

Code: Select all

public void Text1_GetExcelValue(object sender, Stimulsoft.Report.Events.StiGetExcelValueEventArgs e)
{
   if (Line == 1)
  {
       e.Value = "MyText";
  }
  else
  {
       e.Value = "200";
  };
}

The result of the assignment to the e.Value you will see in the resulted Excel file after exporting of the rendered report. The resulted Excel file will be as following:
MyTextFromText1
200
200
...
200

Each cell will be formatted as number. If converting to number is impossible, than value of the StiText.Text will be transfered with formatting as text instead.

Thank you.
Post Reply