SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Client Side Master Detail Report - some parameters or credentials have not been specified


Client Side Master Detail Report - some parameters or credentials have not been specified

Author
Message
Frank Cazabon
Frank Cazabon
SSC Eights!
SSC Eights! (844 reputation)SSC Eights! (844 reputation)SSC Eights! (844 reputation)SSC Eights! (844 reputation)SSC Eights! (844 reputation)SSC Eights! (844 reputation)SSC Eights! (844 reputation)SSC Eights! (844 reputation)

Group: General Forum Members
Points: 844 Visits: 184
Hi,

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.BeginInit();
dataset.EnforceConstraints = false;
reportDataSource1.Name = "DataSet1";

reportDataSource1.Value = dataset.EmailAddressesSelectByCustomerFK;
this._reportViewer.LocalReport.DataSources.Add(reportDataSource1);

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

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?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search