Showing posts with label region. Show all posts
Showing posts with label region. Show all posts

Friday, February 17, 2012

Display hirearchy data using data region

I am trying to display hirearchical data using data region. For eg. the first level will be a list of customer names. The second level will be a list of Invoices under each customer. The third level will be a list of product names that were sold under each invoice.

I used a list for the data region and in each hireachy, there is a textbox in each list to display the data. I am trying to associate each data region with a datatable (I will provide the logic to populate the datatable with appropiate data). I do not want the ReportViewer to interact directly with a database because this is a 3 tier design and I am using the ReportViewer in local mode. I couldn't find any example of these. Can anybody help? Also I would like to see an example of the .rdlc file in these situation. Thanks very much.

Kam

Take a look at this article and post any follow-up questions to this post.|||

Hi Teo,

What my situation in is that I have a nested list data region. Specifically I have two list data region, one stack on top of each other. The list data region on the bottom has a textbox and another list data region. The textbox will display a list of customer name. The list data region on top also has a textbox. This textbox will display a list of invoice number with respect to each individual customer.

I read that not only can list data region be nested, each can associate with its own data table. So in my code I have two data table, the first one contain a list of customer name and its corresponding customer ID. The second one contain a list of invoice number and its corresponding customer ID that relates to the customer ID of the first table. I have trouble making this work because for some reason the textbox on the top list data region refuses to accept fields in the invoice data table. It only accepts fields in the customer data table.

I have seen example of nested list data region but it uses SQL statement and talks directly to a database. I am using this in local mode in a 3 tier situation so I have no access to a database.

Thanks very much on your last reply and I am looking forward on this one.

Thanks. Kam

|||

Take a look at the Sales Order sample report which ships with Reporting Services. Yes, data regions can be nested and each one can be bound to its own dataset.

Currently, SSRS doesn't support joining datasets at the report level. However, if all datasets will filter on a single customer you can synchronize them by using a customer query parameter. The Sales Order report demonstrates this technique although the list and table regions are not nested (they don't have to be because the datasets are pre-filtered already). An outer list can only reference the first or last record from an inner dataset as you can see by dragging a field onto it. That's because the inner list may have many records, e.g.; one customer has many invoices.

The report will work the same way in both remote and local modes. The only difference in local mode is that you have to bind the three application datasets to the report. The article I mentioned in my first reply demonstrates how dataset binding works in local mode.

|||Thanks for the tip. I haven't have a chance to look into it yet. I will let you know when I come back to this problem. Thanks.

Tuesday, February 14, 2012

Display group header if no records found?

My report is grouped by Region, Sector, WeeklyIntervals and area.

There are two kinds of weekly intervals - Less than Weekly and Greater than Weekly. Right now if no records are found for Less than Weekly interval the report doesn't display it at all and move on to display next greater than Weekly Interval.

I want to display the Less than Weekly Interval group header even if it is empty and display a message saying "No records found". How can I do this?

ThanksYou could force your query to return a record by eiter manually typing your SQL query in Crystal Reports (version 10 onwards) or by creating a view. You can achieve this by creating a union from your basic query to the dual "table" fetching one record, after this you suppress the detail section for the values from this fetch.

Select col1, col2, col3
from table1
where ...
union
select 'val1' col1, 'val2' col2, 'val3' col3
from dual

You mentioned that you needed the record to show for a time period less than a week, thus you must have a date field in your query and the code should look like:

Select my_date, col2, col3
from table1
where ...
union
select sysdate my_date, 'val2' col2, 'val3' col3
from dual

supposing you are sorting by my_date

- Jukka