Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is actually two questions.

I have an application that runs "perfect" until I set up a crystal report form.
Basically I fill a dataset with the data I'm looking for using a LINQ query with the following code:

VB
Dim ds As New TalkScheduleDataSet
Dim dt As DataTable = ds.TalkSchedule

Dim sched = From s In db.TalkSchedules Where s.Date >= CDate(startDate) And _
            s.Date <= CDate(endDate) _
            Select s

'Fill the dataset
Dim rpt As New ReportDocument
    for each sch In Sched
    dt.Rows.Add(sch)   'Abbreviated.
Next

'The report is taken from Crystal Reports, rptTalksSchedule.rpt file
Dim rpt As New ReportDocument
rpt = New rptTalksSchedule

'Crashes right here.
rpt.SetDataSource(ds)

'Never get this far.
CrystalReportViewer1.ReportSource = rpt

Error is:
VS 2012
No source available
The call stack contains only external code
Mixed mode assembly is built against version 'v2.0.50727' and cannot be
loaded in the 4.0 runtime without additional configuration.
An unhandled exception of type 'System.IO.FileLoadException' occurred in
mscorlib.dll

VS 2013 error is about the same with different formatting

Both have to do with CrystalDecisions.ReportAppServer.DataSetConversion.dll

I have another application I have upgraded from VS2008 to 2013, which does the same, and it works perfectly, using the same pre-filled DataSet for several different CrystalReport forms. Each form displays the data the way it is supposed to.

Can't understand what's going on. Both applications use the same CrystalReports versions (13.0.2000.0)

CrystalDecisions.CrystalReports.Engine
CrystalDecisions.ReportSource
CrystalDecisions.Shared
CrystalDecisions.Windows.Forms

In the past I've had a lot of problems getting to know the eccentricities of Crystal Reports and I actually would prefer to use the VS built in reportviewer, but I can't get it to work with the dataset. It won't update with the data after I fill the dataset.

Is there a good walkthrough for the ReportViewer. Not the basic ones that only use the Wizard. I need to format the report and get specific data, as shown in the subroutine above. I built the report, added it to a ReportViewer on the form and added

VB
ReportViewer1.Refresh
     '-or/and-
ReportViewer1.Update


Neither works, although I know the Dataset has data in it.

Hope I've been clear enough.
Thanks for all your help.
Posted
Updated 9-Sep-17 22:54pm
Comments
Yousef Jwad 26-Mar-16 3:09am    
sorry,,i have a problem with reporting in visual studio C# windows form..
i'm new here,,am facing a problem when i run my project it never shows an errors but it shows a message like this: Source Not Available!!
The Call Stack Contains Only External Code!!
what can i do ?? my program is good but when i put a report code i have that problem!!
the same im new at programming please help me guys
Andrew Alix 30-Mar-16 11:14am    
Have you tried changing the framework in the application tab in the Solution Explorer Properties?

1 solution

Add this to app.config

<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900