Sunday 15 January 2012

.net - How do I use Sql Queries in Crystal Report? -


OK, I want to create a crystal report and I use Sql Queries.I have SQL queries that I Want to know how to use, but how do I use them in crystal reports? The data of crystal reports is taken from the database and I am using filtering but I should use a value from a question box, where 'Where' in my query, how do I do it? I am beginning to do dot framework

OK, let's see if you have an example in VB.net How to get to

(If you are using version of Visual Studio.NET more than 2008, then download and install Crystal Reports as it is not embedded.)

Open Create a new WindowsForms application by clicking Visual Studio.NET, File - & gt; New project - & gt; Visual Basic - In the case of Windows Form Application Visual Studio.NET 2010, you will need to change the .NET Framework to your project for .NET Framework 4 (not the subscriber profile) so that you can find the Crystal Report Viewer in the Reporting tab of the tool box. You can. Drag and drop a text box from the toolbox, a button and crystal reports over the weaver. The first two are located in the General Controls tab and the third in the Reporting tab. To create a report file, click on Project - & gt; Add new item and choose Crystal Report. After that the crystal report gallery window will appear (or if it is not, double click on the report file from the solution explorer). Either select the wizard or blank report

To create a parameter for a question, make it the same way as the paramrified query in the report file shown here. After, click on Solution Explorer and press F7 Go back to the farm by double: Add the following code inside the class of your form to enter the code view.

, "Password") End Sub Personal Sub Button1_Click (As System.Object, E. System.EventArgs) Button1.Click Report1.SetParameterValue ("ParameterName", TextBox1.Text) CrystalReportViewer1.ReportSource = Report 1 End Sub Handle

"username" and your database and parameters that you {inside? ParameterName} with the addition of "ParameterName" to "Crystal" with the addition of "Crystal" report, change "Password".

No comments:

Post a Comment