Hy,
i'm working with Telerik Reporting and have some problems. I create one master report where i have report parameters and a header of the page. After user selects values for parameters (2x datetime, 4x Integer, 1x Boolean) i want to show right SubReport (if true then subreport1 else subreport2). Those two subreports use 6 parameter values from master report parameteres and I pass those values to SqlDataSource in each subreport.
If I delete one SubReport field my report works as it should. But if I have two SubReport fields on master report i get "Object reference not set to an instance of an object." I dont have any idea what i'm doing wrong.
I have test each subreport in designer and datasource are ok. In master report i have two DataBound methods where I set Visible to true or false which subreport to show.
I also set all 6 parameters that i use in subreport datasource.
I have attached two photos (one is my master report wher i have two subreports in detail section, and other shows report parameters that i pass to subreport).
First I was thinking that i do something wrong when i'm passing parameters to subreport but as i mentioned in the begining if i delete one subreport field from master report it works ok.
Sorry for my english but i hope you get the point what my problem is.
i'm working with Telerik Reporting and have some problems. I create one master report where i have report parameters and a header of the page. After user selects values for parameters (2x datetime, 4x Integer, 1x Boolean) i want to show right SubReport (if true then subreport1 else subreport2). Those two subreports use 6 parameter values from master report parameteres and I pass those values to SqlDataSource in each subreport.
If I delete one SubReport field my report works as it should. But if I have two SubReport fields on master report i get "Object reference not set to an instance of an object." I dont have any idea what i'm doing wrong.
I have test each subreport in designer and datasource are ok. In master report i have two DataBound methods where I set Visible to true or false which subreport to show.
public
static
bool
subMeseci =
true
;
private
void
subReport_PoMesecih_ItemDataBound(
object
sender, EventArgs e)
{
subMeseci = (
bool
)
this
.ReportParameters[
"months"
].Value;
if
(subMeseci)
(sender
as
Telerik.Reporting.Processing.SubReport).Visible =
true
;
else
(sender
as
Telerik.Reporting.Processing.SubReport).Visible =
false
;
}
private
void
subReport_Vse_ItemDataBound(
object
sender, EventArgs e)
{
subMeseci = (
bool
)
this
.ReportParameters[
"months"
].Value;
if
(subMeseci)
(sender
as
Telerik.Reporting.Processing.SubReport).Visible =
false
;
else
(sender
as
Telerik.Reporting.Processing.SubReport).Visible =
true
;
}
I also set all 6 parameters that i use in subreport datasource.
I have attached two photos (one is my master report wher i have two subreports in detail section, and other shows report parameters that i pass to subreport).
First I was thinking that i do something wrong when i'm passing parameters to subreport but as i mentioned in the begining if i delete one subreport field from master report it works ok.
Sorry for my english but i hope you get the point what my problem is.