TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
omkar mhaiskar
NA
84
0
Need Help in implementing pdf file from crystal report+send it through mail
May 24 2011 1:50 AM
Hello Friends
I am creating one project in web application in which i used crystal report. now i want to make pdf file from crystal report and i have to send it through mail. basically for this i used following code.
try
{
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = pdfFile;
CrExportOptions =
ReportDocument
.ExportOptions;//Report document object has to be given here
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
ReportDocument
.Export();
//sendmail();
}
catch (Exception ex)
{
//MessageBox.Show(ex.ToString());
}
all the other but i am geeting two error on two diff lines where i have make bold in the qustion.
this is the error for both .
An object reference is required for the non-static field, method, or property 'CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
For this i searched lot more things but i din't get proper solution.
please help me to solve the error.
Reply
Answers (
3
)
How is business logic written for a project?
Not able to import certain namespaces in c# class