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

report with two tables

1 Answer 444 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bassam Yousif
Top achievements
Rank 1
Bassam Yousif asked on 26 Jun 2007, 09:49 AM
 

hi,

we are trying to create a printed invoice for our system as a Report. is that possible using telerik reporting?

the case that we have is that the invoice items are seperated into two tables, each one with its own columns and layout and database query.

the invoice lay out should be like following:

 

Invoice
Date: 19-Jun-07
no: inv2223/2007
table 1
refrence supplier city PO no Price
1 A B 123 890
2 c d 23 123
3 e g 43 321
table 2
type Description Price
typ1 description1 43
typ2 description2 54
typ3 description3 76
total (total of prices)

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 27 Jun 2007, 03:39 PM
Hi Bassam,

This invoice can be printed with a report with two subreports.

In the attached demo you will find a similar report which shows the price and discount of an order. In the report and respective subreports I have used a SQL query with a parameter which is initialized at runtime. Subreports are driven through the NeedDataSource event handler.

Some important points:
  • UI:
    • Use the textbox edit control on the main form to enter the Order ID
    • Press the Preview button to generate report (you will need to compile before that)
       
  • Code:
    • Review the PeviewButton_Click method in class Form1. It initializes the report's OrderID property and generates the report;
    • The methods SetFilter in OrderReport, OrderPriceReport and OrderDiscountReport classes set the parameter value for the data query;
    • The event handlers OrderPriceSubreport_NeedDataSource and OrderDiscountSubreport_NeedDataSource in class OrderReport are the essential elements of the subreport processing.
       
  • DB:
    • The demo project works with AdventureWorksT database which is installed with Telerik Reporting.
Regards,
Ivan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Bassam Yousif
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or