473,782 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error: Subreport could not be shown

I have created a report and subreport in VB/ASP.NET. The report works fine
but the subreport will not display. The subreport, when displayed as a
standalone report, works fine.

Any help I can find on this error refers to the WinForms.Report Viewer and
none to the WebForms.Report Viewer.

Anyone have any guidance?
May 24 '07 #1
17 20344
Hi Herb,

From your description, you are using webform reportviewer to display two
SSRS report(client or server report?) in ASP.NET web page. However, the
main report display ok, but the subreport didn't display, correct?

As for the Sub report, have you tried any other very simple report to see
whether it is specific to the sub report's structure or content. Also, when
running the report, what's the error message you get for the subreport when
try displaying it?

Please feel free to let me know if there is anything I missed or if you
have any other finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

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

May 25 '07 #2
I have 1 .aspx form which contains 1 Webforms.Report Viewer object. The
LocalReport.Rep ortPath is to my REPORT1.rdlc

REPORT1.rdlc has a subreport with a ReportName of SUBREPORT1

There are no parameters passed between report and subreport.

When I run this, I get the "Subreport could not be shown" error.

If I add a second WebForms.Report Viewer to my .aspx form and link it to
SUBREPORT1.rdlc , it works fine.

"Steven Cheng[MSFT]" wrote:
Hi Herb,

From your description, you are using webform reportviewer to display two
SSRS report(client or server report?) in ASP.NET web page. However, the
main report display ok, but the subreport didn't display, correct?

As for the Sub report, have you tried any other very simple report to see
whether it is specific to the sub report's structure or content. Also, when
running the report, what's the error message you get for the subreport when
try displaying it?

Please feel free to let me know if there is anything I missed or if you
have any other finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

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

May 25 '07 #3
Additionally, when I link a very simple subreport (text only), it works.

My SUBREPORT1.rdlc refers to a data source and uses a SESSION variable for
it's criteria. Must it use a parameter from the main report?

"Herb" wrote:
I have 1 .aspx form which contains 1 Webforms.Report Viewer object. The
LocalReport.Rep ortPath is to my REPORT1.rdlc

REPORT1.rdlc has a subreport with a ReportName of SUBREPORT1

There are no parameters passed between report and subreport.

When I run this, I get the "Subreport could not be shown" error.

If I add a second WebForms.Report Viewer to my .aspx form and link it to
SUBREPORT1.rdlc , it works fine.

"Steven Cheng[MSFT]" wrote:
Hi Herb,

From your description, you are using webform reportviewer to display two
SSRS report(client or server report?) in ASP.NET web page. However, the
main report display ok, but the subreport didn't display, correct?

As for the Sub report, have you tried any other very simple report to see
whether it is specific to the sub report's structure or content. Also, when
running the report, what's the error message you get for the subreport when
try displaying it?

Please feel free to let me know if there is anything I missed or if you
have any other finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

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


May 25 '07 #4
Hi Herb,

I've performed some local tests and also found the problem when I use a
subreport that bind with some datasources. And after some further research,
I found an existing issue, this is due to the subreport also need to define
its datasource in the main report's page. Actually, both the main report
and subreport will look for datasource/dataset from the hosting aspx
page(where the reportviewer reside). Do you think this is the cause of your
problem. If so , here is a solution to it:

*** Problem Description ***
If you show a report with a subreport in the ReportViewer control and the
ReportViewer control is set to "local", you will get these error messages:

in the VS output window: Warning: An error occurred while executing the
subreport
'subreport1': An error has occurred during report processing.
(rsErrorExecuti ngSubreport)

in the ReportViewer, we get the message: Error: Subreport could not be shown

<><><><><><><>< ><><><><><><><> <><><><><><><>< ><><><><><><><> <><><><><><><>< >
<>
*** Resolution ***
In the form that contains the ReportViewer control, you must add an event
handler.
In that event handler, you must manually bind the subreport datasource:
--------------------------------------------------------
Private Sub Local_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'TODO: This line of code loads data into the
'AdventureWorks DataSet.Contact ' table. You can move, or remove it, as
needed.
Me.ContactTable Adapter.Fill(Me .AdventureWorks DataSet.Contact )

Dim instance As LocalReport = Me.ReportViewer 1.LocalReport
AddHandler ReportViewer1.L ocalReport.Subr eportProcessing , AddressOf
Me.SetSubDataSo urce

