Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Client Side Master Detail Report - some parameters or credentials have not been specified Expand / Collapse
Posted Saturday, March 16, 2013 5:35 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, March 22, 2016 2:30 PM
Points: 90, Visits: 178

I am trying to create a report in C#, WPF using Visual Studio 2010 and the ReportViewer to display an RDLC (Client Side Report) but am having difficulty finding any examples/tutorials on this.

The report is to show some customer details along with two subreports, one showing the customer's email addresses and one showing the customer's phone numbers.

I have created the Email Address subreport which accepts a parameter called Cus_PK (the customer Primary Key) and has a dataset based on the email addresses table.

I have created the customer report and dropped tablix which is driven by the customer dataset and a subreport on it setting the properties of the subreport to my email address subreport and passing the parameter of Cus_PK - the PKs are guid/uniqueidentifiers so I set the value of the parameter like this: =Fields!cus_PK.Value.ToString()

From what I have found online I need to handle the subreport processing in code but have not found an example close to what I am doing:

                // Add a handler for the SubreportProcessing event
_reportViewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);

private void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
CustomerListingEmailDataSet dataset = new CustomerListingEmailDataSet();
dataset.EnforceConstraints = false;
reportDataSource1.Name = "DataSet1";

reportDataSource1.Value = dataset.EmailAddressesSelectByCustomerFK;

this._reportViewer.LocalReport.ReportEmbeddedResource = "SamaanSystems.IBC.WPF.Reports.CustomerListingEmailSubReport.rdlc";
//this._reportViewer.LocalReport.ReportEmbeddedResource = "SamaanSystems.IBC.WPF.Reports.CustomerListing.rdlc";

CustomerListingEmailDataSetTableAdapters.EmailAddressesSelectByCustomerFKTableAdapter emailTableAdapter
= new CustomerListingEmailDataSetTableAdapters.EmailAddressesSelectByCustomerFKTableAdapter();

emailTableAdapter.ClearBeforeFill = true;
Guid cusPK = new Guid(e.Parameters[0].Values[0]);
emailTableAdapter.Fill(dataset.EmailAddressesSelectByCustomerFK, cusPK);

e.DataSources.Add(new ReportDataSource(e.DataSourceNames[0], "CustomerListingEmailDataSet"));

Is this the way to do it? If so, I am getting a message on the report preview: some parameters or credentials have not been specified

Can anyone help me over this last hurdle, please?
Post #1431879
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse