Question

Simple report viewer VB.Net

Asked by: Michael_D

Hello experts,

I am trying to create simple report viewer in VB.NET (VS 2003)
I put CRViewer control on the form and trying to assign .rpt file name to the ReportSource property
But it doesn't work - i get message "Load report failed."      

I tried to download sample applications from BusinessObects Support site but all samples are using "build-in" reports. and I need to open .rpt file from the disk.

Please help.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-05-30 at 11:00:29ID21868496
Tags

report

,

viewer

Topic

Crystal Reports Software

Participating Experts
3
Points
500
Comments
32

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Reset <ReportSource> Property of CRViewer
    Does anybody know how I can reset the ReportSource property of a CRViewer in VB6? My problem is that I want to show two different reports in a crviewer depond on what user has selected, but it makes a problem because sometimes the data hasn't downloaded yet that user decid...
  2. CRViewer (8.5) and VB.NET 2003 - navigation/…
    I've been successfully using Crystal Reports 8.5 Developer and the CRViewer control with VB6 for 2 years now. I recently began to make the transition to VB.NET. I realize that VB.NET handles COM objects differently than VB6, and expected that there might be some differe...
  3. Crystal Reports Viewer: trapping the PRINT button from th…
    I would like to trap the Print button onclick event from the CRViewer toolbar. When the enduser presses the PRINT button on the toolbar we want to trap that event. Specifically, I want to supress a section when displayed, but have the section included when the document is p...
  4. How to change the reportsource on a CRViewer control
    Hi all, I have a CRViewer control on a form which also has a tree control. The tree control lists the titles of the reports the user may want to see in the viewer. When the user clicks on the tree the first time, the report is displayed fine, using the code below. Whe...
  5. ActiveX Viewer in vb.net 2005
    I'm converting a crystal viewer from vb6 to vb.net and I'm having some problems deploying it that maybe someone can help me with. I get an error: System.windows.forms.axhost+invalidactivexstateexception when it hits CRViewer1.ViewReport() Code: CrxReport = Cr...
  6. VB.Net Crystal Viewer Events
    I have switched over from a VB6 Crystal Viewer to VB.Net and am noticing that events happen very differently than before. In VB6 I could capture the OnLaunchHyperLink event and then programmaticaly through vb6 call other code or in my case another .exe. Is there a way to do t...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ast2550Posted on 2006-05-30 at 13:37:35ID: 16793470

Download
http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_win_samples.exe.asp

I opened vbnet_win_SimplePreviewReport.zip from within the distribution and it had an .rpt file, so it should be what you want.

 

by: Michael_DPosted on 2006-05-30 at 13:41:13ID: 16793497

ast2550,

as I said - I already downloaded that file - yes it use .rpt file but it part of the VB.net solution - kind of embeded report like a Form.

I need a sample that will open ANY given file

 

by: mlmccPosted on 2006-05-30 at 20:54:01ID: 16795515

What code are you using?

I don't have the .Net version but that may be a feature that is not available.  Can you save rpt files from the designer?  I assume you are using the version of Crystal that came with CR.Net.  If not then which version of Crystal?

mlmcc

 

by: Michael_DPosted on 2006-05-31 at 06:31:44ID: 16798404

The reports are designed in CR10 (not .NET). The viewer that I am trying to create should be installed on client computers without CR installed. This might be problem by itself. but I cant make it work on my developer machine with CR 10 Pro installed

The code I am using is simple
I have a form with CRViewer control on it.
When user choose File->Open from menu I show standart Open File dialog and assign the resulting filename to ReportSource Property of CRViewer

    Private Sub mnuFileOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileOpen.Click
        Dim FileName As String
        If dlgOpenReport.ShowDialog = DialogResult.OK Then
            FileName = dlgOpenReport.FileName
            Try
                CR.ReportSource = FileName

            Catch ex As Exception
                MsgBox("Cannot open file: " & FileName & ControlChars.CrLf & "Exception: " & ex.Message)
            End Try
        End If
    End Sub

It doesn't throw exception. It show regular message box stating "Load report failed".

