By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

error list on ledger report viewer form

P: 1
i'm using this code in crystal report viewer(ledger report)



Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CrystalDecisions.CrystalReports.Engine;
  10.  
  11. namespace MK_AUTOCARE
  12. {
  13.     public partial class crystalReportViewer2 : Form
  14.     {
  15.         public crystalReportViewer2()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.         private TextBox txthcode;
  20.         private DateTime dateTime;
  21.         private DateTime dateTime_2;
  22.  
  23.         public rptledger(DateTime dateTime,DateTime dateTime_2,TextBox txthcode)
  24.         {
  25.         InitializeComponent();
  26.         // TODO: Complete member initialization
  27.         this.dateTime = dateTime;
  28.         this.dateTime_2 = dateTime_2;
  29.         this.txthcode=txthcode;
  30.         }
  31.         dboperation db = new dboperation();
  32.  
  33.            db.DateCall(dtpto.Value);
  34.             string s = "select * from  grouphead";
  35.             db.exenonquery(s);
  36.             DataTable dt1 = db.exedatatable(s);
  37.            string s = "select * from daybook where trdate between '" + db.SDAT.ToShortDateString() + "' and '" + db.EDAT.ToShortDateString() + "'";
  38.             DataTable dt2 = db.exedatatable(s);
  39.             s = "select * from HEAD";
  40.             DataTable dt3 = db.exedatatable(s);
  41.             s = "delete from OPBALHEAD";
  42.             db.ExecuteSQL(s);
  43.             if (dt2.Rows.Count > 0)
  44.             {
  45.                 for (int i = 0; i < dt2.Rows.Count; i++)
  46.                 {
  47.  
  48.                     double opbal = 0;
  49.                     s = "select sum(credit)-sum(debit) as bal from daybook where trdate <'" + db.SDAT.ToShortDateString() + "' and HCODE='" + dt2.Rows[i]["HCODE"].ToString() + "'";
  50.                     DataTable dt5 = db.exedatatable(s);
  51.  
  52.                     if (dt5.Rows[0][0].ToString() != "")
  53.                     {
  54.                         opbal = Convert.ToDouble(dt5.Rows[0][0].ToString());
  55.                     }
  56.  
  57.  
  58.                     s = "select bal from OPENING where ACYEAR='" + db.SDAT.Year + "' and HCODE='" + dt2.Rows[i]["HCODE"].ToString() + "'";
  59.                     DataTable dt6 = db.exedatatable(s);
  60.                     if (dt6.Rows.Count > 0)
  61.                     {
  62.                         opbal = opbal + Convert.ToDouble(dt6.Rows[0][0].ToString());
  63.                     }
  64.                     s = "insert into OPBALHEAD values('" + dt2.Rows[i]["HCODE"].ToString() + "'," + opbal + ")";
  65.                     db.ExecuteSQL(s);
  66.                 }
  67.             }
  68.             s = "select * from OPBALHEAD";
  69.             DataTable dt4 = db.exedatatable(s);
  70.             DataSet2 ds = new DataSet2();
  71.            // ds.GROUPHEAD.Clear();
  72.           //  ds.GROUPHEAD.Merge(dt1);
  73.             ds.DAYBOOK.Clear();
  74.             ds.DAYBOOK.Merge(dt2);
  75.             ds.HEAD.Clear();
  76.             ds.HEAD.Merge(dt3);
  77.             ds.OPBAL.Clear();
  78.             ds.OPBAL.Merge(dt4);
  79.             daybook rpt = new daybook();
  80.             rpt.SetDataSource(ds);
  81.             TextObject MyText;
  82.             MyText = (TextObject)rpt.ReportDefinition.ReportObjects["Text11"];
  83.             MyText.Text = "Day Book";
  84.  
  85.             string ss = "select * from defaults";
  86.             string comp = "", addr = "", place = "", dist = "", state = "";
  87.             DataTable dtss = db.exedatatable(ss);
  88.             if (dtss.Rows.Count > 0)
  89.             {
  90.                 comp = dtss.Rows[0]["cname"].ToString();
  91.                 addr = dtss.Rows[0]["cadd"].ToString();
  92.                 place = dtss.Rows[0]["cplace"].ToString();
  93.                 dist = dtss.Rows[0]["dist"].ToString();
  94.                 state = dtss.Rows[0]["state"].ToString();
  95.  
  96.             }
  97.  
  98.             TextObject MyText1;
  99.             MyText1 = (TextObject)rpt.ReportDefinition.ReportObjects["Text12"];
  100.             MyText1.Text = comp;
  101.  
  102.             TextObject MyText3;
  103.             MyText3 = (TextObject)rpt.ReportDefinition.ReportObjects["Text14"];
  104.             MyText3.Text = addr + " " + place + " " + dist + " " + state;
  105.  
  106.             TextObject MyText2;
  107.             MyText2 = (TextObject)rpt.ReportDefinition.ReportObjects["Text13"];
  108.             MyText2.Text = "" + db.SDAT.ToShortDateString() + "' to '" + db.EDAT.ToShortDateString() + "' ";
  109.  
  110.  
  111.             TextObject MyText4;
  112.             MyText4 = (TextObject)rpt.ReportDefinition.ReportObjects["Text15"];
  113.             MyText4.Text = "" + db.SDAT.Year.ToString() + "-" + db.EDAT.Year.ToString() + "";
  114.  
  115.             crystalReportViewer1.ReportSource = rpt;
  116.         private void crystalReportViewer1_Load(object sender, EventArgs e)
  117.         {
  118.  
  119.         }
  120.     }
  121. }
