Hi,
It may be your authorization. Try something like this before calling the
reportsource:
Dim crtablelogoninf os As New TableLogOnInfos
Dim crtablelogoninf o As New TableLogOnInfo
Dim crconnectioninf o As New ConnectionInfo
Dim crtables As Tables
Dim crtable As Table
Dim tablecounter As Integer
crreportdocumen t.Load(gl_brows eprintvar,
OpenReportMetho d.OpenReportByT empCopy)
With crconnectioninf o
..DatabaseName = "IMC"
..ServerName = globalservernam e
..UserID = globalusername
..Password = globalpwd
End With
crtablelogoninf o.ConnectionInf o = crconnectioninf o
crtables = crreportdocumen t.Database.Tabl es
For Each crtable In crtables
If (Mid(crtable.Na me, 1, 4) = "magt" Or Mid(crtable.Nam e, 1, 23) =
"sp_createmagtb aseselect" Or Mid(crtable.Nam e, 1, 4) = "magb" Or
Mid(crtable.Nam e, 1, 4) = "magf") And gl_browseprintv ar =
"f:\imcapps\hvs um.rpt" Then
crconnectioninf o.DatabaseName = "imc_extra"
crtablelogoninf o.ConnectionInf o = crconnectioninf o
Else
crconnectioninf o.DatabaseName = "IMC"
crtablelogoninf o.ConnectionInf o = crconnectioninf o
End If
crtable.ApplyLo gOnInfo(crtable logoninfo)
crtable.Locatio n = crtable.Name
Next
Dim subRepDoc As New ReportDocument
Dim crSection As Section
Dim crReportObject As ReportObject
Dim crSubreportObje ct As SubreportObject
'If you have any sub-reports, they need the connection info too...
For Each crSection In crreportdocumen t.ReportDefinit ion.Sections
For Each crReportObject In crSection.Repor tObjects
If crReportObject. Kind = ReportObjectKin d.SubreportObje ct Then
crSubreportObje ct = CType(crReportO bject, SubreportObject )
subRepDoc = crSubreportObje ct.OpenSubrepor t(crSubreportOb ject.SubreportN ame)
For Each crtable In subRepDoc.Datab ase.Tables
crtable.ApplyLo gOnInfo(crtable logoninfo)
crtable.Locatio n = crtable.Name
Next
End If
Next
Next
CrystalReportVi ewer1.ReportSou rce = crreportdocumen t
HTH,
Bernie Yaeger
"zdrakec" <zd*****@yahoo. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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