Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Crystal Report VS2008 Post Reply Post New Topic
Author Message
Naveed_786
Newbie
Newbie


Joined: 20 Oct 2011
Location: Pakistan
Online Status: Offline
Posts: 13
Quote Naveed_786 Replybullet Topic: Crystal Report VS2008
    Posted: 30 Nov 2011 at 6:36pm
Dear All,
 
I have created a crystal report from two tables, when i run crystal report it asks password.

When i create a report from one table it didn't ask for password.

How can i run report without passing password

Imports System.Data.OracleClient
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Public Class frm_wo_byid_rep
    Private mydataset As DataSet
    Private myDA As OracleDataAdapter
    Private myDA1 As OracleDataAdapter
    Dim rpt As New wo_no_rep_byid
#Region "Constructors"
    Public Sub New(ByVal strTextBox As String)
        InitializeComponent()
        TextBox1.Text = strTextBox
        TextBox2.Text = strTextBox
    End Sub
#End Region
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnrep.Click
        If TextBox1.Text = "" Or TextBox2.Text = "" Then
            MessageBox.Show("Please enter Wo No!", "PCHR", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            TextBox1.Focus()
            Exit Sub
        End If
        'Dim PFD As ParameterFieldDefinition
        Dim PValues As ParameterValues
        Dim Parm As ParameterDiscreteValue

        Try
            myDA = New OracleDataAdapter("SELECT * FROM WO WHERE WO_NO= '" & TextBox1.Text & "'", ConnectionString)
            myDA1 = New OracleDataAdapter("SELECT * FROM ITEM WHERE item_code = '" & TextBox2.Text & "'", ConnectionString)
            Dim builder As OracleCommandBuilder = New OracleCommandBuilder(myDA)
            Dim builder1 As OracleCommandBuilder = New OracleCommandBuilder(myDA1)
            mydataset = New DataSet()
            myDA.Fill(mydataset, "WO")
            myDA1.Fill(mydataset, "WO")
            rpt.SetDataSource(mydataset)
            CrystalReportViewer1.ReportSource = rpt
            TextBox1.Visible = False
            TextBox2.Visible = False
            btnrep.Visible = False
            btnexit.Visible = False
            'Label1.Visible = False
            'Label2.Visible = False
            PValues = New ParameterValues
            'PFD = rpt.DataDefinition.ParameterFields.Item("User")
            Parm = New ParameterDiscreteValue
            Parm.Value = Username
            PValues.Add(Parm)
            'PFD.ApplyCurrentValues(PValues)
            CrystalReportViewer1.DisplayGroupTree = False
        Catch Excep As Exception
            MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub
    Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
        Dim a As Integer
        a = MessageBox.Show("Are you sure you want to exit????", "ITPCHR", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
        If a = vbYes Then
            Me.Close()
        Else
            Exit Sub
        End If
    End Sub
End Class

Some Thing is Better Than Nothing
IP IP Logged
Naveed_786
Newbie
Newbie


Joined: 20 Oct 2011
Location: Pakistan
Online Status: Offline
Posts: 13
Quote Naveed_786 Replybullet Posted: 30 Nov 2011 at 9:41pm
I have resolved the issue by creating a view in oracle.
Some Thing is Better Than Nothing
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.