Skip to content

Pass DataSource Credentials? #32

Description

@kenvalleydc

I need to keep my SSRS datasource as "prompt for credentials" since we are also using another solution that requires that, but I'm unsure how to set the DataSourceCredentials in my solution. I get the error: System.Web.Services.Protocols.SoapException: One or more data source credentials required to run the report have not been specified.

Here's my code:

        $options = [
            'username' => $this->getParameter('ssrs_user'),
            'password' => $this->getParameter('ssrs_password')
        ];

        $ssrs = new SSRS\Report($this->getParameter('ssrs_server'), $options);
        $result = $ssrs->loadReport($this->getParameter('ssrs_base').'/'.$request->get('report'));

        $ssrs->setSessionId($result->executionInfo->ExecutionID);
        $parameters = json_decode($request->get('parameters'),true);
        $ssrs->setExecutionParameters(new SSRS\Object\ExecutionParameters($parameters));

        $output = $ssrs->render('HTML4.0'); // PDF | XML | CSV | HTML4.0 | Excel
        return $output;

What else do I need to add?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions