Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

VS.Net working example of Web Services in Crystal Server 2008?

I've been beating my head against the wall trying to figure this out but to no avail.

Summary: I have a Crystal Reports 2008 Report with two parameters reporting on a SQL 2005 express database in a Crystal Reports Server 2008. The report works fine when I execute it in Crystal Reports 2008 and in Crystal Reports Server 2008. When I try to access it in Crystal Reports Server 2008 from a VS 2005 project using a web service I get an parameter error. It seems to work fine if parameters are suppressed.

I've setup up 3 machines with XP SP3.

Machine 1:

Crystal Reports Server 2008 (default install with enterprise logon)

Machine 2:

Crystal Reports 2008

Machine 3

VS2005 SP1

SQL2005 Express (latest sp)

I've created a table TestTable (TestTableID int, TestTableName nvarchar(200))

I've created a stored procedure called TestGet(Select TestTableID, TestTableName From TestTable Where TestID = @intTestID)

I've created a report on Machine 2 using OLEDB to connect to Machine 3.

I've uploaded the report to the Crystal Report Server 2008 and modified the database logon so it doesn't prompt me.

The report works in Crystal Reports 2008 and Crystal Reports Server 2008.

The report has two parameters. (TestID and DummyParam1)

I've created a new web site in VS2005.

I added:










All files have a File Version of 12.0.2000.683

I'm using code from Ted Ueda (Thanks Ted) and modified it for my own use:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BusinessObjects.DSWS;
using BusinessObjects.DataSource;
using BusinessObjects.Query;
using BusinessObjects.DSWS.Session;
using BusinessObjects.DSWS.BIPlatform;
using BusinessObjects.DSWS.ReportEngine;
using BusinessObjects.DSWS.BIPlatform.Constants;

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)

        // Document path
        //string crPath = FixedPaths.InfoObjects.ROOT_FOLDER + "/302782727/302782727_sp@SI_ID";
        string crPath = "path://InfoObjects/Root Folder/WWE Reports/CR2008_OLEDB_test_SP2_nodata";
        // Enterprise Web Services URL and Login Credentials.
        //string boSessionURL = "http://tueda-bexir2s2:8080/dswsbobje/services/session";
        string boSessionURL = "";

        //string boCMSName = "TUEDA-BEXIR2S2";
        string boCMSName = "myorgani-1cf481";
        string boAuthType = "secEnterprise";
        string boUsername = "Administrator";
        //string boPassword = "";
        string boPassword = "myDatabase";

        Session boSession = null;

            // Logon to Enterprise

            EnterpriseCredential boCredential = new EnterpriseCredential();
            boCredential.Domain = boCMSName;
            boCredential.AuthType = boAuthType;
            boCredential.Login = boUsername;
            boCredential.Password = boPassword;

            boSession = new Session(new Connection(boSessionURL));

            // Retrieve Document CUID

            BIPlatform biPlatform
                = BIPlatform.GetInstance(boSession, boSession.GetAssociatedServicesURL("BIPlatform")[0]);

            ResponseHolder rh = biPlatform.Get(crPath, null);

            string doc_cuid = rh.InfoObjects.InfoObject[0].CUID;

            // Retrieve ReportEngine service.

            ReportEngine reportEngine
                = ReportEngine.GetInstance(boSession, boSession.GetAssociatedServicesURL("ReportEngine")[0]);

            // Refresh document and retrieve the prompts.

            RetrieveMustFillInfo retrieveInfo = new RetrieveMustFillInfo();
            retrieveInfo.RetrievePromptsInfo = new RetrievePromptsInfo();

            DocumentInformation doc
                    = reportEngine.GetDocumentInformation(doc_cuid, null, new Action[] { new Refresh() }, null, null);
            string docRef = doc.DocumentReference;

            doc = reportEngine.GetDocumentInformation(docRef, retrieveInfo, null, null, null);
            docRef = doc.DocumentReference;

            int promptCount = doc.PromptInfo == null ? 0 : doc.PromptInfo.Length;

            FillPrompt[] fillPromptList = new FillPrompt[promptCount];

            int i = 0;
            foreach (PromptInfo promptInfo in doc.PromptInfo)
                fillPromptList<i> = new FillPrompt();
                fillPromptList<i>.ID = promptInfo.ID;

                DiscretePromptValue dvalue1, dvalue2;

                dvalue1 = new DiscretePromptValue();
                dvalue1.Value = "5";
                fillPromptList<i>.Values = new PromptValue[] { dvalue1 };
                Response.Write(promptInfo.ID + "<BR>");

            FillPrompts fillPrompts = new FillPrompts();
            fillPrompts.FillPromptList = fillPromptList;

            doc = reportEngine.GetDocumentInformation(docRef, null, new Action[] { fillPrompts }, null, null);
            docRef = doc.DocumentReference;

            retrieveInfo = new RetrieveMustFillInfo();
            retrieveInfo.RetrieveDBLogonInfo = new RetrieveDBLogonInfo();

            doc = reportEngine.GetDocumentInformation(docRef, retrieveInfo, null, null, null);
            docRef = doc.DocumentReference;

            DBLogonInfo[] dbLogonInfos = doc.DBLogonInfos;

            FillDBLogon[] dbLogon = new FillDBLogon[1];
            dbLogon[0] = new FillDBLogon();
            dbLogon[0].Name = dbLogonInfos[0].Name;
            dbLogon[0].UserName = "vantech";
            dbLogon[0].Password = "vantech";

            FillDBLogons dbLogons = new FillDBLogons();
            dbLogons.FillDBLogonList = dbLogon;

            doc = reportEngine.GetDocumentInformation(docRef, null, new Action[] { dbLogons } , null, null);
            docRef = doc.DocumentReference;

            RetrieveData retrieveData = new RetrieveData();
            RetrieveView retrieveView = new RetrieveView();

            ViewSupport viewSupport = new ViewSupport();
            viewSupport.OutputFormat = OutputFormatType.HTML;
            viewSupport.ViewType = ViewType.CHARACTER;
            viewSupport.ViewMode = ViewModeType.REPORT_PAGE;

            retrieveView.ViewSupport = viewSupport;
            retrieveData.RetrieveView = retrieveView;

            doc = reportEngine.GetDocumentInformation(docRef, null, null, null, retrieveData);
            docRef = doc.DocumentReference;
            String content = ((CharacterView)doc.View).Content;

            // Close document connection.
            doc = reportEngine.GetDocumentInformation(docRef, null, new Action[] { new Close() }, null, null);

            // Output view to web browser.

        catch (DSWSException ex)
        { Console.WriteLine(ex); }

            if (boSession != null)




