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

Crystal Report Viewer displays Blank Object

P: n/a
Hello all:

I have the Crystal Report viewer imbedded on a .NET form, and it works
very well... except, on the target machine, when I set the ReportSource
property of the viewer (to a ReportDocument object), it PRETENDS to
load a report, but displays a blank object. The toolbar becomes active,
the navigation buttons are active, but otherwise the viewer does not
have the report loaded. Clicking the "Refresh" button of the viewer at
this point actually results in the report toolbar being disabled.

Mind you, the component is correctly registered via the merge modules,
and the database authentication is handled in the code. In fact, the
app works perfectly IF the target machine happens to have VS.NET
installed.
But for other machines, the report viewer throws no exception, just
displays a blank... doesn't even prompt for parameters.

Suggestions?

Cheers,
zdrakec

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

It may be your authorization. Try something like this before calling the
reportsource:
Dim crtablelogoninfos As New TableLogOnInfos

Dim crtablelogoninfo As New TableLogOnInfo

Dim crconnectioninfo As New ConnectionInfo

Dim crtables As Tables

Dim crtable As Table

Dim tablecounter As Integer

crreportdocument.Load(gl_browseprintvar,
OpenReportMethod.OpenReportByTempCopy)

With crconnectioninfo

..DatabaseName = "IMC"

..ServerName = globalservername

..UserID = globalusername

..Password = globalpwd

End With

crtablelogoninfo.ConnectionInfo = crconnectioninfo

crtables = crreportdocument.Database.Tables

For Each crtable In crtables

If (Mid(crtable.Name, 1, 4) = "magt" Or Mid(crtable.Name, 1, 23) =
"sp_createmagtbaseselect" Or Mid(crtable.Name, 1, 4) = "magb" Or
Mid(crtable.Name, 1, 4) = "magf") And gl_browseprintvar =
"f:\imcapps\hvsum.rpt" Then

crconnectioninfo.DatabaseName = "imc_extra"

crtablelogoninfo.ConnectionInfo = crconnectioninfo

Else

crconnectioninfo.DatabaseName = "IMC"

crtablelogoninfo.ConnectionInfo = crconnectioninfo

End If

crtable.ApplyLogOnInfo(crtablelogoninfo)

crtable.Location = crtable.Name

Next

Dim subRepDoc As New ReportDocument

Dim crSection As Section

Dim crReportObject As ReportObject

Dim crSubreportObject As SubreportObject

'If you have any sub-reports, they need the connection info too...

For Each crSection In crreportdocument.ReportDefinition.Sections

For Each crReportObject In crSection.ReportObjects

If crReportObject.Kind = ReportObjectKind.SubreportObject Then

crSubreportObject = CType(crReportObject, SubreportObject)

subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

For Each crtable In subRepDoc.Database.Tables

crtable.ApplyLogOnInfo(crtablelogoninfo)

crtable.Location = crtable.Name

Next

End If

Next

Next

CrystalReportViewer1.ReportSource = crreportdocument

HTH,

Bernie Yaeger

"zdrakec" <zd*****@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello all:

I have the Crystal Report viewer imbedded on a .NET form, and it works
very well... except, on the target machine, when I set the ReportSource
property of the viewer (to a ReportDocument object), it PRETENDS to
load a report, but displays a blank object. The toolbar becomes active,
the navigation buttons are active, but otherwise the viewer does not
have the report loaded. Clicking the "Refresh" button of the viewer at
this point actually results in the report toolbar being disabled.

Mind you, the component is correctly registered via the merge modules,
and the database authentication is handled in the code. In fact, the
app works perfectly IF the target machine happens to have VS.NET
installed.
But for other machines, the report viewer throws no exception, just
displays a blank... doesn't even prompt for parameters.

Suggestions?

Cheers,
zdrakec

Nov 21 '05 #2

P: n/a
Hello Bernie:

Well, of course I am already doing that, or I should be prompted to log
in whenever the report runs. And the report, as I mentioned, runs fine
on machines with VS.NET already installed....
What is happening instead is a blank gray area where I would expect to
see my report. It ACTS like it loaded the report: the report viewer
client area turns a darker grey, the "Main Report" table becomes
visible and enabled, the report viewer's toolbar becomes enabled...

Other ideas, anyone?

By the way, Seagate (or Business Objects, or whatever), needs to work
on their technical support. Better yet, they need to work on this
product. It has already been a complete pain in the ass to implement,
from the database authentication code you give above, to the
poorly-documented packaging of numerous merge modules with the
installation package, and now this...

Cheers,
zdrakec

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.