473,503 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error list on ledger report viewer form

1 New Member
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
1 2133
Rabbit
12,516 Recognized Expert Moderator MVP
1) Your method needs a return type.

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

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

Similar topics

1
13950
by: Harshil | last post by:
Hi All, I am working on Vb.net application with oracle as my database. I have developed reports using crystal report 9. Usually when you open reports directly in crystal report viewer control it...
1
1731
by: JC - home | last post by:
This is driving me mad!! I have a report viewer on a form that is bound to a sql stored procedure that has one parameter. I just can't seem to find a way of passing a parameter to the report...
2
8149
by: zdrakec | last post by:
Hello all: I have the Crystal Report viewer imbedded on a .NET form, and it works very well... except, on the target machine, when I set the ReportSource property of the viewer (to a...
1
7494
by: monskie | last post by:
Hello to all, I have a problem which could be trivial to you guys. This concerns opening several crystal reports on the a crystal viewer on an ASPX page by calling window.open. My...
7
21708
by: steve | last post by:
Hi All I have created rdlc files and when I load them into Report Viewer at run time they appear OK If I click on 'Print layout' button on Report Viewer the view again appears acceptable ...
4
1501
by: nicomp | last post by:
VS 2005: I created a report and I added it to a report viewer on a web page. When I view the page in my browser I can see a little sliver of what might be the report on the left edge of the report...
0
1017
by: =?Utf-8?B?Q29ubnVsbA==?= | last post by:
I have designed a Report in Crystal Reports and receive no errors. If I view this Report in the Crystal Report Viewer in VB.net (2003) I get an error stating there is a problem with one of my...
0
2412
by: SwamyKarthik | last post by:
I am trying to build an app that reads crystal reports. I was able to load the Crystal report viewer as a ActiveX plugin however I'm having problems. Here's my code: Public Class Form1 ...
1
3842
by: Jassim Rahma | last post by:
anyone has a code sample to connect the Microsoft Report Viewer Control using Microsoft SQL Server stored procedure?
1
2741
by: CAM | last post by:
Hello, I am using Vista Basic.Net 2008 and I wondering what is the best way to display crystal reports in a form. I have about 10 different crystal reports what I am currently doing is using a...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.