Wednesday, 29 January 2014

Generate Crystal Report using Web Service in ASP.NET

Ans:-

Steps:-

1.Click File->New->Website
                 ->Choose Loation..
                 ->Choose Language..
                 ->& then Select Asp.Net WebService
                 ->ok

2.After Creation Of Project->Right Click on the Name of the Project
                           ->Select Add
                           ->Add New/Existing Item
                           ->& then select Existing Crystal Report
                               if you have Or else Select New Crystal
                               Report from Template through providing
                               DSN Paths..

3.After Selecting Crystal Report->Right Click on CrystalReport.rpt
                                ->Select Publish as Web Service
                                ->& then one new Service will Create
                                  named as CrystalReportService.asmx
                                ->Select this Service as Set As Start Page
                                ->& then Build the Solution
                                ->& then Copy this Url.

To Consume the Report Web Service from a Client Project:-

Steps:-

1.Right Click on top of Project->Add->Add New Project
                                                         ->& Now Select C#/VB.Net Language with windows Application
                                                         ->Set as Start Page to New Project
                                   
2.then Select References->Add Service References
                                     ->& in Here just Paste that Previously Created Url Or By Clicking                                                                   CrystalReport.asmx   & Selecting Copy...& then Paste here
                                     ->After done this one New Web Reference should be Create in Solution Explorer

3.& then go to the ToolBox -> Drag Crystal Report Viewer to the Windows Form
                                           ->& then Double Click on the Wondow form & View Code as
                                               InitializeComponent();
                                           ->& Space down two Spaces
                                           ->& then Enter this Code-    CrystalReportViewer1.ReportSource="http://localhost:49542/CrystalReportUsingWS/CrystalReportService.asmx"
                                          ->& then Save and Build the Solution
                   

No comments:

Post a Comment