I'm trying to get started with Crystal Reports using a reduced code approach. I tried inserting a SqlDataSource, CrystalReportViewer and CrystalReportSource as you can see below, with nothing inserted in the codebehind.
I do other consults to the same database with the connectionstring used here and defined at web.config so that's not the problem (i think). Shouldn't i be able to at least get past the login screen with that, and if not, what am i doing wrong at the moment?
Code:<formid="form1"runat="server"> <div> <asp:SqlDataSourceID="SqlDataSource1"runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [Report] WHERE ([CodeU] = ?)"> <SelectParameters> <asp:QueryStringParameterName="CodeU"QueryStringField="codeQS" Type="Int32"/> </SelectParameters> </asp:SqlDataSource> <CR:CrystalReportSourceID="CrystalReportSource1"runat="server"> <ReportFileName="Print.rpt"> <DataSources> <%--TableName="Report" --%> <CR:DataSourceRefDataSourceID="SqlDataSource1"/> </DataSources> </Report> </CR:CrystalReportSource> <CR:CrystalReportViewerID="CrystalReportViewer1"runat="server" AutoDataBind="True"GroupTreeImagesFolderUrl=""Height="1202px" ReportSourceID="CrystalReportSource1"ToolbarImagesFolderUrl="" ToolPanelWidth="200px"Width="1104px"/> </div> </form>


Reply With Quote