AptDev
asked on
Crystal Report ASP Stream to PDF "Failed to retrieve data from the database"
I have a Crystal Report (version XI) that I launch from a VB.NET Web App. It has worked for months. Then, yesterday, it suddently stopped working. I redeployed my files to the web server, thinking maybe something got corrupted out there, but it didn't help. The code I am using to run the Crystal Report (that worked fine for a long time) is as follows:
Private Sub ShowReportEmbedded()
Dim oRpt As sl_List4
oRpt = New sl_List4
oRpt.SetDatabaseLogon(strU ser, strPassword)
sSQL.Length = 0
sSQL.Append(" {SL_LIST.ListSite} = '" & Request.Item("slSite").ToS tring & "' ")
sSQL.Append("AND {SL_LIST.ListRev} = '" & Request.Item("slRev").ToSt ring & "' ")
sSQL.Append("AND date({SL_LIST.ShipListDate }) = date('" & CDate(Left(Request.Item("s lDate").To String, 2) & "-" & Mid(Request.Item("slDate") .ToString, 3, 3) & "-" & Right(Request.Item("slDate ").ToStrin g, 2)) & "') ")
oRpt.RecordSelectionFormul a = sSQL.ToString
Dim st As System.IO.MemoryStream
st = oRpt.ExportToStream(Crysta lDecisions .[Shared]. ExportForm atType.Por tableDocFo rmat)
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/PDF"
Response.AddHeader("Conten t-Disposit ion", "inline; filename=list.pdf")
Response.BinaryWrite(st.To Array)
Response.Flush()
Response.Close()
End Sub
The error says: Failed to retrieve data from the database.
Any ideas?
Private Sub ShowReportEmbedded()
Dim oRpt As sl_List4
oRpt = New sl_List4
oRpt.SetDatabaseLogon(strU
sSQL.Length = 0
sSQL.Append(" {SL_LIST.ListSite} = '" & Request.Item("slSite").ToS
sSQL.Append("AND {SL_LIST.ListRev} = '" & Request.Item("slRev").ToSt
sSQL.Append("AND date({SL_LIST.ShipListDate
oRpt.RecordSelectionFormul
Dim st As System.IO.MemoryStream
st = oRpt.ExportToStream(Crysta
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/PDF"
Response.AddHeader("Conten
Response.BinaryWrite(st.To
Response.Flush()
Response.Close()
End Sub
The error says: Failed to retrieve data from the database.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Anytime you change the table you need to VERIFY THE DATABASE in Crystal. Under the DATABASE menu
Glad i could help
mlmcc
Glad i could help
mlmcc
ASKER
sSQL.Append("AND {SL_LIST.ShipListDate} = datetime('" & CDate(Left(Request.Item("s
Thank you both for your endless help on this forum!