473,793 Members | 2,974 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
17 20348
Hi Herb,

The "ObjectDataSour ce1" is the ID of a ObjectDataSourc e control which
supply the datasource(Data Set) for the report(displaye d in ReportViewer).
Actually in Visual Studio 2005 designer, when you choose a client rdlc
report in the ReportViewer, it will automatically generate an
ObjectDataSourc e control in aspx page for you. However, here since you use
subreport, you need to manually add an ObjectDataSourc e control that can
supply dataset for your subreport. However, one trick to add such a
ObjectDataSourc e is add another ReportViewer that display the subreport
individually, and it can automatically help you generate such a DataSource
control. After that you can remove the temp reportViewer and keep the
ObjectDataSourc e and use it for the first ReportViewer (that use sub
report).

Sincerely,

Steven Cheng

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

Jun 11 '07 #11
Hi Herb,

Have you got any progress? Does the further info in my last reply also
helps some?

Sincerely,

Steven Cheng

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

Jun 13 '07 #12
Steven,
Sorry, I have been having some PC issues. I will test this by Monday and get
back to you.

Thanks,
Herb

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

Have you got any progress? Does the further info in my last reply also
helps some?

Sincerely,

Steven Cheng

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

Jun 14 '07 #13
Steven,
That worked great, thank you!

Next question. I need to add ANOTHER subreport to this report. Is that
possible? Should I close this topic and start a new question?

Thanks

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

Have you got any progress? Does the further info in my last reply also
helps some?

Sincerely,

Steven Cheng

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

Jun 14 '07 #14
Forget I asked. I found that adding a second event handler did the trick.
Thanks a lot for your help.

"Herb" wrote:
Steven,
That worked great, thank you!

Next question. I need to add ANOTHER subreport to this report. Is that
possible? Should I close this topic and start a new question?

Thanks

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

Have you got any progress? Does the further info in my last reply also
helps some?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 14 '07 #15
Thanks for your followup Herb,

Glad that you've got it working.

Have a good day!

Sincerely,

Steven Cheng

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

Jun 17 '07 #16
Hi Steven or Herb (or anyone),

I followed this discussion carefully - it seems to match my situation
very closely, but I did not get the success that Herb did at the end.

I'm working in Visual Web Developer 2005, using ASP.NET and VB 2005.

I am trying to create a report with a sub-report.

I first got a basic main report going - created a dataset based on
a simple query, and have no problem generating simple reports using
the ReportViewer control and a corresponding ObjectDataSourc e that
refers to the dataset tableadapter.

Next I created a "static" subreport (just to try walking before
crawling!). It does not depend on any dataset - it just provides
some static text. I include that as a sub-report in my main report
and it works fine.

Next I created a new dataset for the "real" sub-report. It takes a
single parameter - the key field from the "main" dataset. The aim is
that, when coupled with the main report, it will return the related
records in the sub-dataset for each record in the main report/dataset.
I test this sub-report by hard-coding a default value for the
parameter and it works fine as a stand-alone report, displaying the
correct related records from the sub-dataset for the hard-coded
parameter key value.

So... the last step is to put the sub-report into the main report. I
drop a subreport control into the main report's list control just
like I did with the static sub-report, right-click on it to open
the Properties dialog, choose the "real" sub-report (not the static
one this time) in the General tab, and finally set the parameter on
the Parameters tab (parameter name is SiteID, parameter value is
set from the drop-down to =Fields!SiteID. Value). This was my first
attempt and I thought it would be sufficient, but instead of getting
the sub-reports I get the error message:

Error: Subreport could not be shown.

That's when I found your recent discussion, and I tried what seemed to
be the 2 key issues in the solution: (1) adding some code-behind to
set the sub-datasource in the processingevent handler, and (2) adding
an <asp:ObjectData Sourcefor the sub-dataset to the aspx page. Having
done both of those, the error remains.

I set a breakpoint in the SetSubDataSourc e() handler - it never
fires, so I infer that the SubreportProces sing event is not being
raised(?).

I'm sure the devil is in the details, and I can provide those to
you as we go - this message is already too long, so I'll leave it
here for now and hope to hear from one of you soon... Thanks in
advance!

Chris

*** Sent via Developersdex http://www.developersdex.com ***
Jun 21 '07 #17
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.EventArg s) Handles Me.Load
AddHandler rvReport.LocalR eport.Subreport Processing,
AddressOf SetSubDataSourc e
rvReport.LocalR eport.Refresh()
End Sub

Public Sub SetSubDataSourc e(ByVal sender As Object, ByVal e As
SubreportProces singEventArgs)
e.DataSources.A dd(New ReportDataSourc e("SubReport" ,
"ObjectDataSour ceSubReport"))

ObjectDataSourc eSubReport.Sele ctParameters("S ubReportID").De faultValue =
e.Parameters("S ubReportID").Va lues(0)
End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #18

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

Similar topics

0
2647
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
1730
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
1563
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
2913
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
1463
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
9518
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
10211
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...
0
10000
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
9033
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...
0
6776
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();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
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
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.