BTW I tried to open empty report (template with static text only) and it works!!!
Maybe it database conectivity problem?
The template also have one table and it asks for username and password as expected.
The database is Oracle 10g (through ODBC) if it make a difference

 

by: janmariniPosted on 2006-05-31 at 06:38:50ID: 16798456

Here's some sample code to view an external rpt in the viewer (crv1) on a Windows form in VB.Net (using VS 2002).  Also a routine to login to the report (assumes SQL Server).

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared


Private Sub frmReportEngine_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

crReportDocument.Load("C:\Replace with Your Report Path and Name.rpt", OpenReportMethod.OpenReportByTempCopy)
Call LogonReport(crReportDocument)
crv1.ReportSource = crReportDocument





Public Sub LogonReport(ByVal rptReport As CrystalDecisions.CrystalReports.Engine.ReportDocument, ByVal strLocation As String)
        Dim strServer As String = ""
        Dim strDBase As String = ""
        Dim strUID As String = ""
        Dim strPWD As String = ""
        Dim crReportDocument As New ReportDocument()
        Dim crTableLogonInfos As New TableLogOnInfos()
        Dim crTableLogonInfo As New TableLogOnInfo()
        Dim crTables As Tables
        Dim crTable As Table
        Dim crSections As Sections
        Dim crSection As Section
        Dim crReportObjects As ReportObjects
        Dim crReportObject As ReportObject
        Dim crSubreportObject As SubreportObject
        Dim crDataBase As Database
        Dim crConnInfo As New ConnectionInfo()
        Dim subRepDoc As New ReportDocument()
       
        strServer = YourServer
        strDBase = YourDatabase
        strUID = YourUserID
        strPWD = YourPassword

        'Logs into the tables in the report
        crReportDocument = rptReport
        crDataBase = crReportDocument.Database
        crTables = crDataBase.Tables
        For Each crTable In crTables
            With crConnInfo
                .ServerName = strServer
                .DatabaseName = strDBase
                .UserID = strUID
                .Password = strPWD
            End With
            'MsgBox("REPORT - TableName = " & crTable.Name & "", MsgBoxStyle.OKOnly)
            crTableLogonInfo = crTable.LogOnInfo
            crTableLogonInfo.ConnectionInfo = crConnInfo
            crTable.ApplyLogOnInfo(crTableLogonInfo)
            crTable.Location = strDBase & ".dbo." & crTable.Name
            crTable.ApplyLogOnInfo(crTableLogonInfo)
        Next

        'Logs into the tables in the Sub-reports
        crSections = crReportDocument.ReportDefinition.Sections
        For Each crSection In crSections
            crReportObjects = crSection.ReportObjects
            For Each crReportObject In crReportObjects
                If crReportObject.Kind = ReportObjectKind.SubreportObject Then
                    crSubreportObject = CType(crReportObject, SubreportObject)
                    subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
                    crDataBase = subRepDoc.Database
                    crTables = crDataBase.Tables
                    For Each crTable In crTables
                        With crConnInfo
                            .ServerName = strServer
                            .DatabaseName = strDBase
                            .UserID = strUID
                            .Password = strPWD
                        End With
                        'MsgBox("SUBREPORT - TableName = " & crTable.Name & "", MsgBoxStyle.OKOnly)
                        crTableLogonInfo = crTable.LogOnInfo
                        crTableLogonInfo.ConnectionInfo = crConnInfo
                        crTable.ApplyLogOnInfo(crTableLogonInfo)
                        crTable.Location = strDBase & ".dbo." & crTable.Name
                    Next
                End If
            Next
        Next
    End Sub

 

by: Michael_DPosted on 2006-05-31 at 06:46:23ID: 16798528

Hi janmarini, thank you for posting.

Same thing here:

Private Sub frmReportEngine_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

crReportDocument.Load("C:\Replace with Your Report Path and Name.rpt", OpenReportMethod.OpenReportByTempCopy)  '<---- Throw exception "Load report failed"
Call LogonReport(crReportDocument)
crv1.ReportSource = crReportDocument

.....

 

by: janmariniPosted on 2006-05-31 at 06:54:31ID: 16798604

