Advertisement

04.24.2008 at 04:38AM PDT, ID: 23349856
[x]
Attachment Details

How can I make CrystalReport get Data source Location from the Code

Asked by SystemSys in Visual Studio, Microsoft Visual Basic.Net

Tags: ,

Hi all

I have two Questions about CrystalReport  

The First Question :

How can I make CrystalReport get Data source Location from the Code (on Form load)?

because if I  used wizard and if I changed my computer I need to make set Data source Location in the customer's computer

that mean I need to make setup for VB.net 2005 in customer's computer  

That is too bad  

=====================
I used wizard
The Second Question :

I made sql statement in CrystalReport for get only one row (where Date_Person.ID_Person = 9)

but I get all rows !!!!  

why I didn't get only one row ? !!!  


Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
Public Class Form1
 
 
    Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load
 
 
        Dim dbm As New DatabaseManager
 
        Dim ds As New Data.DataSet
 
        Dim SQLs As String
 
 
 
 
        Dim rpt As New CrystalReport1
 
        rpt.Load(Application.StartupPath & "\" & "CrystalReport1.rpt")
 
        SQLs = "SELECT * from Date_Person where ID_Person=9"
 
        ds = dbm.ExecuteStatement(SQLs)
 
 
 
        rpt.SetDataSource(ds)
 
        rpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.DefaultPaperOrientation
 
        CrystalReportViewer1.ReportSource = rpt
 
        CrystalReportViewer1.Zoom(1)
 
        CrystalReportViewer1.Refresh()
 
        CrystalReportViewer1.Show()
 
 
        dbm.ClearParameters()
    End Sub
End Class
[+][-]04.24.2008 at 04:53AM PDT, ID: 21429778

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 05:14AM PDT, ID: 21429909

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 05:23AM PDT, ID: 21429980

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 10:33AM PDT, ID: 21433217

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 01:38AM PDT, ID: 21437805

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 10:51PM PDT, ID: 21498318

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio, Microsoft Visual Basic.Net
Tags: VB.net 2005 and CrystalReport, .net 2005
Sign Up Now!
Solution Provided By: rachitkohli
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628