none
reportviewer localreport failing to login RRS feed

  • Question

  • How do I configure a localreport to run on a server - running locally it works as expected. As the control is attempting to render it displays a failed login for a local box account (I dont have access to admin the deployed box). It makes sense after thinking about it but I dont see how to set the connection to use the one defined during the report wizard. I'm using the WebForm variant. I've tried looking up how to set credentials but all I've found refers to ServerReports:

    http://msdn.microsoft.com/en-us/library/aa983458(VS.80).aspx

    So attempting to implement the solution given in this article I do not see a property capable of accepting IReportServerCredentials.

                 ReportViewer1.ServerReport.ReportServerCredentials


    Here is my control declaration:
    <div class="rptViewer">
               <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
                    Font-Size="8pt" Width="640px">
                    <LocalReport ReportPath="ReportAnnualExpenseDetails.rdlc">
                        <DataSources>
                            <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                                Name="ExpenseCategoryDetails_select_ReportCategoryByYearDetail" />
                        </DataSources>
                    </LocalReport>
                </rsweb:ReportViewer>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
                    TypeName="ExpenseCategoryDetailsTableAdapters.select_ReportCategoryByYearDetailTableAdapter">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="2009" Name="SalesYear" 
                            SessionField="RptSalesYear" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
              <br />
    </div>
    Thanks!

    -Will
    Wednesday, June 10, 2009 7:45 PM

Answers

  • I dont understand why but that solved the problem. The local report needs a domain account to execute. Once I added the domain account login to the db it worked. The reason I wanted to use the reportviewer in local mode was to not deal with reporting services because these reports are small summary reports - reporting services seemed like overkill. I could have easily done them with a grid view but wanted the export to excel/pdf capability.
    -Will
    • Marked as answer by wmlpez Monday, June 15, 2009 3:42 PM
    Monday, June 15, 2009 3:42 PM

All replies

  • IReportServerCredentials is only applicable to server reports. If I understand you correctly, you have ReportViewer configured to work in local mode. It works correctly on your development box, but when the website is deployed to the server, the report stops working? If that is the case, don't worry about IReportServerCredentials, it doesn't apply here.


    What exactly is the error you are getting?

    This is either a path issue, or a datasource credentials issue.

    If it's a path issues, then your datasource is a local file such as a SQL CE database, or XML file, or what have you, and on the server it just can't find the file. Make sure the file is deployed with your website, and make sure your paths to access the file are relative and not absolute.

    If it is a credential issue, it's probably a case that your datasource is a SQL server somewhere, and the webserver doesn't have the correct permissions to access it.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, June 11, 2009 12:53 AM
  • Thanks for the response. The error is Login failed for user domain\userid. That is what confuses me. The objectsource uses the web.config entry to get data

    <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
    <Connections>
              <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="DataConn" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="DataConn (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.DataConn.ConnectionString" Provider="System.Data.SqlClient" />
    </Connections>
    which is the connectionstring used throughout the application. What appears to be happening is this domain\user is attempting to access the db. I'm also assuming that if I create a login for this domain\user that that problem will go away.
    -Will
    Thursday, June 11, 2009 4:17 PM
  • I dont understand why but that solved the problem. The local report needs a domain account to execute. Once I added the domain account login to the db it worked. The reason I wanted to use the reportviewer in local mode was to not deal with reporting services because these reports are small summary reports - reporting services seemed like overkill. I could have easily done them with a grid view but wanted the export to excel/pdf capability.
    -Will
    • Marked as answer by wmlpez Monday, June 15, 2009 3:42 PM
    Monday, June 15, 2009 3:42 PM