Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi guys,

In my crystal report i have added 4 tables to my dataset. My database has 3 different columns to keep the purchase details of all the transactions.Those 3 columns are Cash,Cheques and Credit.For an example if user buys an item for Cash that amount will go to Cash column. Also user can even do their payments using above 3 methods as well. Below is my code


DataSetCashierReceiptsResi dsReceiptsResi = new DataSetCashierReceiptsResi();
     DataTable dtReceiptsResi = new DataTable();

     dtReceiptsResi.Columns.Add("TransNo", typeof(string));
     dtReceiptsResi.Columns.Add("CustomerName", typeof(string));
     dtReceiptsResi.Columns.Add("Description", typeof(string));
     dtReceiptsResi.Columns.Add("Amount", typeof(decimal));
     dtReceiptsResi.Columns.Add("BalDue", typeof(decimal));
     dtReceiptsResi.Columns.Add("Salesman", typeof(string));

     DataTable dtReceiptsResi_CASH = new DataTable();

     dtReceiptsResi_CASH.Columns.Add("TransNo", typeof(string));
     dtReceiptsResi_CASH.Columns.Add("CashData", typeof(string));
     dtReceiptsResi_CASH.Columns.Add("CashAmount", typeof(decimal));



#region CASHIER PRINT RECEIPTS RESI
               dtReceiptsResi = print.CashierPrintReceiptsResi(); // BIND CREDIT INVOICES RESIDENTIAL
               dsReceiptsResi.Tables["DataTable1"].Merge(dtReceiptsResi);

               MessageBox.Show(dsReceiptsResi.Tables["DataTable1"].Rows.Count.ToString());

               rptDoc.Subreports[4].SetDataSource(dtReceiptsResi);
               rptDoc.Subreports[4].DataSourceConnections.Clear();

               #endregion

               #region CASHIER PRINT RECEIPTS RESI CASH ONLY

               dtReceiptsResi = print.CashierPrintReceiptsResiCashOnly(); // BIND CREDIT INVOICES RESIDENTIAL

               dsReceiptsResi.Tables[dsReceiptsResi.DataTable11.TableName].Merge(dtReceiptsResi);

               MessageBox.Show(dsReceiptsResi.Tables["DataTable11"].Rows.Count.ToString());

               DataView ddd = new DataView(dsReceiptsResi.Tables["DataTable11"]);
               for (int k = 0; k < 4; k++)
               {
                   MessageBox.Show(ddd[k]["TransNo"].ToString() + " %%% " + ddd[k]["CashData"].ToString() + " %%% " + ddd[k]["CashAmount"].ToString() + " %%% ");

               }
               rptDoc.Subreports[4].SetDataSource(dsReceiptsResi.Tables["DataTable11"]);
               rptDoc.Subreports[4].DataSourceConnections.Clear();


               #endregion



Iam checking in msg box whether data has arrived or not. Data is successfully received to the datatable but it wont display in the crystal report.Need help guys..i hope my question is clear :-)
Posted

1 solution

HI,

just fired the crystal report only and see weather report showing any data or not?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900