Maneesh A N

Maneesh A N

  • NA
  • 179
  • 109.1k

TO GET REPORT IN WINDOWS C#

Aug 28 2013 5:41 AM
 int iSalesID ;
            CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            DataSet ds = new DataSet();
            ds = fnExpenseDetailsPrint(iSalesID, AccName, FromDate,ToDate);
            string strReportPath = Application.StartupPath + "\\Reports\\Report2.rpt";
            rpt.Load(strReportPath);
            rpt.SetDataSource(ds.Tables[0]);
            rpt.Refresh();
            crystalReportViewer2.ReportSource = rpt;
            crystalReportViewer2.RefreshReport();
            crystalReportViewer2.ShowCloseButton = true;
            crystalReportViewer2.DisplayGroupTree = false;
            crystalReportViewer2.ShowRefreshButton = true;
            crystalReportViewer2.ShowGroupTreeButton = true;

           crystalReportViewer2.ShowPrintButton = true;

   ERROR
             Error    3    The best overloaded method match for 'Universal.cs.frmExpenseDetailsPrint.fnExpenseDetailsPrint(int, System.DateTime, System.DateTime, string)' has some invalid arguments    D:\New Folder\NAHUL\UNIVERSAL ENTERPRISES\Universal.cs\frmExpenseDetailsPrint.cs    102    18    Universal.cs
Error    4    Argument '2': cannot convert from 'string' to 'System.DateTime'    D:\New Folder\NAHUL\UNIVERSAL ENTERPRISES\Universal.cs\frmExpenseDetailsPrint.cs    102    50    Universal.cs
Error    5    Argument '4': cannot convert from 'System.DateTime' to 'string'    D:\New Folder\NAHUL\UNIVERSAL ENTERPRISES\Universal.cs\frmExpenseDetailsPrint.cs    102    68    Universal.cs


GIVE CODE

Answers (9)