the following errors are occured

Error 2 Method must have a return type I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 23 16 MK AUTOCARE

Error 3 Invalid token '(' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 33 23 MK AUTOCARE

Error 4 Invalid token ')' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 33 35 MK AUTOCARE

Error 5 Invalid token '(' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 35 27 MK AUTOCARE

Error 6 Invalid token ')' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 35 29 MK AUTOCARE

Error 7 Invalid token '=' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 39 15 MK AUTOCARE

Error 8 Invalid token '=' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 41 15 MK AUTOCARE

Error 9 Invalid token '(' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 42 26 MK AUTOCARE

Error 10 Invalid token ')' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 42 28 MK AUTOCARE

Error 11 Invalid token '>' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 43 32 MK AUTOCARE

Error 12 Invalid token ';' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 45 51 MK AUTOCARE

Error 13 Syntax error, '>' expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 45 51 MK AUTOCARE

Error 14 Invalid token '++' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 45 54 MK AUTOCARE

Error 15 Invalid token '=' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 49 23 MK AUTOCARE

Error 16 Invalid token '(' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 49 120 MK AUTOCARE
Error 17 Invalid token '[' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 49 151 MK AUTOCARE

Error 18 Invalid token '"HCODE"' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 49 155 MK AUTOCARE

Error 19 Identifier expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 49 155 MK AUTOCARE

Error 20 Method must have a return type I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 49 164 MK AUTOCARE

Error 21 ; expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 49 175 MK AUTOCARE

Error 22 Invalid token 'if' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 52 21 MK AUTOCARE

Error 23 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression) I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 52 34 MK AUTOCARE

Error 24 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression) I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 52 37 MK AUTOCARE

Error 25 Invalid token '.' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 52 39 MK AUTOCARE

Error 26 Method must have a return type I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 52 40 MK AUTOCARE

Error 27 ; expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 52 51 MK AUTOCARE

Error 28 Invalid token '=' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 54 31 MK AUTOCARE

Error 29 Invalid token '(' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 54 49 MK AUTOCARE

Error 30 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression) I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 54 59 MK AUTOCARE

Error 31 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression) I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 54 62 MK AUTOCARE

Error 32 Invalid token '.' in class, struct, or interface member declaration I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 54 64 MK AUTOCARE

Error 33 Method must have a return type I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 54 65 MK AUTOCARE

Error 34 ; expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 54 75 MK AUTOCARE

Error 35 A namespace cannot directly contain members such as fields or methods I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 58 21 MK AUTOCARE

Error 36 Identifier expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 58 113 MK AUTOCARE

Error 37 Identifier expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 62 67 MK AUTOCARE

Error 38 Identifier expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 62 70 MK AUTOCARE

Error 39 A namespace cannot directly contain members such as fields or methods I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 64 21 MK AUTOCARE

Error 40 Identifier expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 64 72 MK AUTOCARE

Error 41 Type or namespace definition, or end-of-file expected I:\MK AUTO CARE FINAL PROJECT3\MK LATEST 3\MK LATEST 2\MK LATEST\MK AUTO CARE NEW\MKAUTOCARE C#\MK AUTOCARE\MK AUTOCARE\rptledger.cs 66 17 MK AUTOCARE
Dec 22 '12 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,347
1) Your method needs a return type.

2) You prematurely end your function on line 30.
Dec 23 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.