Showing posts with label dataset. Show all posts
Showing posts with label dataset. Show all posts

Friday, February 17, 2012

Error: Subreport could not be shown

I am a new one in using ReportViewer in VS 2005. I try to use Main and Sub report to show data from my dataset. It doesn't matter if I use main report only, but the problem is when I use subreport intergrated with the main report. When I run it in browser, it shows:

Error: Subreport could not be shown

The main report is ok.Is there any solution to the problem?

Thank for your help!!!!

Hello,

Are you able to view the subreport if you navigate to it directly? If so, you probably havean issue with the subreport reference in the parent report.|||

hi mike,

How can we set sub report references in the parent report of reportviewer?

If you have a ready code or steps pls post since its urgent.

thanks and regards,

unni

|||

http://gotreportviewer.com has some examples of using subreports. Have you looked at those?

-Albert

|||

hi albert,

i tried the url and i used the code meant for subreport processing but the event doesnt get fired.

the dataset for subreport can only be set if the event gets fired. i will attach the code to make it more clear

Dim params(3) As ReportParameter
params(0) = New ReportParameter("ClientName", CStr(Session("ClientID")))
params(1) = New ReportParameter("Service", CStr(Session("ServicePeriodID")))
params(2) = New ReportParameter("FullName", CStr(Session("FullName")))
params(3) = New ReportParameter("ServiceName", CStr(Session("Period")))

Me.rvBusinessInc.ProcessingMode = ProcessingMode.Local
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t1", DSBIReport))
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t2", DSAgency))
AddHandler rvBusinessInc.LocalReport.SubreportProcessing, AddressOf LocalReport_SubreportProcessing

rvBusinessInc.LocalReport.SetParameters(params)
rvBusinessInc.LocalReport.Refresh()

I'm still gettin the error assubreport cannot be found.
thanks and regards,
unni
|||

Run your website in the debugger and enable catching all exceptions. Are any exceptions being throwh?

-Albert

|||

Hi,

I ran into same problem and found the follwoing two reasons for subreport error:

1. Make sure that all the parameters of the subreport have been assigned a value during design

2. Also, if you are referencing/using any external DLLs or classes from .Net Framerwork (see references tab in report properties dialog) then make sure that you confugure report viewer control for that.

Good Luck!

Naqsh

|||Hi,
I am having a lot of trouble with the report viewer as well. No matter what I try I get Error: Subreport cannot be displayed.
This is the latest code that i am using:

Imports Microsoft.Reporting.WebForms

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load

'Wire up the event that will allow us to bind the sub report
AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf ReportViewer_SubreportProcessing
ReportViewer1.LocalReport.Refresh()

End Sub