When I run it I get an error at the line:

doc = reportEngine.GetDocumentInformation(docRef, retrieveInfo, null, null, null);

With the error:

{"Failed to retrieve database logon info. Information is needed before this report can be processed. (WRE 02517)"}
    base {System.Exception}: {"Failed to retrieve database logon info. Information is needed before this report can be processed. (WRE 02517)"}
    CallStackTrace: " Information is needed before this report can be processed.---- Error code:-2147213303 Error code name:invalidParameterField\n\tat Source)\n\tat Source)\n\tat Source)\n\tat com.businessobjects.dsws.wsc.reportengine.Report.getDBLogonsInfo(Unknown Source)\n\tat com.businessobjects.dsws.wsc.reportengine.DocumentAgent.handleRetrieveMustFillInfo(Unknown Source)\n\tat com.businessobjects.dsws.wsc.reportengine.DocumentAgent.handleActions(Unknown Source)\n\tat com.businessobjects.dsws.wsc.reportengine.CrystalReportEngineSoapImpl.getDocumentInformation(Unknown Source)\n\tat com.businessobjects.dsws.reportengine.ReportEngineSoapImpl.getDocumentInfo
rmation(Unknown Source)\n\tat com.businessobjects.dsws.reportengine.ReportEngineSkeleton.getDocumentInformationByMTOM(Unknown Source)\n\tat com.businessobjects.dsws.reportengine.ReportEngineMessageReceiverInOut.invokeBusinessLogic(Unknown Source)\n\tat org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(\n\tat org.apache.axis2.receivers.AbstractMessageReceiver.receive(\n\tat org.apache.axis2.engine.AxisEngine.receive(\n\tat org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(\n\tat org.apache.axis2.transport.http.AxisServlet.doPost(\n\tat javax.servlet.http.HttpServlet.service(\n\tat javax.servlet.http.HttpServlet.service(\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(\n\tat
Filter(\n\tat com.businessobjects.dsws.wsc.common.axis.FlashFilter.doFilter(Unknown Source)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(\n\tat org.apache.catalina.core.StandardContextValve.invoke(\n\tat org.apache.catalina.core.StandardHostValve.invoke(\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(\n\tat org.apache.catalina.core.StandardEngineValve.invoke(\n\tat org.apache.catalina.connector.CoyoteAdapter.service(\n\tat org.apache.coyote.http11.Http11Processor.process(\n\tat org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11Base\n\tat\n\tat\n\tat org.apache.tomcat.util.threads.ThreadPool$\n\tat\n"
    CauseDetail: "Information is needed before this report can be processed."
    CauseException: ""
    CauseID: null
    CauseMessage: "Information is needed before this report can be processed."
    ID: "2517"
    Message: "Failed to retrieve database logon info. Information is needed before this report can be processed. (WRE 02517)"
    Operation: ""
    WebServiceID: ""

I've tried several variations of this and I don't think I'm doing anything too exotic so... does anyone have an example of this working? It seems to work if I don't put any parameters in but it dies when I do.

Any help would be hugely appreciated.

Thanks in advance,


Not what you were looking for? View more on this topic or Ask a question