Home > BI Platform, Crystal Reports > Crystal Reports and Web Services

Crystal Reports and Web Services

Quick Tutorial

Service Oriented Architectures are amazing.  Now more than ever companies are leveraging freely available web services to add value to their internal data.  One of the most common ways on combining data today is via Google Maps. A great example of this is housingmaps.comHousingmaps combines the power of Google Maps and CraigsList to allow you to view available housing in your area together with the power of Google Map navigation.

Today, all tools from SAP BusinessObjects can consume web services.  The most popular reporting tool in the BusinessObjects platform is Crystal Reports.  With the report creation wizard, we can be consuming a web service is seconds.  Let’s walk through it step by step.  We will connect to a web service that will provide us driving directions from Point A to Point B.

Step by Step

  1. Launch Crystal Reports 2008
  2. From the Start Page, choose Report wizard, this will launch the Standard Report Creation
  3. Next expand Create New Connection, and scroll down to XML and Web Services and expand the folder.
  4. The XML and Web Services data source  dialog box will appear.  Choose Use Web Service Data Source and choose Next>.
  5. In our case, we are going to use an HTTP Web Service, so choose Use HTTP(S) WSDL and type in:  http://www.ecubicle.net/driving.asmx?WSDL and choose Next>.
  6. This Web Service does not require a UserID/Password, so choose Next>.
  7. After a moment or two, the Web Service, Port and Method screen should appear.  You should see: driving, drivingSoap and GetDirections in the Service, Port and Method drop downs respectively.  (If this does not work, there may be a firewall issue at your location.  Check with your local IT.)  Choose Finish.
  8. After choosing Finish, you will see a ResultSet box under the http://www.ecubicle.net/ data source.  (You may need to expand it).  Move the box over to the Selected Tables side by choosing the [>] button.   When you do, you will be prompted to enter some parameters.  So far so good.
  9. There are four input parameters to this:
      fromAddress – the starting address, e.g. 3734 Elvis Presley Boulevard Memphis, TN 38186
      toAddress – the destination address, e.g. 1600 Pennsylvania Ave NW, Washington, DC 20500
      distanceUnit – miles or km, default: miles
      expresswayEnabled – true or false, default:true
  10. After entering the values choose OK.
  11. Complete the Wizard by either choosing Finished or by walking through the remaining screens.
  12. Once the fields are added to the report, you should the directs Elvis would need to take to drive to the White House.

Here is your finished report:

Leveraging Web Services from within SAP BusinessObjects couldn’t be easier.  If you are interested in seeing the same types of capabilities from within other BusinessObjects tools drop me a line and I’ll add it to the list.  Enjoy.

«Good BI»

  1. Kishore
    June 11, 2009 at 7:44 am | #1

    Hi David Taylor’s,

    Good job man. Go ahead and discover new things. All the BEST.

    Thanks

  2. Gene Hellums
    August 11, 2009 at 8:49 am | #2

    David, Thanks for this walkthru. I get all the way through the steps but in the last step to view the report I get an error:

    Cannot determine the queries necessary to get data for this report. Details: Cannot access web service. System.WebServices.Protocols.SoapException: Server was unable to process request, —> System.NullReferenceException: Object reference nto set to an instance of an object….(theres more.)

    Any Ideas?

  3. Suma
    August 21, 2009 at 7:03 am | #3

    This is great !

    Please post one for BO webi/deski report or even from the univese.

    Thanks

  4. August 23, 2009 at 9:21 pm | #4

    Okay Suma thanks for the suggestion. I can definitely do that. We can connect to Web Services via a Universe as well. For BusinessObjects XIr2, we created a new extension to the Universe called a “data feed as a universe”. There are more details here: https://www.sdn.sap.com/irj/boc/innovation-center?rid=/webcontent/uuid/50c178ec-15f2-2b10-65be-85fd40d6c001

    Now that we have Data Federator, you can also use that to connect to a web service. Then the Universe can talk to Data Federator via the JDBC/ODBC bridge.

  5. November 24, 2009 at 11:58 pm | #5

    Hi David,

    Thank you for put this tutorial available on the net;-)

    I have been trying to use webservice as data source for CrystalReports XI. I am able to go all the way till have it displayed as a database field and am able to see all the fields listed and drag-drag to my report template design view. But failed to preview it. I get this error:
    ———8<———
    Cannot determine the queries necessary to get data for this report.
    Details: Cannot access web service
    ———8<———

    Could you please advise what might be the problem?

    ps. I'm not able to connect to the http://www.ecubicle.net/driving.asmx, although I have no problem retrive the WSDL file from my browser.

    Thanks in advance

  1. No trackbacks yet.