Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Refreshing Crystal Reports....

Reply
Thread Tools

Refreshing Crystal Reports....

 
 
Jack
Guest
Posts: n/a
 
      10-04-2006




Hi all,
How can i refresh crystal reports?

Iam using VS.NET2003 and using vs.net i created a aspx webpage and on the
page i
placed a drop dwon list and a button...

Dropdown list will display the student no and when the user clicsk on the
button it will display the report which is created using CR.net..

But my problem is when the user changes the data in drop donw list
iam not getting the expected result...

How can i solve this problem?

Regards
Jackfadd

 
Reply With Quote
 
 
 
 
Tim_Mac
Guest
Posts: n/a
 
      10-04-2006
hi Jack,
do you have AutoPostBack = true on the DropDownList?
do you have a SelectedIndexChanged event handler on the DropDownList?
what is your code in the SelectedIndexChanged event handler?
how are you presenting the crystal report to the user?

i'm happy to help but you'll have to give us a few hooks to understand what
is going wrong

tim

"Jack" <> wrote in message
news:433591E7-6412-4592-B78B-...
>
>
>
>
> Hi all,
> How can i refresh crystal reports?
>
> Iam using VS.NET2003 and using vs.net i created a aspx webpage and on the
> page i
> placed a drop dwon list and a button...
>
> Dropdown list will display the student no and when the user clicsk on the
> button it will display the report which is created using CR.net..
>
> But my problem is when the user changes the data in drop donw list
> iam not getting the expected result...
>
> How can i solve this problem?
>
> Regards
> Jackfadd
>



 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      10-06-2006
Hello,
Thanks for the help....

Following is my full code...

Pls help me..

Imports System.Data
Imports System.Data.Odbc

Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Public Class WebForm5
Inherits System.Web.UI.Page
Private ConnStr As String
Private Conn As System.Data.Odbc.OdbcConnection
Private Comm As System.Data.Odbc.OdbcCommand
Private DataAdpt As System.Data.Odbc.OdbcDataAdapter
Private DataRead As System.Data.Odbc.OdbcDataReader
Dim MyReport As New ReportDocument
'Dim MyReport As New CrystalReport1

Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Private LogInfo As New TableLogOnInfo
#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents lstPO As System.Web.UI.WebControls.DropDownList
Protected WithEvents CrystalReportViewer1 As
CrystalDecisions.Web.CrystalReportViewer
Protected WithEvents Button1 As System.Web.UI.WebControls.Button

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ConnStr = "DSN=TGGSYSTEMDSN;Driver={Microsoft ODBC for
ORACLE};Server=TGG.world;Uid=CS22USER;Pwd=CS22USER ;"
Conn = New Odbc.OdbcConnection(ConnStr)
Conn.Open()

If Me.IsPostBack = False Then
FillPOList()
End If
End Sub
Private Sub FillPOList()
lstPO.Items.Clear()

Dim SelectSQL As String
SelectSQL = "Select DISTINCT K_PO_NUM FROM PO_DETAILS"

Dim Conn As New Odbc.OdbcConnection(ConnStr)
Dim Comm As New Odbc.OdbcCommand(SelectSQL, Conn)

Try
Conn.Open()
DataRead = Comm.ExecuteReader()
Do While DataRead.Read
Dim Newitem As New ListItem
Newitem.Text = DataRead("K_PO_NUM")
lstPO.Items.Add(Newitem)
Loop
DataRead.Close()
Catch ex As Exception

Finally
If (Not Conn Is Nothing) Then
Conn.Close()
End If
End Try
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim USERID As String = "CS22USER"
Dim PW As String = "CS22USER"

If (Not Me.IsPostBack) Then
MyReport.SetDatabaseLogon(USERID, PW)
Else
Session("MyReport") = MyReport
MyReport.Load("C:\Inetpub\wwwroot\TGG\CrystalRepor t4.rpt")
MyReport.SetDatabaseLogon(USERID, PW)
MyReport.DataDefinition.RecordSelectionFormula =
"{PO_DETAILS.K_PO_NUM}= '" & lstPO.SelectedItem.Value & "'"
CrystalReportViewer1.ReportSource = MyReport
End If
End Sub

End Class


"Tim_Mac" wrote:

> hi Jack,
> do you have AutoPostBack = true on the DropDownList?
> do you have a SelectedIndexChanged event handler on the DropDownList?
> what is your code in the SelectedIndexChanged event handler?
> how are you presenting the crystal report to the user?
>
> i'm happy to help but you'll have to give us a few hooks to understand what
> is going wrong
>
> tim
>
> "Jack" <> wrote in message
> news:433591E7-6412-4592-B78B-...
> >
> >
> >
> >
> > Hi all,
> > How can i refresh crystal reports?
> >
> > Iam using VS.NET2003 and using vs.net i created a aspx webpage and on the
> > page i
> > placed a drop dwon list and a button...
> >
> > Dropdown list will display the student no and when the user clicsk on the
> > button it will display the report which is created using CR.net..
> >
> > But my problem is when the user changes the data in drop donw list
> > iam not getting the expected result...
> >
> > How can i solve this problem?
> >
> > Regards
> > Jackfadd
> >

>
>
>

 
Reply With Quote
 
Tim_Mac
Guest
Posts: n/a
 
      10-06-2006
hi Jack,
for one thing, you have some code that makes no sense:

If (Not Me.IsPostBack) Then
MyReport.SetDatabaseLogon(USERID, PW)
Else
...

