Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Crystal Report missing data

Reply
Thread Tools

Crystal Report missing data

 
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      03-18-2005
I finally got my report to be recongized, that login issue is terrible. Using
VS.NET 2003, created report inside of it. Now when I attempt to display the
report is blank (missing data, though I can see the viewer, report fields,
etc.) I've tried setting the
rpt.SetDataSource(dstConcernInfo) in the reports VB code behind and my
viewer code-behind page. No luck. I've displayed my dataset to see that it's
full. I assume that the report can't see the data? though in VS.NET when I
created it, it asked for the structue, etc.
I've searched the C reports knowledge base and the only article I could find
was about an image issue. My report as no missing images, it's just missing
the data display???

Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Imports System.IO
Imports System.Data.Sqlclient
Imports System.Data

Public Class display_qreport
Inherits System.Web.UI.Page

Dim crReportDocument As top10bypartnumber = New top10bypartnumber

Protected WithEvents DropDownList1 As
System.Web.UI.WebControls.DropDownList
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents CrystalReportViewer1 As
CrystalDecisions.Web.CrystalReportViewer
Protected WithEvents Button2 As System.Web.UI.WebControls.Button

#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 SqlConnect As SqlConnection
Private ConnectString As String =
System.Configuration.ConfigurationSettings.AppSett ings("connectionString")

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()

Dim dstConcernInfo As DataSet
Dim dadConcernInfo As SqlDataAdapter
Dim dtConcernInfo As DataTable
dstConcernInfo = New DataSet
dadConcernInfo = New SqlDataAdapter("Select * from view_ConcernParts",
ConnectString)
dadConcernInfo.Fill(dstConcernInfo, "ConcernInfo")

' this is the most IMPORTANT line of code
' if this line is not writen the " LOGON FAILED" error starts
displaying
crReportDocument.SetDatabaseLogon("qc", "password") ', "server",
"qualitycenter")

crReportDocument.SetDataSource(dstConcernInfo)

' this will hide the group tree
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.ReportSource = crReportDocument

With DropDownList1.Items
.Add("Rich Text (RTF)")
.Add("Portable Document (PDF)")
.Add("MS Word (DOC)")
.Add("MS Excel (XLS)")
End With
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
End Sub

Sub ExportReport()

Dim oStream As New MemoryStream ' // using System.IO

Select Case DropDownList1.SelectedItem.Text 'this contains the value
of the selected export format.

Case "Rich Text (RTF)"

'--------------------------------------------------------------------

oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.W
ordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/rtf"

'--------------------------------------------------------------------


'--------------------------------------------------------------------
Case "Portable Document (PDF)"

oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.P
ortableDocFormat)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"

'--------------------------------------------------------------------


'--------------------------------------------------------------------
Case "MS Word (DOC)"

oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.W
ordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/doc"

'--------------------------------------------------------------------


'--------------------------------------------------------------------
Case "MS Excel (XLS)"

oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.E
xcel)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"

'--------------------------------------------------------------------
End Select 'export format
Try
Response.BinaryWrite(oStream.ToArray())
Response.End()
Catch err As Exception
Response.Write("< BR >")
Response.Write(err.Message.ToString)
End Try
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
ExportReport()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
crReportDocument.SetDatabaseLogon("qc", "password", "server",
"qualitycenter")
crReportDocument.PrintToPrinter(1, False, 0, 0)
End Sub
End Class

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report - No data on report =?Utf-8?B?QmVu?= ASP .Net 0 04-05-2006 02:23 PM
First time crystal report user - How do i create a crystal reports from asp.net web form? Learner ASP .Net 1 01-11-2006 08:20 PM
Reading report content using Crystal Report Viewer XI =?Utf-8?B?SmFpZ2FuZXNo?= ASP .Net 0 01-04-2006 05:09 AM
FAIL TO LOAD THE CRYSTAL REPORT USING WEB CRYSTAL REPORT VIEWER Comfort ASP .Net Web Controls 0 10-18-2004 01:35 PM
Setting a Range Parameter in a crystal report and streaming resulting report as a pdf James Wallace ASP .Net 0 10-17-2003 04:42 PM



Advertisments