Me.ReportViewer 1.RefreshReport ()
End Sub

Public Sub SetSubDataSourc e(ByVal sender As Object, ByVal e As
SubreportProces singEventArgs)

e.DataSources.A dd(New ReportDataSourc e("AdventureWor ksDataSet_Conta ct",
Me.AdventureWor ksDataSet.Conta ct))
End Sub
--------------------------------------------------------

The table name is derived from the table adapter and the data source name
must be
copied from the report's datasources.
=============== =============== ====

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

May 29 '07 #5
I think you will find this example is for the Winforms.Report Viewer, not the
Webforms.Report Viewer. There is no .RefreshReport for the webforms version.
Did you try this in a web application? I was unable to get this to work in a
web application.

"Steven Cheng[MSFT]" wrote:
Hi Herb,

I've performed some local tests and also found the problem when I use a
subreport that bind with some datasources. And after some further research,
I found an existing issue, this is due to the subreport also need to define
its datasource in the main report's page. Actually, both the main report
and subreport will look for datasource/dataset from the hosting aspx
page(where the reportviewer reside). Do you think this is the cause of your
problem. If so , here is a solution to it:

*** Problem Description ***
If you show a report with a subreport in the ReportViewer control and the
ReportViewer control is set to "local", you will get these error messages:

in the VS output window: Warning: An error occurred while executing the
subreport
'subreport1': An error has occurred during report processing.
(rsErrorExecuti ngSubreport)

in the ReportViewer, we get the message: Error: Subreport could not be shown

<><><><><><><>< ><><><><><><><> <><><><><><><>< ><><><><><><><> <><><><><><><>< >
<>
*** Resolution ***
In the form that contains the ReportViewer control, you must add an event
handler.
In that event handler, you must manually bind the subreport datasource:
--------------------------------------------------------
Private Sub Local_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'TODO: This line of code loads data into the
'AdventureWorks DataSet.Contact ' table. You can move, or remove it, as
needed.
Me.ContactTable Adapter.Fill(Me .AdventureWorks DataSet.Contact )

Dim instance As LocalReport = Me.ReportViewer 1.LocalReport
AddHandler ReportViewer1.L ocalReport.Subr eportProcessing , AddressOf
Me.SetSubDataSo urce

Me.ReportViewer 1.RefreshReport ()
End Sub

Public Sub SetSubDataSourc e(ByVal sender As Object, ByVal e As
SubreportProces singEventArgs)

e.DataSources.A dd(New ReportDataSourc e("AdventureWor ksDataSet_Conta ct",
Me.AdventureWor ksDataSet.Conta ct))
End Sub
--------------------------------------------------------

The table name is derived from the table adapter and the data source name
must be
copied from the report's datasources.
=============== =============== ====

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

May 29 '07 #6
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.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
ReportViewer1.L ocalReport.Subr eportProcessing += new
SubreportProces singEventHandle r(SetSubDataSou rce);
this.ReportView er1.LocalReport .Refresh();
}

public void SetSubDataSourc e(object sender,
SubreportProces singEventArgs e )
{
e.DataSources.A dd(new ReportDataSourc e("DataSet1_rpt _table",
"ObjectDataSour ce1"));

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

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

May 31 '07 #7
Steven,

My ReportViewer1.L ocalReport does not include a SubreportProces sing command.

If you could provide VB examples, I would appreciate it.

"Steven Cheng[MSFT]" wrote:
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.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
ReportViewer1.L ocalReport.Subr eportProcessing += new
SubreportProces singEventHandle r(SetSubDataSou rce);
this.ReportView er1.LocalReport .Refresh();
}

