22 April, 2012

Crystal report in ASP.NET

DataTable oDT=null;
ReportDocument rpt;


private void ReportGenerate()
{
    try
    {
        /* Get Data table or data set of report, Remember the dataTable must  
   be the same name of Adding dataset datatable in project*/
 oDT = GetRptSentToFinance();
       rpt = new ReportDocument();
       /* Set the crystal report path*/    
       rpt.Load(Server.MapPath("~\\Report\\ReportName.rpt"));
       rpt.SetDataSource(oDT);
       /* Set the report viewer data source*/    
       rptViewer.ReportSource = rpt;                              
    }
    catch(Exception ex) {
    lblMsg.Text = "Report Generate Failure: " + ex.ToString();
    }
}


protected void Page_Load(object sender, EventArgs e)
{
      ReportGenerate();
}

Could not load crystal report or Crystal Decisions DLL in server PC or IIS server?

Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

DLL list that you need to copy in bin folder :
  • CrystalDecisions.Web
  • CrystalDecisions.Shared
  • CrystalDecisions.ReportSource
  • CrystalDecisions.CrystalReports.Engine
  • CrystalDecisions.ReportAppServer.ClientDoc
  • CrystalDecisions.Enterprise.Framework
  • CrystalDecisions.Enterprise.InfoStore 
You can find some dll in C:\Program Files\Business Objects\Common\2.8\managed\  this location

but some are load from assembly,
so, no need to copy any dll in bin folder,
 just install this msi, ats solve all problem.
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5\CRRedist2008_x86.msi

So enjoy crystal report.
 

18 April, 2012

How to increase recent project items quota in Visual Studio?

Try following steps........
1. Go Visual Studio>>Tools>>Options




 2. Environment>>General
 

 3. Change items shown in window menu value.


Enjoy.......................