Wednesday, March 28, 2012

Reportviewer and Treeview control help needed

hello
i have been trying to use a treeview control to provide navigation for
the reports. but when i click a report in the treeview, it renders on
the whole page instead of rendering in in a table where I have the
reportviewer control. basically i am not able to connect the
reportviewer to the treeview.
any hints or ideas ?
thanks very much
raviThe ReportViewer control uses an IFrame. Modify the control to assign a
name to that IFrame (i.e. myFrame) and add LinkTarget on your BuildUrlString
method (i.e. rc:LinkTarget=myFrame).
Hope this helps.
Marlon
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109104433.404071.71330@.f14g2000cwb.googlegroups.com...
> hello
> i have been trying to use a treeview control to provide navigation for
> the reports. but when i click a report in the treeview, it renders on
> the whole page instead of rendering in in a table where I have the
> reportviewer control. basically i am not able to connect the
> reportviewer to the treeview.
> any hints or ideas ?
> thanks very much
> ravi
>|||Marlon,
thx for the suggestion. I am very new to this .net web app development.
I checked the reportviewer code the render method which is spewing out
the tags etc.
I am not sure where do I add name for the Iframe. I presume in the
opening tag like
<iframe name = "myframe"> or sthg like that ?
Also how do i Compile this code ? when i do the normal F5 i get a
message asking me to assign a URL or project. I tried doing it and
built a new dll and removed and added the control in my project. I get
the "resource not found" error. Guess thats cos i havent attached the
name to the frame properly.
any suggestions will be very welcome.
Thanks
Ravi
Protected Overrides Sub Render(ByVal output As HtmlTextWriter)
If Me._serverUrl = String.Empty OrElse Me._reportPath =String.Empty Then
output.Write("<P style=""font-family: Verdana;
font-size: 11px"">")
output.Write("To render a report, enter the ServerUrl
and ReportPath.</P>")
Else
'Create IFrame if the user enters ServerUrl and
ReportPath
output.WriteBeginTag("iframe ")
output.WriteAttribute("src", Me.BuildUrlString())
output.WriteAttribute("width", Me.Width.ToString())
output.WriteAttribute("height", Me.Height.ToString())
output.WriteAttribute("style", "border: 1 solid
#C0C0C0")
output.WriteAttribute("border", "0")
output.WriteAttribute("frameborder", "0")
output.Write(HtmlTextWriter.TagRightChar)
output.WriteEndTag("iframe")
output.WriteLine()
End If
End Sub 'Render|||Ravi,
To assign a name, or add other attributes, to the IFrame, add the following
code in the Render method.
output.WriteAttribute("name","reportFrame");
Modify the BuildUrlString method to add:
this._url = this._serverUrl + "?" + this._reportPath +
"&rs:Command=Render&rc:LinkTarget=reportFrame" +
this.EmumProperties(this._properties);
Compile the ReportViewer.
To be sure you have the latest dll, remove the Report Viewer control, from
the tool bar, and add again. Check your references (i.e control names) on
your aspx page and in the code-behind.
Marlon
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109183582.644609.217650@.z14g2000cwz.googlegroups.com...
> Marlon,
> thx for the suggestion. I am very new to this .net web app development.
> I checked the reportviewer code the render method which is spewing out
> the tags etc.
> I am not sure where do I add name for the Iframe. I presume in the
> opening tag like
> <iframe name = "myframe"> or sthg like that ?
> Also how do i Compile this code ? when i do the normal F5 i get a
> message asking me to assign a URL or project. I tried doing it and
> built a new dll and removed and added the control in my project. I get
> the "resource not found" error. Guess thats cos i havent attached the
> name to the frame properly.
> any suggestions will be very welcome.
> Thanks
> Ravi
> Protected Overrides Sub Render(ByVal output As HtmlTextWriter)
> If Me._serverUrl = String.Empty OrElse Me._reportPath => String.Empty Then
> output.Write("<P style=""font-family: Verdana;
> font-size: 11px"">")
> output.Write("To render a report, enter the ServerUrl
> and ReportPath.</P>")
> Else
> 'Create IFrame if the user enters ServerUrl and
> ReportPath
> output.WriteBeginTag("iframe ")
> output.WriteAttribute("src", Me.BuildUrlString())
> output.WriteAttribute("width", Me.Width.ToString())
> output.WriteAttribute("height", Me.Height.ToString())
> output.WriteAttribute("style", "border: 1 solid
> #C0C0C0")
> output.WriteAttribute("border", "0")
> output.WriteAttribute("frameborder", "0")
> output.Write(HtmlTextWriter.TagRightChar)
> output.WriteEndTag("iframe")
> output.WriteLine()
> End If
> End Sub 'Render
>|||Hello Marlon,
Thanks for the reply. I figured out how to set the name etc. (so stupid
to ask such Qs). and also to compile the dll. Basically I am stuck with
this for a while and kind of jittery.
But i still get the same problem which says Resource not found.
I am not near my work machine so cant test
but I have another small question.
How is this reportviewer supposed to be activated when I click on a
link in the Treeview Navigator. I was trying to pass the exact URL as
you mentioned to the NavigateURL attribute of the treeview. and I get
the error.
Thanks very much
Ravi|||hello marlon,
its the same thing. When I click on the report in the treeview I paint
the entire window.
Here is the link i am passin to the Treenode.navigateUrl
http://server/reportserver/default.aspx?/reportfolder/report1&rc:LinkTarget=Myframe
And that paints the entire page.
Thanks very much
Ravi

No comments:

Post a Comment