Does the rpt file exist in the specified location?
Can you view the same report in Crystal?
Do you have approprite permissions to the directory?
Check for typos in the report name or path.

 

by: Michael_DPosted on 2006-05-31 at 07:00:38ID: 16798670

Does the rpt file exist in the specified location?                >>> YES
Can you view the same report in Crystal?                        >>> YES
Do you have approprite permissions to the directory?       >>> YES It is local hard drive not network location
Check for typos in the report name or path.                    >>>  I am not typing the name - I am choosing it using Open File Dialog

Also it not one but all .rpt files have the issue exept very simple template (see my previous post)

 

by: janmariniPosted on 2006-05-31 at 07:31:55ID: 16798971

Have you tried testing opening your report by hard-coding your report location?  Your problem might be with your Open file diaplog - have you verified that it passes the proper report *PATH* and filename (FileName = dlgOpenReport.FileName)?

 

by: Michael_DPosted on 2006-05-31 at 07:40:34ID: 16799073

janmarini,

I do verify the file name - it is correct, fully qualified filename (with a path and extention).

 

by: Michael_DPosted on 2006-05-31 at 07:53:18ID: 16799212

OK I think I understand what is the problem:

When I tried to add one of the reports to my solution it says that it was created with CR version later than installed.
So actually I am trying to open CR10 report with CR.net (which is I believe compatable with CR9).

Is there a solution for this problem?

I cannot upgrate Visual Studio to higher version so don't suggest. Also we are planing to upgrade CR to XI - we need some new features of it (like cascading parameters and so on)

 

by: Michael_DPosted on 2006-05-31 at 08:14:34ID: 16799443

I have installed latest service pack for CR.net but it doesn't help.

 

by: mlmccPosted on 2006-05-31 at 19:23:37ID: 16804170

If you only have the CR 10 Professional Edition, you don't haev a license oto distribute the CR viewing dlls.  You need at least the Developer edition.

mlmcc

 

by: Michael_DPosted on 2006-06-01 at 06:05:39ID: 16806961

mlmcc - I don't have to use CR10's license - I am distributing VS.Net executable and dll that coming with Visual Studio - correct me if I am wrong

 

by: mlmccPosted on 2006-06-01 at 16:14:13ID: 16812214

You might be correct but the CR.Net licenses may only apply to CR.Net and not CR 10.

I don't have CR.Net or 10 so I can't check.

mlmcc

 

by: janmariniPosted on 2006-06-01 at 18:40:49ID: 16812806

Loading a CR 10 report from VS 2003 shouldn't be a problem.  I'm curious, did you ever try just loading a report with a hard-coded path, filename (not using your mnuFileOpen_Click event/Open file dialog)?  Are you sure your connection information is correct?  Is your ODBC connection using an UNC path or a mapped drive (try UNC)?

Is this problm occurring in your development environment (this is what I've assumed), but you note "I am distributing VS.Net executable and dll that coming with Visual Studio "  If you are deploying your app you need to include the merge modules

Here's some info I found on "load report failed" but not sure if it applies to your specific situation, might be worth a look though

Err Msg: "Load Report Failed" when using an untyped report component in .NET
http://support.businessobjects.com/library/kbase/articles/c2014070.asp

 

by: Michael_DPosted on 2006-06-02 at 06:40:23ID: 16816526

janmarini:

I did try loading report by hard-coding the file name. Even more - I tryed to assign Report Source  property in Design mode (not in code) - the result is the same: "Load Report Failed" message
The problm occurring in development environment.

As you can see from my post from Date: 05/31/2006 09:46AM EDT I tryed to implement both methods from the article  "Err Msg: "Load Report Failed" when using an untyped report component in .NET"


 

 

by: Michael_DPosted on 2006-06-02 at 07:04:41ID: 16816735

Update:
I was able to open several reports from my application but some of the reports won't open!!!

So I can assume that everything is OK mith my .NET viewer - the problem is in the reports. All reports running out of the same database. I cannot find any noticable difference.

Anybody has an idea where to look?
 

 

by: Michael_DPosted on 2006-06-02 at 07:09:33ID: 16816773

Hehe - got it!!!

Any report that contain "Report Custom Function" fail to load in CRViewer component for .NET

Anybody knows how to resolve it?

 

by: janmariniPosted on 2006-06-02 at 07:10:09ID: 16816781

Previously you said that all reports have the problem - has something changed with the reports that are now working?  

Are there any differences in the reports that work vs. those that don't such as subreports, parameters?  

Are you still getting the same error message "Load report failed" for those that don't open.

 

by: Michael_DPosted on 2006-06-02 at 07:14:11ID: 16816821

>>Previously you said that all reports have the problem >> Yes but I am creating new reports :)


 

