Skip to Content
0
Sep 16, 2019 at 03:05 PM

CrystalReportSource doesn't use DataSourceRef

107 Views Last edit Sep 16, 2019 at 03:06 PM 3 rev

Hi,

I have the following code. I load up the page and CrystalReports prompts me with "The report you requested requires further information." with DB information that's saved in the report, not what I have defined in my connection string. How can this be fixed?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="StarShipWeb.WebForm1" %>


<%@ Register assembly="CrystalDecisions.Web, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>


<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" GroupTreeImagesFolderUrl="" Height="962px" ReportSourceID="CrystalReportSource1" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" Width="1344px" />
            <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
                <Report FileName="C:\CR\Address Correction Report.rpt">
                    <DataSources>
                        <CR:DataSourceRef DataSourceID="SqlDataSource1" />
                    </DataSources>
                </Report>
            </CR:CrystalReportSource>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=DEV09\STARSHIP;Initial Catalog=Starship_14;Persist Security Info=True;User ID=sa;Password=sa" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
        </div>
    </form>
</body>
</html>