hi,
i know to generate crystalreports in windows applications. but in webapplications i am not know how to generate crystal reports.
please tell how to generate reports in ASP.net.
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Marimuthu ArigovindasamyPosted Jun 14, 2010, 9:31 PM
ajay rajuPosted Jun 15, 2010, 1:18 AM
i am using visual web developer 2008 express edition, by default in this edition there no way to develop crystal reports. so i am export the datagrid data into the MS-Excel sheet.
any way thanks for you. if i work in visual studio that time your code is works me. so i am accepting your answer.
Thanks.
Marimuthu ArigovindasamyPosted Jun 8, 2010, 8:26 PM
Namespace:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
Code:
ReportDocument cryRpt = new ReportDocument();
ExportOptions rptExportOption;
DiskFileDestinationOptions rptFileDestOption = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions rptFormatOption = new PdfRtfWordFormatOptions();
cryRpt.Load(@"D:\Muthu\Tech\Blogs\ListView\CrystalReport2.rpt");
string reportFileName = string.Empty;
reportFileName = @"D:\Muthu\Projects\WebApplication1\WebApplication1\Report.pdf";
rptFileDestOption.DiskFileName = reportFileName;
rptExportOption = cryRpt.ExportOptions;
{
rptExportOption.ExportDestinationType = ExportDestinationType.DiskFile;
//ExportFormatType.PortableDocFormat (U can change the file type here.)
rptExportOption.ExportFormatType = ExportFormatType.PortableDocFormat;
rptExportOption.ExportDestinationOptions = rptFileDestOption;
rptExportOption.ExportFormatOptions = rptFormatOption;
}
cryRpt.Export();
Marimuthu ArigovindasamyPosted Jun 8, 2010, 8:07 PM
Crystal report design is same (Database field, formatting and etc.)
Binding:
Height="339px" ReportSourceID="CrystalReportSource1" Width="401px" />