This is a migrated thread and some comments may be shown as answers.

Group information at bottom of page

12 Answers 281 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David Gallant
Top achievements
Rank 1
David Gallant asked on 09 Dec 2010, 04:21 PM
I have a very simple report of names and departments.  The report has a grouping to print departments and does a page break after a department to start a new one.

Sales
  John Smith
  Mary Jones

Human Resources
  Steve Garcias
  Jeremy Doe

Etc...

However, I'd like the Department Name to print all the way at the very bottom of the page so that every page has its department on the bottom, in the same spot regardless of how many names are on the page (or if the list of names spans several pages each page prints the department name in the same spot).  If I add the department name to the Group Footer, it prints directly after the names and I noticed on the forums you cannot align the group footer to the bottom of the page.  If I put the department in the Page footer, it just prints the first department name on every page. 

This is a simple task in an Access Database Report, but how can I do this in Telerik?

12 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 14 Dec 2010, 07:16 PM
Hi David Gallant,

The PageHeader and PageFooter sections are not related to the report itself, but are relative to the margins of the report's media, while the Table item is a data driven item. Thus while the Table item is expected to grow depending on it's datasource as data item, the Page Header and the Page Footer section's height and width will remain fixed.For general information related to the sections please check out the Understanding Report Sections help article.

In order to have the correct Department name in a page footer our suggestion is to use an unbound group (group without grouping) and set the group footer PrintOnEveryPage to True. Then you can use the group footer instead of a page footer section.

Check out the attached sample report.

Kind regards,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
David Gallant
Top achievements
Rank 1
answered on 19 Jan 2011, 09:44 PM
I already have the Department Name in an unbound Group, however it prints the Department Name on each page immediately after the body, not aligned to the bottom of the page.  I opened the example you attached, and it has the same problem.  One line of code would not compile in Report1.designer.cs (line 120):

this.group1.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.Manufacturer")});

Visual Studio told me there was no "Groupings" namespace found.  I had to comment those 2 lines of code out for the solution to compile.  Could this be the problem?  I'm using the Q1 2010 build.

Full error:

error CS1061: 'Telerik.Reporting.Group' does not contain a definition for 'Groupings' and no extension method 'Groupings' accepting a first argument of type 'Telerik.Reporting.Group' could be found (are you missing a using directive or an assembly reference?)
0
Steve
Telerik team
answered on 20 Jan 2011, 08:48 AM
Hello David,

The error you received is due to changes in the API in the Q3 version.
As for your inquiry, this behavior is by design - i.e. all report sections after the detail would follow it immediately and this cannot be changed.

Sorry for the inconvenience.

All the best,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
David Gallant
Top achievements
Rank 1
answered on 20 Jan 2011, 12:32 PM
So how can I hack this report to get a value printed at the bottom of the page?  Unfortunately, it's a customer requirement, and they are very particular about how reports look.  I'm porting over reports from MS Access into a new .NET system and Access' Reporting can easily handle this.

Because I cannot put any dynamic data in the Page Footer, besides page #, I researched how to align a Group section to the bottom of the page on the forums here. I see that people have posted "it's on our TODO list" but those posts are over a year old.  Is this functionality something Telerik is going to support in the near future? 

Thanks.
0
Peter
Telerik team
answered on 25 Jan 2011, 04:18 PM
Hello David Gallant,

I have attached a sample report that shows how to use in a Page Footer section a Group Footer/Header TextBox values. Check out the textbox ItemDataBound event handler in code behind.

P.S. This approach would work only if a department is on a single page.

Give it a try and let us know if you need additional assistance.

Best wishes,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
David Gallant
Top achievements
Rank 1
answered on 01 Feb 2011, 06:40 PM
The code you sent has a compile error:
Car.cs(19,156): error CS0241: Default parameter specifiers are not permitted

However, when I fixed that, the report shows an error on Page 2. 

0
Peter
Telerik team
answered on 03 Feb 2011, 05:36 PM
Hi David Gallant,

The first error is because I have wrote the class in C# 4.0 and I have used optional parameters.
About the error on page 2, we will need more information, because locally we don't experience any troubles. I have double checked the sample and added it in an empty Class Library. Check out the attached updated sample project and let us know if you still experience any issues.

Greetings,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
David Gallant
Top achievements
Rank 1
answered on 03 Feb 2011, 05:58 PM
All the examples you give have the following line of code that wont compile:

 

this.manufacturerGroup.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.Manufacturer")});

My version (Q1 2010) does not have the "Groupings" property.

 

 

 

0
Peter
Telerik team
answered on 04 Feb 2011, 06:35 PM
Hello David Gallant,

For Q3 2010 we have made a small change in the API:

before Q3 2010  after Q3 2010 
 Grouping  Groupings
 Sorting  Sortings

Generally you can easily replace those types with Find and Replace dialog.

I have updated the sample for previous versions of Telerik Reporting.

Best wishes,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
David Gallant
Top achievements
Rank 1
answered on 04 Feb 2011, 06:42 PM
Got it.  It works with your example, however why does it get messed up when I add a bunch of Nissan cars so that Nissans expand multiple pages?  First page of the Nissans prints Nissan, the next page (which still has more Nissans) prints BMW.
0
Peter
Telerik team
answered on 09 Feb 2011, 05:53 PM
Hello David Gallant,

This approach would only work if a manufacturer is on a single page. We have noted that in the original post the contains the example, as this is "hack" to get what you want.

All the best,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
David Gallant
Top achievements
Rank 1
answered on 10 Feb 2011, 09:33 PM
As many with most reports, a section may span multiple pages.

After looking over some other features of Telerik, I finaly found a work around.

Using the example posted, create the report and place an unbound text box in the page footer.
Set the unbound text box to print out the value of a Report Paramater.

In your code, sort your data, then create an instance of the report for each Grouping.  So in this example, create an instance of the report feeding it Honda data and setting the report Paramater to "Honda", then create another report instance for Nissan setting the Paramter to "Nissan".  Make sure you set the "mergable" property on your report params to false.

Now create a ReportBook to merge all your reports together.
Tags
General Discussions
Asked by
David Gallant
Top achievements
Rank 1
Answers by
Peter
Telerik team
David Gallant
Top achievements
Rank 1
Steve
Telerik team
Share this question
or