public void SetSubDataSourc e(object sender,
SubreportProces singEventArgs e )
{
e.DataSources.A dd(new ReportDataSourc e("DataSet1_rpt _table",
"ObjectDataSour ce1"));

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

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 4 '07 #8
Thanks for your reply Herb,

For VB.NET page, you can directly type the
"reportViewer.L ocalReport.SubR eportProcessing " event regardless of the
intellisense support. Here is the converted VB.NET version of my test
page's codebehind:

=============== ==========
Imports Microsoft.Repor ting.WebForms

Partial Class vb_vbreportpage
Inherits System.Web.UI.P age

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
AddHandler ReportViewer1.L ocalReport.Subr eportProcessing , AddressOf
SetSubDataSourc e
ReportViewer1.L ocalReport.Refr esh()

End Sub
Public Sub SetSubDataSourc e(ByVal sender As Object, ByVal e As
SubreportProces singEventArgs)

e.DataSources.A dd(New ReportDataSourc e("DataSet1_rpt _table",
"ObjectDataSour ce1"))

End Sub

End Class
=============== =============

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 6 '07 #9
Thanks for the reply, sorry I have been away fromthis project for a while and
some of this has slipped my mind. When you refer to:
e.DataSources.A dd(New ReportDataSourc e ("DataSet1_rpt_ table",
"ObjectDataSour ce1"))
what is meant by the ObjectDataSourc e1? I understand the DataSet1_rpt_ta ble
is the dataset of the subreport. Is the ObjectDataSourc e1 the view which the
dataset refers to?

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

For VB.NET page, you can directly type the
"reportViewer.L ocalReport.SubR eportProcessing " event regardless of the
intellisense support. Here is the converted VB.NET version of my test
page's codebehind:

=============== ==========
Imports Microsoft.Repor ting.WebForms

Partial Class vb_vbreportpage
Inherits System.Web.UI.P age

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
AddHandler ReportViewer1.L ocalReport.Subr eportProcessing , AddressOf
SetSubDataSourc e
ReportViewer1.L ocalReport.Refr esh()

End Sub
Public Sub SetSubDataSourc e(ByVal sender As Object, ByVal e As
SubreportProces singEventArgs)

e.DataSources.A dd(New ReportDataSourc e("DataSet1_rpt _table",
"ObjectDataSour ce1"))

End Sub

End Class
=============== =============

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 8 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2646
by: Benny Ng | last post by:
Hi,All, When i deploy Enterprise library with my application ,i used XCOPY to deploy it into my test server. But when application runs, shown some error related registry. (But actually I haven't any method or component to wrote registry) After I used "InstallUtil" to registry Enterprise Library (those DLLs) to the deployment server, the application runs smoothly. Now I wonder why i need to registry those Enterprise Library DLLs into
1
4747
by: Jéjé | last post by:
Hi, When I try to display a report with a subreport using the reportviewer control, I receive this error: Error: Subreport could not be shown. I have 1 paraneter between my 2 reports which is correctly defined.
3
1729
by: MilanB | last post by:
Hello I have C# code that normaly throw exception and error message is shown. It's works fine. Separatlely I have ATL Component. When ATL Componenet fires event, and later C# code is called, no exception is shown. Function is just exited and no error is shown. Any help?
3
35645
by: KimberlyLord | last post by:
I have created a report and subreport in VB/ASP.NET. The report works fine but the subreport will not display. The subreport, when displayed as a standalone report, works fine. But when viewed as a subreport I get the error that the datasource for the subreport is missing. I set a breakpoint in the sub that should set the subreport's datasource and the breakpoint is never hit. I have added a handler like shown in many examples. Why is the...
0
1487
by: pavankumarganesuni | last post by:
Hello Iam Facing a Problem While Creating Subreports In RDLC I Create A New Phyical DataSet For the Sub Report And I Bind It To the SubReport The Dataset Having Values Then the subreport is showing If the dataset is empty then the message Error:SubReport Could not be shown Is Displaying Please Give Information How Can I Hide It While The dataset Is Not Containing Any Data Thanks & Regards
0
1562
by: biswajitkundu2007 | last post by:
How to implement subreport in vb.net RDLC report?? I have the following code but it gives the error :-error subreport could not be shown Private orderDetailsData As DataTable = Nothing Public Sub DemoSubreportProcessingEventHandler(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs) e.DataSources.Add(New ReportDataSource("DataSetHelp_tbl_details", orderDetailsData)) End Sub Private Sub...
2
2910
by: Dean Slindee | last post by:
With VS2005/Vista using the ReportViewer control, on my development PC I have a report with an embedded subreport. The report/subreport runs fine in VS test as well as ClickOnce deployed on the development PC. However, when ClickOnce deployed on user PC's over a network, the report runs, but in the subreport area is the message: "ERROR: subreport could not be shown". If the report can run as deployed by ClickOnce on my PC, then I tend...
0
947
by: Manikandan Pushkaran | last post by:
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
1
1461
by: puneetmca | last post by:
hi... i want to update employee's record but its not being updated.....can u help me out.... no error is shown to me..... <html> <body bgcolor="pink">
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.