Tuesday, 5 February 2013

Crystal Report viewer not showing(displaying) in toolbox visual studio 2005|2008.


How to add crystal Report viewer   in toolbox
when you are trying to add crystal report viewer in your .aspx form and if you are not getting
that module in toolbox simply do one thing.
Just right click on toolbox >add new tab -> write Reporting or whtever name you want to give your module.

step 1->right click on toolbox  new box will appear blank just give name to box.optin will appear add tab.
give any defalt tab name.



step2->right click on add given  tab name.and select choose item which you want to import.






NOW BOX WILL OPEN TO GIVE YOU MORE REFERENCES SO YOU CAN CHOOSE AS PER YOUR REQUIREMENT.
now here you will get reference of crystal report viewer to add in your toolbox.select all the reference which belongs or useful in designing of crystal report.
Now After all step just go  to your toolbox left side and check by clicking + sign .whatever name you had specified to crystal report tab.
now you can open your .aspx  page and drag report viewer from report tab  from toolbox.



Wednesday, 22 August 2012

How to display crystal report in pdf | Exel | Word format | With Code

How to display crystal report in pdf | Exel | Word format | With Code
We can display crystal report in many format like pdf format , Exel Format . Word Fortmat.
Now using below code you can develop logic to display record in Browser also.

Import the following important namespace
using CrystalDecisions.CrystalReports;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Web;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web.Design;


Under CrystalReportViewer1_Init write down your data table or dataset code to retrieve data.
From database .

Make CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
and write the code
Session["data"] = Session["data"].ToString();
if (Session["data"] != null)
{
lblPdf.Text = Session["Ft"].ToString();
if (lblpdf.Text == "Pdf")
{
YourReportObject.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "your dataAdapter Name or report name");
}
For Exel Format :-
Just Write ExportFormatType.Excel,

For WorFormat:-

ExportFormatType.RichText

Types of error in Crystal report

Types of error in Crystal report
Parser Error Message: The base class includes the field 'CrystalReportViewer1', but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportViewer


Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

it shows that missing to add any assembly or   compatibility problem is there