by: janmariniPosted on 2006-06-02 at 07:15:25ID: 16816834

Can you post an example of your custom function

 

by: Michael_DPosted on 2006-06-02 at 07:17:38ID: 16816851

Any function will cause the problem even if it is only defined and never used

Here is a sample of one I use:
Function pad( s as string, l as number ) as string
    pad=Left(s & space(l), l)  
End Function

 

by: Michael_DPosted on 2006-06-02 at 07:41:53ID: 16817098

janmarini,

As I understand from your Profile you should have VS2003 installed.

Could you do me a favor and try to reproduce this issue on your system.

crate te new windows app and paste following  code:

[Code]
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class frmCRViewer
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents CR As CrystalDecisions.Windows.Forms.CrystalReportViewer
    Friend WithEvents mnuMain As System.Windows.Forms.MainMenu
    Friend WithEvents mnuFile As System.Windows.Forms.MenuItem
    Friend WithEvents mnuFileOpen As System.Windows.Forms.MenuItem
    Friend WithEvents mnuFileSep1 As System.Windows.Forms.MenuItem
    Friend WithEvents mnuFileExit As System.Windows.Forms.MenuItem
    Friend WithEvents dlgOpenReport As System.Windows.Forms.OpenFileDialog
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.CR = New CrystalDecisions.Windows.Forms.CrystalReportViewer
        Me.mnuMain = New System.Windows.Forms.MainMenu
        Me.mnuFile = New System.Windows.Forms.MenuItem
        Me.mnuFileOpen = New System.Windows.Forms.MenuItem
        Me.mnuFileSep1 = New System.Windows.Forms.MenuItem
        Me.mnuFileExit = New System.Windows.Forms.MenuItem
        Me.dlgOpenReport = New System.Windows.Forms.OpenFileDialog
        Me.SuspendLayout()
        '
        'CR
        '
        Me.CR.ActiveViewIndex = -1
        Me.CR.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.CR.Location = New System.Drawing.Point(0, 0)
        Me.CR.Name = "CR"
        Me.CR.ReportSource = Nothing
        Me.CR.Size = New System.Drawing.Size(680, 528)
        Me.CR.TabIndex = 0
        '
        'mnuMain
        '
        Me.mnuMain.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuFile})
        '
        'mnuFile
        '
        Me.mnuFile.Index = 0
        Me.mnuFile.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuFileOpen, Me.mnuFileSep1, Me.mnuFileExit})
        Me.mnuFile.Text = "&File"
        '
        'mnuFileOpen
        '
        Me.mnuFileOpen.Index = 0
        Me.mnuFileOpen.Shortcut = System.Windows.Forms.Shortcut.F2
        Me.mnuFileOpen.Text = "&Open ..."
        '
        'mnuFileSep1
        '
        Me.mnuFileSep1.Index = 1
        Me.mnuFileSep1.Text = "-"
        '
        'mnuFileExit
        '
        Me.mnuFileExit.Index = 2
        Me.mnuFileExit.Text = "E&xit"
        '
        'dlgOpenReport
        '
        Me.dlgOpenReport.DefaultExt = "rpt"
        Me.dlgOpenReport.Filter = "Crystal Reports files (*.rpt)|*.rpt"
        '
        'frmCRViewer
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(680, 526)
        Me.Controls.Add(Me.CR)
        Me.Menu = Me.mnuMain
        Me.Name = "frmCRViewer"
        Me.Text = "Crystal Reports Viewer"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub mnuFileOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileOpen.Click
        Dim FileName As String
        If dlgOpenReport.ShowDialog = DialogResult.OK Then
            FileName = dlgOpenReport.FileName
            Try
                CR.ReportSource = FileName

            Catch ex As Exception
                MsgBox("Cannot open file: " & FileName & ControlChars.CrLf & "Exception: " & ex.Message)
            End Try
        End If
    End Sub
