By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

crystal reports

P: 18
Can anyone tell me why my crystal report is not showing my data?
Sep 5 '07 #1
Share this Question
Share on Google+
9 Replies


VBPhilly
P: 95
Can anyone tell me why my crystal report is not showing my data?
What version of CR?
I only know up to 8.5.
Sep 5 '07 #2

hariharanmca
100+
P: 1,977
Can anyone tell me why my crystal report is not showing my data?
  • Explain your problem detail.
  • Mention your CR Versions
  • Show your CR to Database connection (VB) code
  • throw what is the error you are getting
Sep 6 '07 #3

P: 18
I'm using crystal reports 10 and it's not throwing an error or anything. My data is just not showing. A couple of weeks ago it was working, but recently I was trying to open my crystal report in a popup window and that's when It started giving me problems. I've tried to back track myself but I don't know if I deleted something or what. By the was I'm pulling the data from a stored procedure. Here's the code......

Imports System.Data.SqlClient

Public Class PD
Inherits System.Web.UI.Page
Protected WithEvents crystalreport1 As FireworksPermitApp.CrystalReport1
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer

Dim strTransactionNumber As String
Dim DBConn As SqlConnection
Dim MyReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub


'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region



Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Response.Write("<script language=javascript>alert(""Please print application for your records!"");</script>")

Try
strTransactionNumber = Session("TransactionNumber")
SpWithViewer(strTransactionNumber)
CrystalReportViewer1.DataBind()
Catch ex As Exception

End Try

End Sub

Private Sub SpWithViewer(ByVal spParameter As String)
Dim ParameterFields As CrystalDecisions.Shared.ParameterFields
Dim ParameterField As CrystalDecisions.Shared.ParameterField
Dim spValue As CrystalDecisions.Shared.ParameterDiscreteValue
ParameterFields = New CrystalDecisions.Shared.ParameterFields
ParameterField = New CrystalDecisions.Shared.ParameterField
ParameterField.ParameterFieldName = "@vchTransactionNumber"
spValue = New CrystalDecisions.Shared.ParameterDiscreteValue
spValue.Value = (spParameter)
ParameterField.CurrentValues.Add(spValue)
ParameterFields.Add(ParameterField)
CrystalReportViewer1.ParameterFieldInfo = ParameterFields
CrystalReportViewer1.ReportSource = crystalreport1
End Sub


End Class
Sep 6 '07 #4

hariharanmca
100+
P: 1,977
I'm using crystal reports 10 and it's not throwing an error or anything. My data is just not showing. A couple of weeks ago it was working, but recently I was trying to open my crystal report in a popup window and that's when It started giving me problems. I've tried to back track myself but I don't know if I deleted something or what. By the was I'm pulling the data from a stored procedure. Here's the code......
  • Code is in VB.NET
  • Did you check with parameter fields?
  • Is data available to that parameter value?
  • Dim DBConn As SqlConnection is not in use
  • Check the Database connection (i think it's not here!)

If this is not throwing any error then; the problem is with the parameter value.
Sep 6 '07 #5

P: 18
I checked the parameter fields. There is data in the fields. The connection is correct. the stored procedure works fine. Is there something else I'm suppose to add after declaring the sqlconnection?
Sep 6 '07 #6

hariharanmca
100+
P: 1,977
I checked the parameter fields. There is data in the fields. The connection is correct. the stored procedure works fine. Is there something else I'm suppose to add after declaring the sqlconnection?

Can you explain where you are connection CR to Database?
Sep 7 '07 #7

QVeen72
Expert 100+
P: 1,445
Hi,

What is ur Back end database, u will have to Set Log on Info/ UserName/Password, for all the Tables, used in the report..

REgards
Veena
Sep 7 '07 #8

hariharanmca
100+
P: 1,977
Hi,

What is ur Back end database, u will have to Set Log on Info/ UserName/Password, for all the Tables, used in the report..

REgards
Veena
My gasses, that is Sql Server!
Sep 7 '07 #9

QVeen72
Expert 100+
P: 1,445
Hi,

and u have to Import these Classes :

Expand|Select|Wrap|Line Numbers
  1. Imports CrystalDecisions.Shared
  2. Imports CrystalDecisions.CrystalReports.Engine
  3.  
REgards
Veena
Sep 7 '07 #10

Post your reply

Sign in to post your reply or Sign up for a free account.