1. Add references to FastReport.dll and FastReport.Web.dll below the demo folder
2. Add using Fastreport;
Using Fastreport.web;
3. Drag fastreport to the page on the Web page, Design view
4. Add Webreport1_startreport event for Fastreport
<summary>
Get the data
</summary>
<returns></returns>
Public DataSet GetData ()
{
String con = configurationmanager.connectionstrings["con"]. ConnectionString;
SqlConnection connection = new SqlConnection (Con);
SqlCommand command = new SqlCommand ("Select * from Manager", connection);
SqlDataAdapter SDA = new SqlDataAdapter (command);
DataSet ds=new DataSet ();
DataTable managerdata = new DataTable ();
Managerdata.tablename = "Manager";
Sda. Fill (Managerdata);
Ds. Tables.add (Managerdata);
DataTable Payrecord = new DataTable ();
Payrecord. TableName = "Payrecord";
SqlCommand Command1 = new SqlCommand ("SELECT * from Payrecord", connection);
SqlDataAdapter sda1 = new SqlDataAdapter (Command1);
Sda1. Fill (Payrecord);
Ds. Tables.add (Payrecord);
return DS;
}
protected void Webreport1_startreport (object sender, EventArgs e)
{
Fastreport.report-this. Webreport1.report;
. Load (Server.MapPath ("\\ReportTemplate\\demo.frx"));//Load Template
DataSet Ds=this.getdata ();
. Registerdata (DS);//Registration data
}
5. Add Table2_manualbuild event for table
private void Table2_manualbuild (object sender, EventArgs e)
{
datasourcebase source= Report.getdatasource (" manager");
Source. Init ();
table2.printrow (0);
table2.printcolumns ();
while source. Hasmorerows)
{
table2.printrow (1 );
table2.printcolumns ();
Source. Next ();
}
} Experience New Blogs