End Class

[/Code]


Try to open a report without Custom Function
It should open just fine

Then modify the report by adding a Custom Function - you dont have to use it anywhere on the report - just define one.
Try to open the report again in Viewer.
BANG!!! Or not?

 

by: janmariniPosted on 2006-06-02 at 10:02:10ID: 16818334

I tried your code and you are very correct - it IS the custom function causing the problem.

I can open a report that does not contain a custom function.
I added a custom function to the report and used it is a formula field.  Could not load report.
I deleted the formula field using the custom function.  Could not load report.
I deleted the custom function from the report and then could open the report.

The report I tested with was created with CR 9.0.  Fursther details on the load error indicated that the report was created with a version of Crystal Reports which is later that the version you are running (VS 2003) ...misleading message because this is not true, rather it seems the VS 2003 does not support the use of custom functions....

I'll see if I can find any additional info regarding this issue.

In the worst case I think you could remove the custom functions from the reports and use regular fomulas instead.



 

by: Michael_DPosted on 2006-06-02 at 11:11:54ID: 16818913

I couldn't find any usefull info on BO's site so I am going to get rid of Custom functions
Unfortunately you can't just replase Custom function with formula - I am using input parameters which is impossible in formulas.

 

by: janmariniPosted on 2006-06-02 at 11:48:06ID: 16819159


Closest additional info I could find is the following link.  I didn't have time to check it out because I have to get to work.  When I tested your code I created the report (and repository) on 1 machine (that has CR 9) then copied to the report file to another machine (that has VS 2003)...Perhaps it didn't work because I didn't have the repository (or connection) on the machine with VS 2003.  Never have used the repository (or custom functions before) so I don't know if this info will be helpful or not

Err Msg: "Load Report Failed" when using Business Views in VS .NET application .... Applies to CR10.0 -Business View and other Repository objects (which includes custom functions) - sounds like some repository (CE) connection info is needed...
http://support.businessobjects.com/library/kbase/articles/c2014526.asp?ref=devzone_netzone_archive

 

by: Michael_DPosted on 2006-06-02 at 12:11:50ID: 16819384

The repository is part of Crystal Enterprize I guess and I am not using it. I am using (OK - was using) Report Custom Functions. There is no logon credentials involved so this link is not applicable to my situation.

 

by: mlmccPosted on 2006-06-02 at 19:27:29ID: 16821610

Where are you creating the custom function?

mlmcc

 

by: Michael_DPosted on 2006-06-05 at 06:04:24ID: 16832552

>>Where are you creating the custom function?
What do you mean by Where?
All reports are build in CR10 (not .NET)

We don't have Enterprise Edition hence I cannot store my functions in centralized repository and i am stuck to Report based functions

 

by: janmariniPosted on 2006-06-05 at 08:07:06ID: 16833649

The repository is where the custom functions are created and stored in Crystal Reports, not Crystal Enterprise.  I think the reference to Crystal Enterprise is a little confusing....  

The link I sent to you specifically deals with CR 10 - it refers to the EnterpriseSession property of the ReportDocument object.  

You may want to read up a little on Repository objects - which include custom functions.  You might also want to try adding in the few lines of code suggested in the solution (convert to VB, example is C#).  You may have to add a reference to the CrystalEnterpriseLib (Project/Add Refererence/CrystalEnterpriseLib) and on your VB Form,
Imports CrystalEnterpriseLib

 

by: Michael_DPosted on 2006-06-19 at 07:36:07ID: 16934718

I am assuming that there is no solution and in order to use reports in CR Viewer Control for .NET the report cannot contain Custom Functions.
I am accepting janmarini's comment because he spend so much time with me analysing and testing.

Thank you all, guys

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...