Form

This example shows simple variable output from application to the report result file. There is only one button Make on a form.


Report template

The report template contains one field \HelloVar\ enclosed within the \\ chars. The variable is created inside the program code below.

Code to generate the report

private void button1_Click(object sender, EventArgs e)
{
//Place EkRtf component on a form, or create it in code like here
System.ComponentModel.Container components = new System.ComponentModel.Container();
EkRtfReport.EkRtf ekRtf1 = new EkRtfReport.EkRtf(components);
//Clear report variables (if any exists)
ekRtf1.ClearVars();
//Create new variable for our example
ekRtf1.CreateVar("HelloVar", "Hi, I am here!");
//Set the file for input report template
ekRtf1.InFile = "report.rtf";
//Set the file for output result (if necessary)
ekRtf1.OutFile = "hello_result.rtf";
//Execute report
ekRtf1.ExecuteOpen();
}


Result