
LogOnInfo for CR.net repor viewer and VB.net
Hello!
I have a CR viewer on a form and the following code on
the form load. The tabela.ApplyLogOnInfo(conninfo) seems
to work fine. 1st i didn't know the viewer had a
logoninfo property and i was using only the
tables.applyloginfo method but everytime i tried i got
the windows 'Database Login' to popup everytime and the
password is in blank. So i tried to add this
line 'Me.CrystalReportViewer1.LogOnInfo = conninfo' but i
won't built : 'Value of
Type 'CrystalDecisions.Shared.TableLogOnInfo' cannot be
converted to 'CrystalDecisions.Shared.TableLogOnInfo' !!
Any suggestions , i'm lost...
Another question the report has a the landscape
printoptions set but i press the print button it prints
in portrait !? I have to go to printer properties and
change orientation before printing ... Odd?
Kind Regards
Jorge Cavalheiro
<begin of code>
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim conninfo As New CrystalDecisions.Shared.TableLogOnInfo
()
Dim tabela As CrystalDecisions.CrystalReports.Engine.Table
conninfo.ConnectionInfo.ServerName = "Ares"
conninfo.ConnectionInfo.DatabaseName = "Dinefer"
conninfo.ConnectionInfo.UserID = "gest"
conninfo.ConnectionInfo.Password = "gest"
conninfo.TableName = "planeamento"
conninfo.ReportName = crystalReport11.FilePath
For Each tabela In crystalReport11.Database.Tables
tabela.ApplyLogOnInfo(conninfo)
Next
Me.CrystalReportViewer1.LogOnInfo = conninfo
Me.CrystalReportViewer1.ReportSource =
crystalReport11.FilePath
Me.CrystalReportViewer1.Show()
End Sub
<end of code>