Page 1 of 1

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

Posted: Tue Mar 06, 2007 5:23 am
by jayakumargr
Hi,

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

Thanks in advance....!:
:brick:

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

Posted: Tue Mar 06, 2007 10:00 am
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.