473,388 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

No data appearing in my report

I'm putting together a REALLY simple report for my WinForms app.

I use an object data source. Here's the class:
--------------------------------------------------------------------------
public class ProjectEnergyUsageReportValues
{
private double defaultUsage;
public double DefaultUsage
{
get { return defaultUsage; }
set { defaultUsage = value; }
}
private double oldUsage;
public double OldUsage
{
get { return oldUsage; }
set { oldUsage = value; }
}
private double newUsage;
public double NewUsage
{
get { return newUsage; }
set { newUsage = value; }
}
}
--------------------------------------------------------------------------
No brainer. I have an embedded RDLC file. When I created the RDLC file, I
added the class to my data sources window, and dragged the properties
(DefaultUsage, OldUsage, NewUsage) to the "data fields" section. I see the
three of them listed there.

When I added the ReportViewer control to my form, I used the smart tag to
associate it with the RDLC file I created.

Here's what I'm doing in my report form constructor:
--------------------------------------------------------------------------
reportViewer1.ProcessingMode = ProcessingMode.Local;

ProjectEnergyUsageReportValues reportValues = new
ProjectEnergyUsageReportValues();
reportValues.DefaultUsage = 5.0;
reportValues.OldUsage = 6.0;
reportValues.NewUsage = 7.0;

BindingSource bindingSource = new BindingSource();
bindingSource.DataMember = "ReportValues";
bindingSource.DataSource = reportValues;

reportViewer1.LocalReport.DataSources.Add(new
ReportDataSource("ProjectedEnergyUsage_ReportValue s", bindingSource));
--------------------------------------------------------------------------

And finally, in the form load event:
--------------------------------------------------------------------------
this.reportViewer1.RefreshReport();
--------------------------------------------------------------------------

When I run the app and open the form, I see the report layout fine, but
there's no data.

Any idea why?

Apr 25 '07 #1
2 1253
*BUMP*

I guess I should have mentioned that I'm creating a simply report using the
new WinForms ReportViewer control.

Anyways, I'd really like some help with this issue.... Anyone?!
Apr 26 '07 #2
FYI:

As it turns out, the problem was my data source. When you're using an
object data source, you must specify a collection (implements IEnumerable) of
objects. I was just passing in one object. When you think about it, it
makes sense.

Anyway, yay, it works now!
Apr 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Erick | last post by:
Greetings, I have a few staffers using an Access2K database. It's an .mde shared out on a newtwork share. 4 users use it and only one cannot see or print the gridlines from a report that everyone...
3
by: Diggler | last post by:
I was working on a report that is populated with three different tables in a strongly-typed dataset. The tables are populated from custom objects rather than directly from SQL Server. I loop...
6
by: Ray | last post by:
Hi all, While I use the ReportDocument of vb.net to set filter to the data to the Crystal Report, it is successful for the first time while running the program. However, for the second time while...
0
by: Greg | last post by:
Anyone having issues with their object datasources appearing and vanishing from the datasource browser? I create an object for binding as a datasource in my App_Code folder, compile my web...
1
by: Karen Hill | last post by:
Hello Access Gurus, I have Access 2000. I created a Form with a Sub-report and that Subreport has a Sub-form. When I expand the Sub-report to show the Sub-form scroll bars appear on the...
0
by: KNN | last post by:
I have created a report in access 2003 using a query. Used some of the fields to display under page header. Used others to display under group headers and used the remaining under detailed...
0
by: kepston | last post by:
I have written a small Windows shell batch file to report on missing files. The code correctly produces a list of (missing) numbers in a file as required, but for every entry, DIR outputs 'File Not...
4
by: Chris | last post by:
I am using the FileSystemOBject for writing text with Unicode as in the example below. When I try to read data from the file with ReadLine, I get "?????????" instead of characters with unicode. ...
0
by: rakeshc | last post by:
Hi, I am a new guy in jasper and iReport. I could create a report and subreport successfully with iReport. while running through iReport, it will ask for parameters and after supplying them,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.