|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: |
''' <summary>
''' This method converts a crystal report into a PDF file
''' </summary>
Private Sub ExportToStream()
Dim oStream As New IO.MemoryStream
Dim rptDocument As ReportDocument = New ReportDocument()
Dim subreport As ReportDocument
Dim parmName As String = "@MrId"
Dim parmValue As Integer = SessionData.EssInfo.MrId
Dim exportOpts As ExportOptions = New ExportOptions()
Dim pdfOpts As PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
Dim logon As New TableLogOnInfo
Dim tbl As Table
Dim serverName1 As String = PCON.APP.db_Server
Dim dbName As String = PCON.APP.dbName
Dim userID As String = PCON.APP.UserName
Dim password As String = PCON.APP.Pass
Try
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
exportOpts.ExportFormatOptions = pdfOpts
rptDocument.FileName = PCON.APP.FileName(SessionData.EssInfo.EssCategoryId)
rptDocument.SetParameterValue(parmName, parmValue)
' Set Database Logon to main report
For Each tbl In rptDocument.Database.Tables
logon = tbl.LogOnInfo
SetLogonInfo(logon)
tbl.ApplyLogOnInfo(logon)
Next tbl
'Provide database credentials to subreports
For Each subreport In rptDocument.Subreports
For Each tbl In subreport.Database.Tables
logon = tbl.LogOnInfo
SetLogonInfo(logon)
tbl.ApplyLogOnInfo(logon)
Next 'Tbl
Next 'Subreport
rptDocument.SetDatabaseLogon(userID, password, serverName1, dbName)
oStream = CType(rptDocument.ExportToStream(ExportFormatType.PortableDocFormat), IO.MemoryStream)
Response.ContentType = "application/pdf"
rptDocument.Close()
rptDocument.Dispose()
Response.BinaryWrite(oStream.ToArray())
HttpContext.Current.ApplicationInstance.CompleteRequest()
Catch ex As Exception
Response.Write(ex)
Finally
oStream.Flush()
End Try
End Sub
Private Sub SetLogonInfo(ByRef logon As TableLogOnInfo)
logon.ConnectionInfo.ServerName = PCON.APP.db_Server
logon.ConnectionInfo.DatabaseName = PCON.APP.dbName
logon.ConnectionInfo.UserID = PCON.APP.UserName
logon.ConnectionInfo.Password = PCON.APP.Pass
End Sub
|
Advertisement
| Hall of Fame |