Avatar of NettieCross
NettieCrossFlag for United States of America

asked on 

Crystal Reports in VS 2008

Hi,

I have followed the prescribed project setup, have the report, the dataset, the viewer, the headings load but no data.  I have filled the datasets. etc.  Here is the report forms code. I have added the adapters, report and dataset to the design view of the form as well.  So close, and yet so far!

Public Class MainReport

    Private MainLinReport As rptMain
    'helper class

    Private Sub ConfigureCrystalReports()
        MainLinReport = New rptMain()
        CrystalReportViewer1.ReportSource = MainLinReport
    End Sub

    Private Sub MainReport_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


        Me.LinTableAdapter1.Fill(Me.TB55DataSet1.LIN)
        Me.RemarksTableAdapter1.Fill(Me.TB55DataSet1.Remarks)
        ConfigureCrystalReports()
    End Sub

End Class

Thanks, Nettie
Crystal ReportsDB Reporting ToolsMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
NettieCross
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

The report won't load. Here are the details:

CrystalDecisions.Shared.CrystalReportsException was unhandled
  Message="Load report failed."
  Source="CrystalDecisions.CrystalReports.Engine"
  StackTrace:
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()    at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)    at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)    at Application.frmDemo.btnViewReport_Click(Object sender, EventArgs e)    at System.Windows.Forms.Control.OnClick(EventArgs e)    at System.Windows.Forms.Button.OnClick(EventArgs e)    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)    at System.Windows.Forms.Control.WndProc(Message& m)    at System.Windows.Forms.ButtonBase.WndProc(Message& m)    at System.Windows.Forms.Button.WndProc(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)    at System.Windows.Forms.Application.Run(ApplicationContext context)    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)    at Application.My.MyApplication.Main(String[] Args)    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.InteropServices.COMException
       ErrorCode=-2147467259
       Message="The system cannot find the file specified. "
       Source="Analysis Server"
       StackTrace:
            at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)    at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)    at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       InnerException:
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

Sorry, this is the error I get trying to compile and run your sample - it runs, but then the report fails to load.
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Looks like you are trying to connect via Analysis Services - reporting on an olap datasource ? What version of SQL are you using ?

make sure you have all the correct connections and drivers. SQL 2008 is still not officially released, and there were some updates in RC0 a few weeks back.

Also, if reporting on a cube, then make sure that the Analysis Services account is accessable from where ever you are running the report.

Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

I am using Sql Server Express and attaching to a dataset generated from a  sql .mdf database.

I get the report with the column headings, but do data. *sigh*
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Would be inclined to recheck your connections then, becuase there is a definite reference to Analysis Services - which is the Cube based BI / Data Mining component...
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

I did.  I made sure that all the table adapters are feeding the data, and they are.  I use the very same data set in two other forms for different views of the data, one is a hierarchical grid, the other a large form with all the elements displayed.  So not quite sure how it knows the column headings, but can't pull the records. I must be missing some kind of instantiation or something in code.
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Quite possible, or, there is an error condition in the result set - have for the instance that you are using it for (ie incompatible with the report elements)... have you tried to quickly run up the report in say crystal designer (ie replicate what your code is doing) ?
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

I have simply followed the project setup requirements using the wrapper method, created the report using the dataset as the datasource etc.  As I say, I get the column headings, so it has been fed that, but the rows of data just don't dump to the report. Ihave the fill methods complete, assign the report to the viewer, the whole nine yards.
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

If I make a small sample app of my situation, could you look at it, I am in a real crunch and this is holding up my entire application.   Nettie
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

I have a sample, but this board won't let me post most of the files that go in it.  What to do?
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

have you tried my sample?
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

As I said earlier, I tried to but it wouldn't run.  I showed you the error I got above.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

>>Message="The system cannot find the file specified. "

If you read the article, you see:
"But wait before running the sample application! If you carefully look at the call to the Load method of the ReportDocument object, you will see that the application is expecting to find a file named rptTest.rpt in the startup folder (usually bin\debug at this time). You can set this path to be anywhere but the point is that you need to copy your standalone report files to that folder! Otherwise, a load report exception will be raised. You also need to insure that the dataset is filled otherwise you will get a login prompt on the screen. If you do these 2 requirements, you should see your report coming to viewer with the data created manually. "
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

Whats weird is that I can get a report with data using an access databse, but not the SQL Express data, this is weird.  I did cahnge the report and still got an error.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Have you tried to create a new report from scratch and connect it to SQL Express? That will work. Trying to connect a report that have been created on Access and dynamically changing it at run time to run on another database engine, I have serious doubts.

This is another reason why I prefer to provide dataset to reports. I can change the source of my dataset, the report won't even know it.
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

Yes I did.  I created an actual Crystal Reports project from scratch and used my mdf data to no avail.  Cretae the same exact report using access and I get data.  Weird thing is that I have an entire application running against the same exact DataSet from the mdf with no problems whatever - only Crystal reports. Pretty sad to have to down grade the entire app to Access just for the dang report.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

instead of downgrading to access, do what I do in my article, open a dataset in the application and pass it to CR
Avatar of NettieCross
NettieCross
Flag of United States of America image

ASKER

AH HA!! I missed one line of code in your article - of all lines  - the SETDATASOURCE line! AH!  I have data and have one day to design a report that will have no  less than 3 sub reports!! (I may be back for help with that in another thread!)

Your article is accurate and does get data feeding into your app - thank you so much for being so patient with me!

Nettie
ASKER CERTIFIED SOLUTION
Avatar of NettieCross
NettieCross
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Microsoft SQL Server 2008
Microsoft SQL Server 2008

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.

50K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo