OT: Visual Studio report control question

OT: Visual Studio report control question

Old forum URL: forums.lhotka.net/forums/t/1872.aspx


albruan posted on Wednesday, November 29, 2006

I have a report based on two business objects due to the method in which my client wants the data displayed.  My first business object consists of a single row of drawing data for each department, so three rows of data will be returned if there are three departments involved in the project.  My second business object returns a single row of drawing data for all departments.  For each department, he wants it broken out by drawing types and subtotaled for the department; for the project, he wants it also broken out by drawing types and totaled for the project. 

This is a bit hard to describe so maybe a diagram of sorts will help.  Limiting it to three departments and two drawing types, the first report is similar to:

                     # of Dwgs       Total Hours
Architectural
   CADD                  10                80
   Manual                 5                60
   Dept Total            15               140
Electrical
   CADD                  16                95
   Manual                 3                20
   Dept Total            19               115
Structural
   CADD                  10                80
   Manual                 5                60
   Dept Total            15               140

For the second part of the report, he wants it displayed as:

                     # of Dwgs      Total Hours
Project
   CADD                  36               255
   Manual                13               140
   Project Totals        49               395

My business objects return the correct data, but the problem occurs in the rendering of the report.  To display the first part of the report, I have a report table embedded in a report list box to permit iterating through the departments; it works as advertised.  To display the second part of the report, I have a standalone report table and it is here that the report refuses to render the way it should.  Rather than displaying a single grid for the project totals, it displays the same grid with the same data three times.

Has anyone here successfully created a similar report or one in SQL Server Reporting Services (since the two are similar)?  If so, what, if anything, am I doing wrong?

 

figuerres replied on Thursday, November 30, 2006

Are you using client reports or report server reports ?

I reciently made a client report and posted here with some info on what I had to do in my case.

I have not yet tried to do a report server based report.

are the two BO related ? as in parent / child ?

albruan replied on Thursday, November 30, 2006

I'm using client reports for this project.  The two BOs are related after a fashion.  For the first part of my report, I had to create a pair of BOs in order to flatten my hierarchy for reporting purposes; without them, the report displayed project-wide totals for each of the departments.  See http://forums.lhotka.net/forums/thread/9388.aspx  In other words, given the data in my example, it would display 10 CADD drawings in each of the three departments before I flattened the hierarchy.

I've been able to aggregate the totals for each of the departments in my report, but I've been unable to display the second part of my report without having to resort to another pair of business objects.

Thanks for your response.  I'll perform a search and see what you wrote about client reports.

ajj3085 replied on Thursday, November 30, 2006

Also, are you adding both objects as seperate data sources, and setting the table to the proper datasource?

figuerres replied on Thursday, November 30, 2006

albruan:

I'm using client reports for this project.  The two BOs are related after a fashion.  For the first part of my report, I had to create a pair of BOs in order to flatten my hierarchy for reporting purposes; without them, the report displayed project-wide totals for each of the departments.  See http://forums.lhotka.net/forums/thread/9388.aspx  In other words, given the data in my example, it would display 10 CADD drawings in each of the three departments before I flattened the hierarchy.

I've been able to aggregate the totals for each of the departments in my report, but I've been unable to display the second part of my report without having to resort to another pair of business objects.

Thanks for your response.  I'll perform a search and see what you wrote about client reports.

I was not able to find my post where I found the trick I needed but here goes:

if you do binding to winforms with a parent / child you can bind the child grid by refering to the parent.child

with client reports you can bind to a child and have it fill out a list / table but you have to bind it to the child collection directly. if you bind wrong you get no data and no error.

if it is wrong the vs report designer does not tell you, it all looks good till you run the report.

if you have a collection you must bind with a repeating control parent, sometimes you can use a list and then detail items.

depending on how the BO is setup and is single or a collection you may need to create datascources for each BO and bind each datasource to a report container.

if you are still stuck post back and we can try to work it out, I am finishing some code and then later I will be doing a bunch of reports to finish the app I am working on.... wow almost done... lot's of forms and stuff to get this thing competed.... but then comes testing and bug fixing!

 

 

albruan replied on Thursday, November 30, 2006

I finally found the problem.  The first few times I ran the application, everything was working according to plan.  Somehow, while making changes to the data to be accessed for a particular cell, I inadvertently set the datasetname for the second table to the datasetname used by the first table.  Changing it back to the correct BO solved the problem.  I can't even begin to count (enumerate?) the number of times I stared at it and didn't even see it.  Sheeeeeesh!

ajj3085 replied on Thursday, November 30, 2006

Ya, those kinds of things are the worst.  You spend days looking at something, not noticing the simple thing wrong.  At least we can take comfort in knowing that everyone does this from time to time.

Copyright (c) Marimer LLC