0
votes

I start a new project. I then add a blank form and then add a ReportViewer control to the form. I then dock the control to the form.

Next, I add a new dataset (DataSet1.xsd) to the project. I then open server explorer and drag a specific view (not a table) to DataSet1's form. I can then see all the fields in the view on displayed on the dataset's form. If I choose to, I can preview the data and validate that the Fill, GetData() functions work (and they do. I can see all the data). I then go back to my main form (Form1) and choose to design a new report. I tell the report wizard what datasource to use and then I drag the needed fields to the Row grouping box and the Values box. I click next and choose the layout of my report and style.

Finally, I go back to Form1 and choose the the report that I want on that reportviewer control. I build and then run the project. The form is displayed, but no report appears in the viewer control. For the life of me, I cannot figure out why. Have I skipped a step somewhere? I could have sworn that this is what I did before to do a simple report but it doesn't appear to be working.

I even tried to step through with debug on the Fill method of the dataset's TableAdapter and that's seem to be where it's getting stuck. Yet, I can use that same table adapter fill routine to preview the data. I've made no changes to any code so I'm at a loss. Any ideas?

FILL code:

private void Form1_Load(object sender, EventArgs e)
    {
        // TODO: This line of code loads data into the 'DataSet1.CAV_MBRHISTDETL' table. You can move, or remove it, as needed.
        this.CAV_MBRHISTDETLTableAdapter.Fill(this.DataSet1.CAV_MBRHISTDETL);

        this.reportViewer1.RefreshReport();
    }

SQL to fill dataset:

SELECT 
          MBRSEP, 
          LOCATION, 
          BILLDATE, 
          READDATE, 
          DUEDATE, 
          READTYPE, 
          BILLTYPE, 
          CREDITCODE, 
          BILLMOYR, 
          METERREAD, 
          KWH 
FROM      CAR1.CAV_MBRHISTDETL
WHERE     BILLTYPE = '09' AND 
          BILLMOYR <> '9999' 
          AND ROWNUM <= 100

Connection String:

connectionString="Dsn=UPN2;uid=car1;dbq=SEDC;dba=W;apa=T;exc=F;fen=T;qto=T;frc=10;fdl=10;lob=T;rst=T;btd=F;bnf=F;bam=IfAllSuccessful;num=NLS;dpm=F;mts=T;mdi=F;csr=F;fwc=F;fbs=64000;tlo=O;mld=0;oda=F"
1
are you using telerik reporting? - Sleiman Jneidi
can you post your code where you are doing the Fill.. also for the sql that you are passing.. how is the connection string for the ReportViewer defined..? what version of .net ReportViewer are you using.. is this with ActiveReports ?? - MethodMan
I'm using VS2010, so whatever report viewer version is included with that, then that's what I am using. Is there a way to determine the version? This is for a regular winforms application and I'm only using a form, reportviewer control, a table view, and a dataset. - Kevin
Also, the SQL that I provided works great when I'm working with the dataset viewer. I can choose to preview the data and it returns exactly 100 records in seconds that meet the criteria that I'm needing. Yet, it doesn't appear to be working from within the program. Hmm... - Kevin

1 Answers

1
votes

I think I've found my problem. In Visual Studio 2010, I clicked on 'Debug' then 'Exceptions' and checked every exception in the resulting window. Somehow, I thought, an error was happening and I wasn't being made aware of it.

Sure enough, when I ran my report program again I got an error message stating that my password was null. Imagine that! I had to put my user ID and password in when I previewed the data in the dataset.xsd screen, but not once did the program ask for my password when I ran it. I am also wondering why the program didn't just completely stop with an error instead of just sitting there. Anyway, when I supplied the password in my connection string, and re-ran, everything worked. Whew!