Hello,
I am gettign an error while I am using Crystal Report 9 with asp.net 1. Actually, till yesterday I it was working fine and today, I have changed the position of my computer. I don't know what happened. Please help.
Error is
1) C:\Schooloutlook\FormFile\Report\MForm7.aspx.vb(77): 'LogOnInfo' is not a member of 'Schools.Table'.
2) C:\Schooloutlook\FormFile\Report\MLocalDensity.aspx.vb(118): 'Location' is not a member of 'Schools.Table'.
Thanks
CeemaOpen the report and Do verify database
Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts
Wednesday, March 21, 2012
Monday, March 19, 2012
Logon Failure during exporting
Using Crystal Report for VS.Net in one of my .Net project, to connect to Oracle database "myDB" to generate a report. Things seems OK till it hits the "ExportToDisk" method, and gave me a "Logon Failure" exception.
Googled around and somebody said that I have to use "setDatabaseLogon()" method to set the uid/pass during runtime. So I did but it still didn't work.
Here's my source code, hope somebody could shed some light on this. Thanks !
******************************
"myConnection" is an estabilished OleDbConnection that was used repeatedly through the project. "dsTemp" is a dataset
******************************
Dim rptWKIT As New crWKIT()
Dim exportFileName As String = "exportedReport.rpt"
Dim exportPath As String = Application.StartupPath & "\" & exportFileName
Try
dsTemp.Clear()
Dim myDA As New OleDb.OleDbDataAdapter()
Dim myCmd As New OleDb.OleDbCommand()
myCmd.Connection = myConnection
myCmd.CommandText = "SELECT * FROM WKIT"
myCmd.CommandType = CommandType.Text
myDA.SelectCommand() = myCmd
myDA.Fill(dsTemp, "WKIT")
rptWKIT.SetDataSource(dsTemp)
rptWKIT.SetDatabaseLogon(sUser, sPass)
rptWKIT.Load()
rptWKIT.ExportToDisk(ExportFormatType.RichText, exportPath)
Catch x As Exception
MessageBox.Show(x.Message + x.Source + x.StackTrace, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End TrySee if you find asnwer here
http://support.businessobjects.com/|||Thanks. I just figured this out... after the rptWKIT.SetDataSource(dsTemp), there's no need to do the next 2 steps:
rptWKIT.SetDatabaseLogon(sUser, sPass)
rptWKIT.Load()
It can just export without any problem. But when do Load() again, guess CR is confused...|||Glad to know you sorted it out :)
Googled around and somebody said that I have to use "setDatabaseLogon()" method to set the uid/pass during runtime. So I did but it still didn't work.
Here's my source code, hope somebody could shed some light on this. Thanks !
******************************
"myConnection" is an estabilished OleDbConnection that was used repeatedly through the project. "dsTemp" is a dataset
******************************
Dim rptWKIT As New crWKIT()
Dim exportFileName As String = "exportedReport.rpt"
Dim exportPath As String = Application.StartupPath & "\" & exportFileName
Try
dsTemp.Clear()
Dim myDA As New OleDb.OleDbDataAdapter()
Dim myCmd As New OleDb.OleDbCommand()
myCmd.Connection = myConnection
myCmd.CommandText = "SELECT * FROM WKIT"
myCmd.CommandType = CommandType.Text
myDA.SelectCommand() = myCmd
myDA.Fill(dsTemp, "WKIT")
rptWKIT.SetDataSource(dsTemp)
rptWKIT.SetDatabaseLogon(sUser, sPass)
rptWKIT.Load()
rptWKIT.ExportToDisk(ExportFormatType.RichText, exportPath)
Catch x As Exception
MessageBox.Show(x.Message + x.Source + x.StackTrace, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End TrySee if you find asnwer here
http://support.businessobjects.com/|||Thanks. I just figured this out... after the rptWKIT.SetDataSource(dsTemp), there's no need to do the next 2 steps:
rptWKIT.SetDatabaseLogon(sUser, sPass)
rptWKIT.Load()
It can just export without any problem. But when do Load() again, guess CR is confused...|||Glad to know you sorted it out :)
Logon Failed error in Crystal Reports
HI,
I have two tables T1 and T2 in Crystal Reports . I want to display 2 fields from T1 and 1 field from T2. I am using a dataset to populate the fields in the report. But I am getting Logon Failed error. The report displays fine when only one tables is used .
Please help me .
Thanks in advance.
AswiniDid you relate those two tables by the Keycolumn?
Do you have permission to access the tables?
I have two tables T1 and T2 in Crystal Reports . I want to display 2 fields from T1 and 1 field from T2. I am using a dataset to populate the fields in the report. But I am getting Logon Failed error. The report displays fine when only one tables is used .
Please help me .
Thanks in advance.
AswiniDid you relate those two tables by the Keycolumn?
Do you have permission to access the tables?
logon failed
hi
i am using crystal reports9 in vb6 with access database.
i Created one report called rep_customer
and wroted code on button_click event to call report from vb
vbcode---------------
public sub cust_report_button_click
connect
Set r = New ADODB.Recordset
ReportNameVar = App.Path & "\reports\rep_customers.rpt"
r.Open "select * from cust ", c, adOpenDynamic, adLockOptimistic
Set report = crxApplication.OpenReport(ReportNameVar, 1)
report.Database.SetDataSource r
CRViewer91.ReportSource = report
Rep_form.ViewReport
Rep_form.Show
End Sub
------------------
it;s working fine
i created one more report Called Purchase_order based
on two tables (purchase_order,purchase_order_details)
and wroted code on button_click event to call report from vb
vbcode---------------
public sub Purchase_report_button_click
connect
Set r = New ADODB.Recordset
ReportNameVar = App.Path & "\reports\rep_purchase.rpt"
r.Open "select Purchase_order.pono,purchase_order.date,
Purchase_order_details.Product_code ,Purchase_order_details.product_description
from purchase_order,purchase_order_details
where purchase_order.pono=purchase_order_details.pono ", c, adOpenDynamic, adLockOptimistic
Set report = crxApplication.OpenReport(ReportNameVar, 1)
report.Database.SetDataSource r
CRViewer91.ReportSource = report
Rep_form.ViewReport
Rep_form.Show
End Sub
---------------------
i am getting error like
logon failed
Details:Ado Error Code 0x80040e4d
Microsoft Jet Database Engine
Description not a valid password
sql stated 3031
Report is working fine in Desiging and Preview of Crystal Designer Environment
i am sure no problem in database connection username and password
because i am using same connection for customer report.
i hope Only the Problem while Calling from vb6 when report having 2 tables
Where is the Problem ?how Can i solve this One
Can Any one Help meOpen the report and Do verify Database
i am using crystal reports9 in vb6 with access database.
i Created one report called rep_customer
and wroted code on button_click event to call report from vb
vbcode---------------
public sub cust_report_button_click
connect
Set r = New ADODB.Recordset
ReportNameVar = App.Path & "\reports\rep_customers.rpt"
r.Open "select * from cust ", c, adOpenDynamic, adLockOptimistic
Set report = crxApplication.OpenReport(ReportNameVar, 1)
report.Database.SetDataSource r
CRViewer91.ReportSource = report
Rep_form.ViewReport
Rep_form.Show
End Sub
------------------
it;s working fine
i created one more report Called Purchase_order based
on two tables (purchase_order,purchase_order_details)
and wroted code on button_click event to call report from vb
vbcode---------------
public sub Purchase_report_button_click
connect
Set r = New ADODB.Recordset
ReportNameVar = App.Path & "\reports\rep_purchase.rpt"
r.Open "select Purchase_order.pono,purchase_order.date,
Purchase_order_details.Product_code ,Purchase_order_details.product_description
from purchase_order,purchase_order_details
where purchase_order.pono=purchase_order_details.pono ", c, adOpenDynamic, adLockOptimistic
Set report = crxApplication.OpenReport(ReportNameVar, 1)
report.Database.SetDataSource r
CRViewer91.ReportSource = report
Rep_form.ViewReport
Rep_form.Show
End Sub
---------------------
i am getting error like
logon failed
Details:Ado Error Code 0x80040e4d
Microsoft Jet Database Engine
Description not a valid password
sql stated 3031
Report is working fine in Desiging and Preview of Crystal Designer Environment
i am sure no problem in database connection username and password
because i am using same connection for customer report.
i hope Only the Problem while Calling from vb6 when report having 2 tables
Where is the Problem ?how Can i solve this One
Can Any one Help meOpen the report and Do verify Database
Subscribe to:
Posts (Atom)