Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Steps to link a report to Web Application Form. Post Your Opinion

Hi friends,

After going through it what is your opinion. please do post your opinion.

Could any one give the complete steps of Linking a report to web form so that when called / clicked the link the report can display the data.

I have unchecked the "Report Option -> Save Data with Reports". So that the report could not take extra space.

I have DB connection code in my .aspx.vb file, it is as follows:

Private Sub ConfigureCrystalReports()

Dim fileName As String = "Reports\" & ReportID & ".rpt"

Dim reportPath As String = Server.MapPath(fileName)

myRepDoc = New ReportDocument()


myCrystalReportViewer.ReportSource = myRepDoc


Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()

If Session("reportConnectionInfo") IsNot Nothing Then

Dim ConnInforArrList As ArrayList = DirectCast(Session("reportConnectionInfo"), ArrayList)

myConnectionInfo.ServerName = ConnInforArrList(0)

myConnectionInfo.DatabaseName = ConnInforArrList(1)

myConnectionInfo.UserID = ConnInforArrList(2)

myConnectionInfo.Password = ConnInforArrList(3)


lblMessage.ForeColor = Drawing.Color.Red

lblMessage.Text = "Session is off. Please Relogin to See the Report."

End If

SetDBLogonForReport(myConnectionInfo, myRepDoc)

SetDBLogonForSubreports(myConnectionInfo, myRepDoc)

myCrystalReportViewer.SelectionFormula = GetFieldName(ReportID) & "='" & Session("CompCode") & "'"

myCrystalReportViewer.Visible = True

End Sub

Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)

Dim myTables As Tables = myReportDocument.Database.Tables

For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables

Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo

myTableLogonInfo.ConnectionInfo = myConnectionInfo



End Sub

Private Sub SetDBLogonForSubreports(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)

Dim mySections As Sections = myReportDocument.ReportDefinition.Sections

For Each mySection As Section In mySections

Dim myReportObjects As ReportObjects = mySection.ReportObjects

For Each myReportObject As ReportObject In myReportObjects

If myReportObject.Kind = ReportObjectKind.SubreportObject Then

Dim mySubreportObject As SubreportObject = CType(myReportObject, SubreportObject)

Dim subReportDocument As ReportDocument = mySubreportObject.OpenSubreport(mySubreportObject.SubreportName)

SetDBLogonForReport(myConnectionInfo, subReportDocument)

If myReportObject.Name = "Subreport1" Then

Dim lvSec As Section = subReportDocument.ReportDefinition.Sections("DetailSection1")

If Not lvSec Is Nothing Then

Dim t1 As TextObject

t1 = lvSec.ReportObjects("txtEmpName")

t1.Text = Session.Contents("EmpName")

Dim t2 As TextObject

t2 = lvSec.ReportObjects("txtRepID")

t2.Text = Request.QueryString("REPID")

End If

End If

End If



End Sub

Please do help me out as the data of report is not getting displayed on the report.

After going through it what is your opinion. please do post your opinion.

While creating the Report has the following Report Options on / checked.

1. Database Server is Case-Incensitive

2. Use Indexes Or Server For Speed

3. Verify on First Refresh

4. Show Preview Panel

5. Display Alerts on Refresh

6. Select Distinct Data for Browsing

Do I have check or uncheck any other option?

Thanks and regards

Edited by: Md. Mushtaque on Sep 6, 2008 2:50 PM

Edited by: Md. Mushtaque on Sep 8, 2008 9:27 AM

Edited by: Md. Mushtaque on Sep 8, 2008 12:14 PM

Former Member
Not what you were looking for? View more on this topic or Ask a question