In this article I will explain how to pass parameters to crystal reports using asp.net.
In Previous post I explained clearly about how to create crystal report using asp.net. Now I will explain how to load crystal reports based on parameters using asp.net. This post is continuation of previous post Create crystal report using asp.net. if you didn’t read previous post crystal reports please check that one then come to this one because I am continuing from previous post in that I explained clearly to create the database tables and bind the reports and display it on page.
Enter UserName: <asp:TextBox ID="txtUserName" runat="server"/>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" />
SELECT UserId, UserName, FirstName, LastName, Location FROM UserInformation
SELECT UserId, UserName, FirstName, LastName, Location FROM UserInformation WHERE (UserName LIKE '%' + @Name + '%')
protected void btnSubmit_Click(object sender, EventArgs e)