I have a Column(TType) in crystal Reports which consists of values (SALE,VOID,TRANSFER)
I need to write a formula for calculating the No of VOIDS From these TType Column
Can anyone Help me?
Thanks in Advance.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pravin GhadgePosted Nov 3, 2011, 10:29 AM
U can use running total.
Right Cllick on field & insert running total .There is Type of Summary option from where u can select "count".
Below there is Formula option.
In that u can write :
{tblname.TType}='Void'
You will definately get count of void only.
Regards
Pravin
Pravin GhadgePosted Nov 3, 2011, 6:55 PM
AnjuPosted Nov 3, 2011, 12:21 PM
Its Working.Thanks For the Reply.
Datta KharadPosted Nov 3, 2011, 3:06 AM
Just try this code..
DatabaseConnection.conn.Open();
cmd = new SqlCommand("Select count(*) FROM tblName where TType = 'VOID'",DatabaseConnection.conn);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
ds.Receipt_No.dcUserColumn.DefaultValue = rdr[0].ToString();
}
rdr.Close();
SqlDataAdapter da = new SqlDataAdapter(sql,DatabaseConnection.conn);
da.Fill(ds, "Product");
MessageBox.Show (ds.Tables[1].Rows.Count.ToString());
DatabaseConnection.conn.Close();
CrystalReport1 rcp = new CrystalReport1();
rcp.SetDataSource(ds.Tables[1]);
crystalReportViewer1.ReportSource = rcp;
crystalReportViewer1.Refresh();
You can Refer this link
http://www.c-sharpcorner.com/UploadFile/uditsingh/CR1111022006055359AM/CR11.aspx
AnjuPosted Nov 2, 2011, 12:17 PM
I'm able to calculate the total no of rows in TType column,but i need to calculate only the
VOID rows in TType column.
EX:The TType column looks like
TTYpe
1.Sale
2.Sale
3.Void
4.Void
5.Void
6.Transfer
With Summary i can calculate total no of rows i.e=6
No of VOIDS: ?.(How to calculate,The Answer should be 3)
Datta KharadPosted Nov 2, 2011, 5:25 AM
HI....
You can use summary field in your report
1. right click on report click VOID ->Summary
2. select the field you want to sum
If answer will correct then mark as Accepted Answer.