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

Report - Best approach

3 Answers 19 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcos
Top achievements
Rank 1
Marcos asked on 21 Jul 2015, 10:29 AM

Hello! 

I have a mvc project and in a form submit i have in my hands a complex object.

Lets assume that the object is:

Warehouse,

City

Country

Date

ProductPrice

Product

 Quantity

The list of object is already filtered by warehouse city and country, and the goal is to build the report with that in the Header, and a list of lines with:

Date, Product, Price (base on the quantity and price), 

 and then Total's (Total price).

 

Is there a way to do all by code? Whats the best aproach to accomplish this?

 

Thanks! 

M. Macias

 

 

ps: I dont want to use the table wizard to get the datasource, because it must be calculated in server side. ​

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 22 Jul 2015, 01:15 PM
Hello Macias,

The recommended approach is to use the integrated in VS Report Designer and design the report with sample data. Then you can re-use and modify the code generated in the report's Designer.CS|VB file in order to generate a report from scratch.

To group data you can use directly report groups or add a Table/List/Crosstab item and groupings in it. Totals can be displayed in a GroupFooteRsection, ReportFooterSection or other depending on the designed layout. To calculate aggregates based on a specific scope, you can use Data functions.


I hope the provided information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Marcos
Top achievements
Rank 1
answered on 22 Jul 2015, 03:09 PM

Thanks for the quick answer, im new in the report's of telerik.

 

I had already found out the crosstab method. I've a list that im sending to the datasource, if i send to a table it will print multiple rows.

 

In the crosstab,  i have a list of objects, 

Country, Warehouse, day

PT, Warehouse 1, 15

PT, Warehouse ​2, 17

EN, Warehouse 1, 11

 

I want to group by the Country and i've added the fields.Country to the "rows fields", and the Warehouse and Day fields, to the data fields, but the only thing that prints its the first element. The other two are missing, what am i missing? 

 the result should be: 

PT,              Warehouse 1, 15
                   Warehouse ​2, 17


EN,               Warehouse 1, 11

0
Stef
Telerik team
answered on 23 Jul 2015, 01:19 PM
Hello Marcos,

Please test creating the item with the VS Report Designer and specify a grouping as in How to: Add groups to Table item and Crosstab item. Finally, you can reuse the code in the report's designer.cs|vb file and check how rows are organized in table groups.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Marcos
Top achievements
Rank 1
Answers by
Stef
Telerik team
Marcos
Top achievements
Rank 1
Share this question
or