Private Sub ReportViewer_SubreportProcessing(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
Dim params(1) As ReportParameter
params(0) = New ReportParameter("questionid", CStr(e.Parameters("questionid").ToString))
ReportViewer1.LocalReport.SetParameters(params)
ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DataSet2_templBPQues", ObjectDataSource2))
End Sub

End Class

|||

Hi,

First, You should not be using subreportprocessing event to set the main report parameters.

Does your report has one subreport or more than one? Look at the example code which comes with VS 2005.

Naqsh

|||I am just building some test reports to get an idea of how it all works but my project report has 3 subreports.|||

Nope I can't see anyway to set the subreport parameters from id values passed from the Main report. Can you post an example of how this is done. There are no examples of how to do this anywhere. They all gloss over this unless it means you don't have to in which case my report has some other problem.

Thanks very much.

|||Don't know if you are still struggling with this one, but passing parameters to subreports is simply a case of right click on the subreport where you have included it in the main report, open the Properties and Parameters Tab and specify the link between the main and subreport. As long as you have set up the correct filter in the subreport design itself, you should just be able to pick from the drop downs and choose the corresponding column to assign it to from the main dataset.....

Error: Subreport could not be shown

I am a new one in using ReportViewer in VS 2005. I try to use Main and Sub report to show data from my dataset. It doesn't matter if I use main report only, but the problem is when I use subreport intergrated with the main report. When I run it in browser, it shows:

Error: Subreport could not be shown

The main report is ok.Is there any solution to the problem?

Thank for your help!!!!Hello,

Are you able to view the subreport if you navigate to it directly? If so, you probably havean issue with the subreport reference in the parent report.|||

hi mike,

How can we set sub report references in the parent report of reportviewer?

If you have a ready code or steps pls post since its urgent.

thanks and regards,

unni

|||

http://gotreportviewer.com has some examples of using subreports. Have you looked at those?

-Albert

|||

hi albert,

i tried the url and i used the code meant for subreport processing but the event doesnt get fired.

the dataset for subreport can only be set if the event gets fired. i will attach the code to make it more clear

Dim params(3) As ReportParameter


params(0) = New ReportParameter("ClientName", CStr(Session("ClientID")))
params(1) = New ReportParameter("Service", CStr(Session("ServicePeriodID")))
params(2) = New ReportParameter("FullName", CStr(Session("FullName")))
params(3) = New ReportParameter("ServiceName", CStr(Session("Period")))

Me.rvBusinessInc.ProcessingMode = ProcessingMode.Local
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t1", DSBIReport))
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t2", DSAgency))
AddHandler rvBusinessInc.LocalReport.SubreportProcessing, AddressOf LocalReport_SubreportProcessing

rvBusinessInc.LocalReport.SetParameters(params)
rvBusinessInc.LocalReport.Refresh()

I'm still gettin the error as subreport cannot be found.
thanks and regards,
unni

|||

Run your website in the debugger and enable catching all exceptions. Are any exceptions being throwh?

-Albert

|||

Hi,

I ran into same problem and found the follwoing two reasons for subreport error:

1. Make sure that all the parameters of the subreport have been assigned a value during design

2. Also, if you are referencing/using any external DLLs or classes from .Net Framerwork (see references tab in report properties dialog) then make sure that you confugure report viewer control for that.

Good Luck!

Naqsh

|||Hi,
I am having a lot of trouble with the report viewer as well. No matter what I try I get Error: Subreport cannot be displayed.
This is the latest code that i am using:

Imports Microsoft.Reporting.WebForms

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load

'Wire up the event that will allow us to bind the sub report
AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf ReportViewer_SubreportProcessing
ReportViewer1.LocalReport.Refresh()

End Sub

Private Sub ReportViewer_SubreportProcessing(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
Dim params(1) As ReportParameter
params(0) = New ReportParameter("questionid", CStr(e.Parameters("questionid").ToString))
ReportViewer1.LocalReport.SetParameters(params)
ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DataSet2_templBPQues", ObjectDataSource2))
End Sub

End Class

|||

Hi,

First, You should not be using subreportprocessing event to set the main report parameters.

Does your report has one subreport or more than one? Look at the example code which comes with VS 2005.

Naqsh

|||I am just building some test reports to get an idea of how it all works but my project report has 3 subreports.|||

Nope I can't see anyway to set the subreport parameters from id values passed from the Main report. Can you post an example of how this is done. There are no examples of how to do this anywhere. They all gloss over this unless it means you don't have to in which case my report has some other problem.

Thanks very much.

|||Don't know if you are still struggling with this one, but passing parameters to subreports is simply a case of right click on the subreport where you have included it in the main report, open the Properties and Parameters Tab and specify the link between the main and subreport. As long as you have set up the correct filter in the subreport design itself, you should just be able to pick from the drop downs and choose the corresponding column to assign it to from the main dataset.....

Error: Subreport could not be shown

I am a new one in using ReportViewer in VS 2005. I try to use Main and Sub report to show data from my dataset. It doesn't matter if I use main report only, but the problem is when I use subreport intergrated with the main report. When I run it in browser, it shows:

Error: Subreport could not be shown

The main report is ok.Is there any solution to the problem?

Thank for your help!!!!Hello,

Are you able to view the subreport if you navigate to it directly? If so, you probably havean issue with the subreport reference in the parent report.|||

hi mike,

How can we set sub report references in the parent report of reportviewer?

If you have a ready code or steps pls post since its urgent.

thanks and regards,

unni

|||

http://gotreportviewer.com has some examples of using subreports. Have you looked at those?

-Albert

|||

hi albert,

i tried the url and i used the code meant for subreport processing but the event doesnt get fired.

the dataset for subreport can only be set if the event gets fired. i will attach the code to make it more clear

Dim params(3) As ReportParameter


params(0) = New ReportParameter("ClientName", CStr(Session("ClientID")))
params(1) = New ReportParameter("Service", CStr(Session("ServicePeriodID")))
params(2) = New ReportParameter("FullName", CStr(Session("FullName")))
params(3) = New ReportParameter("ServiceName", CStr(Session("Period")))

Me.rvBusinessInc.ProcessingMode = ProcessingMode.Local
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t1", DSBIReport))
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t2", DSAgency))
AddHandler rvBusinessInc.LocalReport.SubreportProcessing, AddressOf LocalReport_SubreportProcessing

rvBusinessInc.LocalReport.SetParameters(params)
rvBusinessInc.LocalReport.Refresh()

I'm still gettin the error as subreport cannot be found.
thanks and regards,
unni

|||

Run your website in the debugger and enable catching all exceptions. Are any exceptions being throwh?

-Albert

|||

Hi,

I ran into same problem and found the follwoing two reasons for subreport error:

1. Make sure that all the parameters of the subreport have been assigned a value during design

2. Also, if you are referencing/using any external DLLs or classes from .Net Framerwork (see references tab in report properties dialog) then make sure that you confugure report viewer control for that.

Good Luck!

Naqsh

|||Hi,
I am having a lot of trouble with the report viewer as well. No matter what I try I get Error: Subreport cannot be displayed.
This is the latest code that i am using:

Imports Microsoft.Reporting.WebForms

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load

'Wire up the event that will allow us to bind the sub report
AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf ReportViewer_SubreportProcessing
ReportViewer1.LocalReport.Refresh()

End Sub

Private Sub ReportViewer_SubreportProcessing(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
Dim params(1) As ReportParameter
params(0) = New ReportParameter("questionid", CStr(e.Parameters("questionid").ToString))
ReportViewer1.LocalReport.SetParameters(params)
ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DataSet2_templBPQues", ObjectDataSource2))
End Sub

End Class

|||

Hi,

First, You should not be using subreportprocessing event to set the main report parameters.

Does your report has one subreport or more than one? Look at the example code which comes with VS 2005.

Naqsh

|||I am just building some test reports to get an idea of how it all works but my project report has 3 subreports.|||

Nope I can't see anyway to set the subreport parameters from id values passed from the Main report. Can you post an example of how this is done. There are no examples of how to do this anywhere. They all gloss over this unless it means you don't have to in which case my report has some other problem.

Thanks very much.

|||Don't know if you are still struggling with this one, but passing parameters to subreports is simply a case of right click on the subreport where you have included it in the main report, open the Properties and Parameters Tab and specify the link between the main and subreport. As long as you have set up the correct filter in the subreport design itself, you should just be able to pick from the drop downs and choose the corresponding column to assign it to from the main dataset.....

Error: Subreport could not be shown

I am a new one in using ReportViewer in VS 2005. I try to use Main and Sub report to show data from my dataset. It doesn't matter if I use main report only, but the problem is when I use subreport intergrated with the main report. When I run it in browser, it shows:

Error: Subreport could not be shown

The main report is ok.Is there any solution to the problem?

Thank for your help!!!!Hello,

Are you able to view the subreport if you navigate to it directly? If so, you probably havean issue with the subreport reference in the parent report.|||

hi mike,

How can we set sub report references in the parent report of reportviewer?

If you have a ready code or steps pls post since its urgent.

thanks and regards,

unni

|||

http://gotreportviewer.com has some examples of using subreports. Have you looked at those?

-Albert

|||

hi albert,

i tried the url and i used the code meant for subreport processing but the event doesnt get fired.

the dataset for subreport can only be set if the event gets fired. i will attach the code to make it more clear

Dim params(3) As ReportParameter


params(0) = New ReportParameter("ClientName", CStr(Session("ClientID")))
params(1) = New ReportParameter("Service", CStr(Session("ServicePeriodID")))
params(2) = New ReportParameter("FullName", CStr(Session("FullName")))
params(3) = New ReportParameter("ServiceName", CStr(Session("Period")))

Me.rvBusinessInc.ProcessingMode = ProcessingMode.Local
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t1", DSBIReport))
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t2", DSAgency))
AddHandler rvBusinessInc.LocalReport.SubreportProcessing, AddressOf LocalReport_SubreportProcessing

rvBusinessInc.LocalReport.SetParameters(params)
rvBusinessInc.LocalReport.Refresh()

I'm still gettin the error as subreport cannot be found.
thanks and regards,
unni

|||

Run your website in the debugger and enable catching all exceptions. Are any exceptions being throwh?

-Albert

|||

Hi,

I ran into same problem and found the follwoing two reasons for subreport error:

1. Make sure that all the parameters of the subreport have been assigned a value during design

2. Also, if you are referencing/using any external DLLs or classes from .Net Framerwork (see references tab in report properties dialog) then make sure that you confugure report viewer control for that.

Good Luck!

Naqsh

|||Hi,
I am having a lot of trouble with the report viewer as well. No matter what I try I get Error: Subreport cannot be displayed.
This is the latest code that i am using:

Imports Microsoft.Reporting.WebForms

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load

'Wire up the event that will allow us to bind the sub report
AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf ReportViewer_SubreportProcessing
ReportViewer1.LocalReport.Refresh()

End Sub

Private Sub ReportViewer_SubreportProcessing(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
Dim params(1) As ReportParameter
params(0) = New ReportParameter("questionid", CStr(e.Parameters("questionid").ToString))
ReportViewer1.LocalReport.SetParameters(params)
ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DataSet2_templBPQues", ObjectDataSource2))
End Sub

End Class

|||

Hi,

First, You should not be using subreportprocessing event to set the main report parameters.

Does your report has one subreport or more than one? Look at the example code which comes with VS 2005.

Naqsh

|||I am just building some test reports to get an idea of how it all works but my project report has 3 subreports.|||

Nope I can't see anyway to set the subreport parameters from id values passed from the Main report. Can you post an example of how this is done. There are no examples of how to do this anywhere. They all gloss over this unless it means you don't have to in which case my report has some other problem.

Thanks very much.

|||Don't know if you are still struggling with this one, but passing parameters to subreports is simply a case of right click on the subreport where you have included it in the main report, open the Properties and Parameters Tab and specify the link between the main and subreport. As long as you have set up the correct filter in the subreport design itself, you should just be able to pick from the drop downs and choose the corresponding column to assign it to from the main dataset.....

Error: Subreport could not be shown

I am a new one in using ReportViewer in VS 2005. I try to use Main and Sub report to show data from my dataset. It doesn't matter if I use main report only, but the problem is when I use subreport intergrated with the main report. When I run it in browser, it shows:

Error: Subreport could not be shown

The main report is ok.Is there any solution to the problem?

Thank for your help!!!!

Hello,

Are you able to view the subreport if you navigate to it directly? If so, you probably havean issue with the subreport reference in the parent report.|||

hi mike,

How can we set sub report references in the parent report of reportviewer?

If you have a ready code or steps pls post since its urgent.

thanks and regards,

unni

|||

http://gotreportviewer.com has some examples of using subreports. Have you looked at those?

-Albert

|||

hi albert,

i tried the url and i used the code meant for subreport processing but the event doesnt get fired.

the dataset for subreport can only be set if the event gets fired. i will attach the code to make it more clear

Dim params(3) As ReportParameter
params(0) = New ReportParameter("ClientName", CStr(Session("ClientID")))
params(1) = New ReportParameter("Service", CStr(Session("ServicePeriodID")))
params(2) = New ReportParameter("FullName", CStr(Session("FullName")))
params(3) = New ReportParameter("ServiceName", CStr(Session("Period")))

Me.rvBusinessInc.ProcessingMode = ProcessingMode.Local
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t1", DSBIReport))
rvBusinessInc.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("t2", DSAgency))
AddHandler rvBusinessInc.LocalReport.SubreportProcessing, AddressOf LocalReport_SubreportProcessing

rvBusinessInc.LocalReport.SetParameters(params)
rvBusinessInc.LocalReport.Refresh()

I'm still gettin the error as subreport cannot be found.
thanks and regards,
unni

|||

Run your website in the debugger and enable catching all exceptions. Are any exceptions being throwh?

-Albert

|||

Hi,

I ran into same problem and found the follwoing two reasons for subreport error:

1. Make sure that all the parameters of the subreport have been assigned a value during design

2. Also, if you are referencing/using any external DLLs or classes from .Net Framerwork (see references tab in report properties dialog) then make sure that you confugure report viewer control for that.

Good Luck!

Naqsh

|||Hi,
I am having a lot of trouble with the report viewer as well. No matter what I try I get Error: Subreport cannot be displayed.
This is the latest code that i am using:

Imports Microsoft.Reporting.WebForms

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load

'Wire up the event that will allow us to bind the sub report
AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf ReportViewer_SubreportProcessing
ReportViewer1.LocalReport.Refresh()

End Sub

Private Sub ReportViewer_SubreportProcessing(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
Dim params(1) As ReportParameter
params(0) = New ReportParameter("questionid", CStr(e.Parameters("questionid").ToString))
ReportViewer1.LocalReport.SetParameters(params)
ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DataSet2_templBPQues", ObjectDataSource2))
End Sub

End Class

|||

Hi,

First, You should not be using subreportprocessing event to set the main report parameters.

Does your report has one subreport or more than one? Look at the example code which comes with VS 2005.

Naqsh

|||I am just building some test reports to get an idea of how it all works but my project report has 3 subreports.|||

Nope I can't see anyway to set the subreport parameters from id values passed from the Main report. Can you post an example of how this is done. There are no examples of how to do this anywhere. They all gloss over this unless it means you don't have to in which case my report has some other problem.

Thanks very much.

|||Don't know if you are still struggling with this one, but passing parameters to subreports is simply a case of right click on the subreport where you have included it in the main report, open the Properties and Parameters Tab and specify the link between the main and subreport. As long as you have set up the correct filter in the subreport design itself, you should just be able to pick from the drop downs and choose the corresponding column to assign it to from the main dataset.....

Wednesday, February 15, 2012

ERROR: Subreport cannot be shown

Hi,

I have a report (rdlc) which has a subreport. I have specified which report to use as my subreport. I created a dataset to pull all data from two tables. One table goes with the main report, the other goes with the subreport. I then created two sqldatasources and configured the first one to pull the data using parameter to fill the main report then configured the other to do the same for the subreport. I then configured my report to work in those two datasource instances. Then when I run my report I get ERROR: Subreport cannot be shown. But my main report section works fine. Also, if I change the report to just use my report that is the subreport, it works fine. I just can't get it to work as a subreport! PLEASE HELP! I am going insane!

I had the same problem, and found a solution. It appears that even if the parameters are named the same, the subreport will not get its parameter value set unless you connect it to the parameter that the main report is using.

Open the main report|||

I had the same problem, and found a solution. It appears that even if the parameters are named the same, the subreport will not get its parameter value set unless you connect it to the parameter that the main report is using.

Open the main report|||Thanks!|||

Hi Billy,

I have done the same thing as mentioned by you. But I am still not able to view the report. The main report goes in some loop. If I run main report & subreport separately then it is running perfectly fine. I have the same list of parameters for the main report as well as for the subreport.

Do I need to do something else besides this? Appreciate your help.

Thanks

Hitesh

|||

Hi, there

I got the same error with you. Just wonder did u solve your problem? I just sent your an email.

contact me atste_chen@.yahoo.com

thanks a lot !

steven

|||

Having the same parameter names will not cause the data to flow from the parent report to the sub report. Did you go through the bullet points above and map the parameter values from the parent report to the child report?

|||

You may need to handle the OnSubreportProcessing event in your code. Build a dataset of the table you want to use and add it to the SubreportProcessingEventArgs of the local report.

Private Sub ReportViewer_SubreportProcessing(ByVal senderAs Object,ByVal eAs SubreportProcessingEventArgs)Dim SubRptConnAs New SqlConnection("Connection string")Dim SubRptSqlCmdTextAs String ="SELECT * FROM Table;"Dim SubRptSqlCmdAs New SqlCommand(SubRptSqlCmdText, SubRptConn)Dim SubRptSqlDAAs New SqlDataAdapter(SubRptSqlCmd)Dim SubRptSqlDSAs New DataSet SubRptConn.Open()SubRptSqlDA.Fill(SubRptSqlDS)SubRptConn.Close()Dim SubRptDSAs New ReportDataSource("Activities_V_LINCS_ItenEventsDetail", SubRptSqlDS.Tables(0))e.DataSources.Add(SubRptDS)End Sub
|||

Has anyone figured this out?

I have my main report and my subreport with a parameter called X. Then on my sub report viewer control thing you place on the main report I have set the parameter to the same name and set the value to be the main report parameters (parameters!x.value).

This last post had a code regarding ReportViewer_SubreportProcessing, where does this go? My sub report is already bound to a table adapter.
Please help this is driving me nuts. I get the report could not be shown error.
Thanks.
-S

|||

I Have The Same Errot The SubreportProcessingEventHandler is fired up and the query Runs O.K. But The Sub Report Isn't Shown up ,

i Think It's Because in The local Report Mode the main report page doesnt refresh it self