if you have a Button click event handler, then it will always be a postback.
so you should remove that code.

also, i think you have to call .DataBind() on the report viewer.
hope this helps
tim

 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      10-11-2006
Hello Tim,
Thanks for the help...

You gave me a wonderful tip and with that I could make it work fine...

Now iam struck with double byte character display and printing of the report
direclty from CR..

Do you have any idea how to rectify the above said problems?

Regards
Jack

"Tim_Mac" wrote:

> hi Jack,
> for one thing, you have some code that makes no sense:
>
> If (Not Me.IsPostBack) Then
> MyReport.SetDatabaseLogon(USERID, PW)
> Else
> ...
>
> if you have a Button click event handler, then it will always be a postback.
> so you should remove that code.
>
> also, i think you have to call .DataBind() on the report viewer.
> hope this helps
> tim
>

 
Reply With Quote
 
Tim_Mac
Guest
Posts: n/a
 
      10-11-2006
hi Jack,
i don't know what a double byte character is. sorry mate!

"Jack" <> wrote in message
news:9AF91EFE-CD36-4DC3-8845-...
> Hello Tim,
> Thanks for the help...
>
> You gave me a wonderful tip and with that I could make it work fine...
>
> Now iam struck with double byte character display and printing of the
> report
> direclty from CR..
>
> Do you have any idea how to rectify the above said problems?
>
> Regards
> Jack
>
> "Tim_Mac" wrote:
>
>> hi Jack,
>> for one thing, you have some code that makes no sense:
>>
>> If (Not Me.IsPostBack) Then
>> MyReport.SetDatabaseLogon(USERID, PW)
>> Else
>> ...
>>
>> if you have a Button click event handler, then it will always be a
>> postback.
>> so you should remove that code.
>>
>> also, i think you have to call .DataBind() on the report viewer.
>> hope this helps
>> tim
>>



 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      10-12-2006
Hello Tim,
Sorry friend , I think my question was not clear to you...

I wanted to display report in Japanese i mean to say the datas that are
stored in Oralce9i database are in Japanese and I wanted to display them as
it is...

This is my problem...

Regards
Jack

"Tim_Mac" wrote:

> hi Jack,
> i don't know what a double byte character is. sorry mate!
>
> "Jack" <> wrote in message
> news:9AF91EFE-CD36-4DC3-8845-...
> > Hello Tim,
> > Thanks for the help...
> >
> > You gave me a wonderful tip and with that I could make it work fine...
> >
> > Now iam struck with double byte character display and printing of the
> > report
> > direclty from CR..
> >
> > Do you have any idea how to rectify the above said problems?
> >
> > Regards
> > Jack
> >
> > "Tim_Mac" wrote:
> >
> >> hi Jack,
> >> for one thing, you have some code that makes no sense:
> >>
> >> If (Not Me.IsPostBack) Then
> >> MyReport.SetDatabaseLogon(USERID, PW)
> >> Else
> >> ...
> >>
> >> if you have a Button click event handler, then it will always be a
> >> postback.
> >> so you should remove that code.
> >>
> >> also, i think you have to call .DataBind() on the report viewer.
> >> hope this helps
> >> tim
> >>

>
>
>

 
Reply With Quote
 
Tim_Mac
Guest
Posts: n/a
 
      10-12-2006
hi Jack,
i also don't know much about character encoding problems with crystal
reports.
i'd say you'd have better luck starting a new thread.
good luck
tim

"Jack" <> wrote in message
news:3C06BEBC-451C-4270-8EB1-...
> Hello Tim,
> Sorry friend , I think my question was not clear to you...
>
> I wanted to display report in Japanese i mean to say the datas that are
> stored in Oralce9i database are in Japanese and I wanted to display them
> as
> it is...
>
> This is my problem...
>
> Regards
> Jack
>
> "Tim_Mac" wrote:
>
>> hi Jack,
>> i don't know what a double byte character is. sorry mate!
>>
>> "Jack" <> wrote in message
>> news:9AF91EFE-CD36-4DC3-8845-...
>> > Hello Tim,
>> > Thanks for the help...
>> >
>> > You gave me a wonderful tip and with that I could make it work fine...
>> >
>> > Now iam struck with double byte character display and printing of the
>> > report
>> > direclty from CR..
>> >
>> > Do you have any idea how to rectify the above said problems?
>> >
>> > Regards
>> > Jack
>> >
>> > "Tim_Mac" wrote:
>> >
>> >> hi Jack,
>> >> for one thing, you have some code that makes no sense:
>> >>
>> >> If (Not Me.IsPostBack) Then
>> >> MyReport.SetDatabaseLogon(USERID, PW)
>> >> Else
>> >> ...
>> >>
>> >> if you have a Button click event handler, then it will always be a
>> >> postback.
>> >> so you should remove that code.
>> >>
>> >> also, i think you have to call .DataBind() on the report viewer.
>> >> hope this helps
>> >> tim
>> >>

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NEWBIE - Crystal Report not Refreshing Dave ASP .Net 3 07-06-2009 06:00 AM
Refreshing Crystal Reports.... =?Utf-8?B?SmFjaw==?= ASP .Net 0 10-04-2006 01:42 AM
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net 1 08-04-2006 01:13 PM
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net Web Controls 0 08-03-2006 12:29 PM
Refreshing a Crystal Report from a Viewer Krishna Karthik ASP .Net 1 10-28-2003 03:22 AM



Advertisments