简体   繁体   中英

RDLC report wpf C#

I am working on an RDLC report in C#. I have the following database schema.

Contact Class:

String name; int mobile_id

Mobile Class:

string number

Bank Class:

string bank number;
string bank names

A contact can have multiple mobile numbers and also multiple bank numbers.

I want to show the records on the report such that every contacts name, mobile numbers and bank details are shown. How can I get this?

Are you implying that this report is for a single person only... and not going to be for multiple people?? (primarily for security purposes printing such a report with all data for all customers / accounts would be a bad thing.

If the report is single person based, then you should be able to create a dataset, query each on respective criteria into their own returned data tables and have all 3 data tables in the report. Then, just have multiple Tablix (data grids) in the report for each respective data source...

DataTable tblCustomerInfo = YourQueryToGetCustomerData( customerID );
DataTable tblContactNumbers = YourQueryToGetContacts( customerID );
DataTable tblBankAcnts = YourQueryToGetContacts( customerID );

tblCustomerInfo.TableName = "CustInfo";
tblContactNumbers.TableName = "Contacts";
tblBankAcnts.TableName = "BankAcnts";

DataSet dsAllTables = new DataSet();
dsAllTables.Add( tblCustomerInfo );
dsAllTables.Add( tblContactNumbers );
dsAllTables.Add( BankAcnts );


// Then, you can write out the XSD for the report for named references to the table/columns
dsAllTables.WriteXmlSchema( "YourReport.xsd");
dsAllTables.WriteXml( "YourReport.xml");

Then, edit your report, add reference to this schema that will have all the data you anticipate using in the report and lay it out as needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM