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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Nov 3, 2011, 6:29 AM EDT
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
Datta KharadRank #2,135 · 668 reputationPosted Nov 2, 2011, 1:25 AM EDT
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.
Anju13 reputationPosted Nov 2, 2011, 8:17 AM EDT
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 KharadRank #2,135 · 668 reputationPosted Nov 2, 2011, 11:06 PM EDT
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
Anju13 reputationPosted Nov 3, 2011, 8:21 AM EDT
Its Working.Thanks For the Reply.
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Nov 3, 2011, 2:55 PM EDT