Hi ashishk,
Right click the object that you want to format and select Format Object.
Then click on Display string formula icon and you can see the following dialog box.
Then write the below formula and click Save and Close.
CSTR(Round ({DataTable1.Freight},0),0)
Using the below article i have created an example.
C#
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("~/CustomerReport.rpt"));
Customers dsCustomers = GetData("SELECT TOP 10 CustomerID,Freight FROM Orders");
crystalReport.Database.Tables[0].SetDataSource(dsCustomers.Tables["Table"]);
CrystalReportViewer1.ReportSource = crystalReport;
}
private Customers GetData(string query)
{
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
SqlCommand cmd = new SqlCommand(query);
using (SqlConnection con = new SqlConnection(conString))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (Customers dsCustomers = new Customers())
{
sda.Fill(dsCustomers);
return dsCustomers;
}
}
}
}
Output