Error: Subreport could not be shown

M

Manikandan Pushkaran

Dear All


I made a Header Report and a Detail report, the detail report having a
report parameter, the header report am refreshing with a value when we
select a value from the drop down and refresh, how ever my detail report
is not refreshing with the parent report, parent report refresh its
data.

so how can i do this, here my problem is, i am not able to filter the
subreport value, corresponding to the master report filter.

did any one did this if yes please help in doing this.



good day

Thanks in advance

Manikandan
 
R

Rayan Sequeira

This Worked for me. Try this
I Created a Main report with a subreport which takes one parameter from
the Main Report. I Added the following code.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
AddHandler rvReport.LocalReport.SubreportProcessing,
AddressOf SetSubDataSource
rvReport.LocalReport.Refresh()
End Sub

Public Sub SetSubDataSource(ByVal sender As Object, ByVal e As
SubreportProcessingEventArgs)
e.DataSources.Add(New ReportDataSource("SubReport",
"ObjectDataSourceSubReport"))

ObjectDataSourceSubReport.SelectParameters("SubReportID").DefaultValue =
e.Parameters("SubReportID").Values(0)
End Sub
 
Joined
Jun 19, 2008
Messages
1
Reaction score
0
SubReport is not Displaing Data it displays only Column Name??. what should I do

Regards
Mahesh

Steven Cheng[MSFT] said:
Thanks for your reply Herb,

Yes, the original issue record is for a winform reportviewer issue,
however, it also applies to webform scenario. And I did change the code in
my local test page, but forgot to modify it when paste the original code
snippet to you. Here is the test code in my test page:

(you need two datasources on the page, one for your main report and another
for the subreport)
===========================
public partial class test_reportpage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ReportViewer1.LocalReport.SubreportProcessing += new
SubreportProcessingEventHandler(SetSubDataSource);
this.ReportViewer1.LocalReport.Refresh();
}

public void SetSubDataSource(object sender,
SubreportProcessingEventArgs e )
{
e.DataSources.Add(new ReportDataSource("DataSet1_rpt_table",
"ObjectDataSource1"));

}
}
=============================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Mark Ainsworth

I am haveing exactly the same problem. I tried adding the code, (C#-
Visual Studio 2008) and it a breakpoint set in the
SubReportProcessingHandler does not seem to ever be executed. I
conclude that the subreport processing is not happening at all. Any
clues? Chris, did you resolve your issue?

Thanks,
Mark
 
M

Mark Ainsworth

I am having the exact same problem. The SubReportProcessingHandler does
not seem to get executed.

Thanks,
Mark
 
M

Mark Ainsworth

A new wrinkle.

If I delete the parameters in the subreport object on my main report.
The sub report displays (using the default values defined in the report
being used for the subreport.

Has anyone seen this phenomenon?

Thanks,
Mark
 
Joined
May 16, 2009
Messages
1
Reaction score
0
Sub Report event handler never fires

Sub Report event handler never fires...my main report works fine, if I take out subreport completely. Soem suggested using ReportViewer1.LocalReport.LoadSubreportDefinition, but does not work, not to mention you need file system persmission if using this approach.



ReportViewer1.ProcessingMode = ProcessingMode.Local
'Create Report Data Source
Dim rptDataSource As New Microsoft.Reporting.WebForms.ReportDataSource("MRreport_GetMRReportViewerData", GetDataSource())

ReportViewer1.LocalReport.DataSources.Add(rptDataSource)
ReportViewer1.LocalReport.ReportPath = "MORTALITYREPORT\MRreport.rdlc"
ReportViewer1.LocalReport.EnableHyperlinks = True
'Dim subreportpath As String = Server.MapPath("attachment.rdlc")
'Dim FS As New System.IO.StreamReader(subreportpath, FileMode.Open)
'ReportViewer1.LocalReport.LoadSubreportDefinition(Server.MapPath("attachment.rdlc"), FS)
AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf SubreportProcessingEventHandler
Me.ReportViewer1.LocalReport.Refresh()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top