Web services can be used for a number of different uses, but what about reporting? Crystal Reports has long been the de-facto standard for reporting in Visual Studio and with the release of Visual Studio.NET you can now convert report files into Web services. You can then consume these Web services and deliver reports to users in and outside of your organisation. In this article we'll look at how to create a Web service from an existing report file and in part 2 of the article we'll look at how to consume the Web service you created.


Note: For this tutorial we will be using Visual Studio.NET 2003. Before you begin, make sure you have installed Visual Studio with all of the Crystal Reports components, including the option for "Crystal Web services".

To start, open Visual Studio from the Start menu and select File > New > Project to create a new ASP.NET Web Application. In this example, we are going to call the project "ReportService".

Once you have created your project, you will need to create or add an existing Crystal Report that we will be converting into a Web service. If you don't have a report handy, you can always use one of the sample reports that ships with Visual Studioâ€"they are located in C:Program FilesMicrosoft Visual Studio .NET 2003Crystal ReportsSamplesReports and in this example we are going to use the "World Sales Report.rpt" found in the General Business examples folder.

To add an existing report to your project, select Project > Add Existing Item, and change the drop-down list at the bottom of the dialog to "Crystal Reports" and browse for the report file you want to add.

Next, locate the report in the Solution Explorer and right-click directly on top of the report. In the right-click menu there is an option to "Publish as Web service". This will generate an ASMX file that you can view by right-clicking on the file name (in this case "World Sales ReportService.asmx") and selecting "View in Browser".

This preview will show you all of the operations that are allowed for your Web service, including:

• DrillGraph
• Refresh
• FindText
• GetPage
• GetTotaller
• TestReport
• GetGroupLevelData
• FindGroup
• GetLastPageNumber
• GetReportInfo
• Export

There is also a link to the formal Web service definition written using WSDL (Web Service Definition Language).

From this point, you can use this Web service in conjunction with the Crystal Report viewer to view the original report and that is where we will pick up in part 2 of this article.

Comments

1

Xavier Norman - 26/01/07

I am currently using Crstal Reports 8, connected to a SQL 2000 database, but the database is going to be updated to Microsoft Navision Database, and the reports are supposed to connect to the database via web services.

Is is possible for Crystal to use web services to communicate to a database?

If so can this be done with crystal reports 8, or do I need to upgrade and if so which version do I need?

» Report offensive content

2

Nahed - 11/05/09

Hi,

Did you find a solution for this issue, Please let me know on that email address because I have to use it now. I am using Crystal Report V 10.

I will appreciate any guideline.
Thanks, Nahed

» Report offensive content

Leave a comment

You must read and type the 6 chars within 0..9 and A..F

* indicates mandatory fields.

2

Nahed - 05/11/09

Hi, Did you find a solution for this issue, Please let me know on that email address because I have to use ... more

1

Xavier Norman - 26/01/07

I am currently using Crstal Reports 8, connected to a SQL 2000 database, but the database is going to be updated ... more

Log in


Sign up | Forgot your password?

  • Staff Aussies to pay more for Win 7

    If you are looking to make some money in these troubled times, perhaps importing copies of Windows 7 could be for you. Read more »

    -- posted by Staff

  • Staff Firefox: Greens want it, 3.5rc2 not up to par

    This week's roundup looks at the situation surrounding a campaign to change Outlook HTML renderer, a Greens MP wants to install Firefox but is restricted and all the photos from the iPhone 3GS launch. Read more »

    -- posted by Staff

  • Chris Duckett Microsoft misses the Outlook point

    Ask designers which mail program is the bane of their existence, and you'll find that Outlook tops the list. The reason why the most popular email reader is also the most painful is simple: it uses Word to render HTML emails. Read more »

    -- posted by Chris Duckett

Most popular tags

What's on?