Hello everybody,
I've got a problem with a report that hast to be exported to *.pdf
The first time it worked, but the second time it didn't. How strange is that!?![]()
So when i click the button a new i.e. window shows up.
The first click works fine but when i want to open the report again the whole window is emptySomebody who know the answer??
Mycode:
VB Code:
Dim Rep As crystalDecisions.CrystalReports.Engine.ReportDocument Rep = New rptTest Dim tb As CrystalDecisions.CrystalReports.Engine.Table Dim cn As New CrystalDecisions.Shared.ConnectionInfo cn.ServerName = ******* cn.DatabaseName = ******* cn.UserID = ****** cn.Password = ******** Dim tblog As New CrystalDecisions.Shared.TableLogOnInfo For Each tb In Rep.Database.Tables tblog.ConnectionInfo = cn tb.ApplyLogOnInfo(tblog) Next Dim strStream As New System.IO.BinaryReader(Rep.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat)) Response.ClearContent() Response.ClearHeaders() Response.ContentType = "application/pdf" Response.BinaryWrite(strStream.ReadBytes(strStream.BaseStream.Length)) Response.Flush() Response.Close() strStream.Close()
By the way, if i click again on the button for de 3rd time it works fine again. The 4th time not, the 5th time fine, 6 time not etc.![]()




Somebody who know the answer??
Reply With Quote