Wednesday, March 28, 2012
Reportviewer and Treeview control help needed
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
Monday, March 26, 2012
ReportViewer (web control) - parameter change refresh
I have created an ASP.NET website with a ReportViewer on. The report renders fine, but when I change one of the parameters (manually), the report seems to invalidate itself and a blank while area is drawn. I would like the same behaviour as in the WinForms variant, where rhe rendered report remains the same until the 'View Report' button is pressed.
Is this possible?
Regards Andreas
hi
i did the same thing integrating reporting services to web application but my problem is the viewer does not show anything but i can see it being generated and how many pages it's generated and when i click on the export menu format and export to excel the results shows on the excel file but not on the viewer,
does this has to do with setting up properties of the reportviewer?
please assist
sqlReportViewer (web control) - parameter change refresh
I have created an ASP.NET website with a ReportViewer on. The report renders fine, but when I change one of the parameters (manually), the report seems to invalidate itself and a blank while area is drawn. I would like the same behaviour as in the WinForms variant, where rhe rendered report remains the same until the 'View Report' button is pressed.
Is this possible?
Regards Andreas
hi
i did the same thing integrating reporting services to web application but my problem is the viewer does not show anything but i can see it being generated and how many pages it's generated and when i click on the export menu format and export to excel the results shows on the excel file but not on the viewer,
does this has to do with setting up properties of the reportviewer?
please assist
ReportView renders reports weird...?
I'm using a ReportViewer control to render reports on my page. It does render the reports, but ever report scrolls below the iframe that it creates. It's difficult to explain, but basically, you can't scroll to the bottom of the report. That data is below the iframe's bottom border. The iframe is not mine, it's created by ResportViewer. I have a screenshot to illustratehere (http://www.appell.com/imges/srsscontrol.gif)
Here's my code (it's using a MasterPage):
<asp:Content ContentPlaceHolderID="cph_MainContent" runat="server" ID="cntDefault"> Choose from the available reports: <asp:DropDownList ID="ddlReports" runat="server" OnSelectedIndexChanged="ShowReport" AutoPostBack="true"> <asp:ListItem Value="">Select a report</asp:ListItem> </asp:DropDownList> <div style="margin:8px 0px 0px 0px;clear:both;"> <rsweb:ReportViewer ID="reportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" Height="600px" AsyncRendering="true" ProcessingMode="Remote" ShowToolBar="True" Width="700px"> <ServerReport ReportPath="" ReportServerUrl="http://sqlwebreports/ReportServ" DisplayName="report" Timeout="1000" /> </rsweb:ReportViewer> </div></asp:Content>
Any idea what's going wrong here? BTW, I have tried changing the InteractiveSize and it doesn't matter how short I make the report, it still scrolls below the bottom...
Thanks for the help!
Eddie
Take out the div tags. If you have it in a table tags, take those out. I had the same problem. The report was in a panel that was in a table. Took out the table tags and the report rendered fine.|||Thanks, but I tried that and I get the same exact result. This code:<asp:Content ContentPlaceHolderID="cph_MainContent" runat="server" ID="cntDefault"> Choose from the available reports: <asp:DropDownList ID="ddlReports" runat="server" OnSelectedIndexChanged="ShowReport" AutoPostBack="true"> <asp:ListItem Value="">Select a report</asp:ListItem> </asp:DropDownList> <rsweb:ReportViewer ID="reportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" Height="600px" AsyncRendering="true" ProcessingMode="Remote" ShowToolBar="True" Width="700px"> <ServerReport ReportPath="" ReportServerUrl="http://sqlwebreports/ReportServ" DisplayName="report" Timeout="1000" /> </rsweb:ReportViewer></asp:Content>
Renders exactly the same as the other code - the report still scrolls out of sight...
Thanks for the reply!
eddie
|||If you haven't done this yet, take out the content place holder tags and just put the viewer in a panel. Also, ssl can give the viewer trouble|||Yeah, turns out the control just can't be used with a MasterPage. I tried everything, and the only way I could get it to work was to take it out of a ContentPlaceHolder, which is required if using a MasterPage. So I just converted this page to a standard webform and it works fine. Too bad though...
Eddie
|||Also, you can check what settings are there for "Style" of the Report Viewer. You can acccess the styling of the ReportViewer as follows:
1) Design View
2) Right click on the ReportViewer and you will see the Style tab in the popup. Click that.
3) Go to Layout section. There should be a "Content" section. For Overflow, choose "Use Scrollbars if needed".
I believe this should solve the problem.
Good luck...
bullpit
Wednesday, March 7, 2012
ReportingService.Render
In the examples of the ReportingService API i found the render method that
renders a report to a file.
But what ever i try i cant get it to work becuase the reportPath parameter
is always incorrect.
When browsing for the report using my IE browser this is the URL:
http://localhost/ReportServer?%2ftester1%2fReport1&rs:Command=Render
I come there after typing in:
http://localhost/ReportServer
Then clicking on tester1
Then clicking on report1
Now what ever i try to put in the reportPath it does not work. Can someone
give me any pointers?
Dim rs As New ReportingService.ReportingService
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = "/ReportServer/tester1/report1"
Dim format As String = "MHTML"
Dim historyID As String = Nothing
Dim devInfo As String = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"
' Prepare report parameter.
Dim parameters() As ParameterValue = Nothing
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim sh As New SessionHeader
rs.SessionHeaderValue = sh
Try
result = rs.Render(reportPath, format, historyID, devInfo,
parameters, credentials, showHideToggle, encoding, mimeType,
reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
End Try
Try
Dim stream As FileStream = File.Create("report.pdf",
result.Length)
stream.Write(result, 0, result.Length)
stream.Close()
Catch e As Exception
End Try/tester1/report1 as path solved that problem.
But now i have other problems with the user compname\ASP.NET not having
sufficient rights.
Where can i find documentation on how to setup the security so that i can
use the render method?