Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 SQL Reportings Services Reports on ASPX Page

Author  Topic 

Harj7
Starting Member

4 Posts

Posted - 2008-09-04 : 14:25:16
Hi,
I have one aspx page. On that page I have 3 text boxes. In these 3 text boxes I want to show the value from SQL Reporting Service Report. I have one Report which has 3 values. I was successful to show the Report in PDF format by using Reporting Web service. I want to render the report parameters in the text boxes not to the browser. Its very urgent. Any help will be appreciated.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-04 : 14:30:18
report data to textbox? didnt get that. report data is of xml format. whats the use of showing it in textbox?
Go to Top of Page

Harj7
Starting Member

4 Posts

Posted - 2008-09-04 : 17:55:17
Let me explain you in more detail.
My Team lead wants to know on which database and version my reports are using. He asked me to get him an aspx page, where he can see the Database Name, Database Version. I created a report using that store proc. Reports works fine in the report manger. I was able to show the report from web page in the pdf and html format. He wants the information in aspx page, so he can take that asp page and create another Admin page, where he can see the info about the Application, and reports. Reports are on different server and application on different server. We have 10 development databases and sometimes developer forget to tell me which database application using. Some times application run on different database and reports on different database and it mismatch the data (application is accessing reports through web pages via web service)
By providing this, we can see that which database is using my application and reports.
Go to Top of Page

dexter.knudson
Constraint Violating Yak Guru

260 Posts

Posted - 2008-09-05 : 04:52:28
You can create an internal parameter in your reports & default it to values from your stored procedure. You don't need the aspx page for this.
Go to Top of Page

dexter.knudson
Constraint Violating Yak Guru

260 Posts

Posted - 2008-09-05 : 04:53:38
Hide the paramter, but display it in your repotrt footer, for example.
Go to Top of Page

Harj7
Starting Member

4 Posts

Posted - 2008-09-05 : 12:18:54
I have generate reports successful and also able to render the report from web page.
Requirement: All Data Elements of Report should be display in the Aspx page.

Following is the Aspx page, in this page I have 3 text boxes which I want to popluated with data from SQL Reports. I already created report with this data.

<td>
<asp:Label ID="lblDatabase" runat="server" Text="Database" Width="136px"></asp:Label>
</td>
<td><asp:TextBox ID="txtDatabase" runat="server"></asp:TextBox> </td>

</tr>
<tr>
<td>
<asp:Label ID="lblVers" runat="server" Text="Version" Width="136px"></asp:Label>
</td>
<td><asp:TextBox ID="txtVersion" runat="server"></asp:TextBox> </td>

</tr>
<tr>
<td>
<asp:Label ID="lblUpdate" runat="server" Text="Update" Width="136px"></asp:Label>
</td>
<td><asp:TextBox ID="txtUpdate" runat="server"></asp:TextBox> </td>



Code Behind file


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim ReportService As New Reportexecution.ReportExecutionService

ReportService.Timeout = 100000
ReportService.PreAuthenticate = True
ReportService.ConnectionGroupName = My.User.Name

' Sql Report Domain, user and password defined in Web.config
Dim creds As New System.Net.NetworkCredential
creds.Domain = System.Configuration.ConfigurationManager.AppSettings("SqlReportDomain")
creds.UserName = System.Configuration.ConfigurationManager.AppSettings("SqlReportUser")
creds.Password = System.Configuration.ConfigurationManager.AppSettings("SqlReportPassword")

ReportService.Credentials = creds
Dim reportName As String = "LEO_DataBaseInfo"
Dim reportFullPath As String = System.Configuration.ConfigurationManager.AppSettings("SqlReportPath") & reportName


ReportService.ExecutionHeaderValue = New Leo.UI.Reportexecution.ExecutionHeader

ReportService.LoadReport(reportFullPath, Nothing)


Dim parameters(2) As Reportexecution.ParameterValue

parameters(0) = New Reportexecution.ParameterValue
parameters(0).Name = "Server"
parameters(0).Value = txtDatabase.Text
parameters(1) = New Reportexecution.ParameterValue
parameters(1).Name = "Version"
parameters(1).Value = txtVersion.Text
parameters(2) = New Reportexecution.ParameterValue
parameters(2).Name = "Updated"
parameters(2).Value = txtUpdate.Text
ReportService.ExecutionHeaderValue = New Leo.UI.Reportexecution.ExecutionHeader

ReportService.LoadReport(reportFullPath, Nothing)

ReportService.SetExecutionParameters(parameters, "en-us")

ReportService.ExecutionHeaderValue = New Leo.UI.Reportexecution.ExecutionHeader

ReportService.LoadReport(reportFullPath, Nothing)


Const DeviceInfo As String = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"
Dim MimeType As String = ""


'Dim result As Byte() = ReportService.Render("Html4.0", )
Dim result As Byte() = ReportService.Render("Html4.0", DeviceInfo, Nothing, MimeType, Nothing, Nothing, Nothing)


Response.ClearContent()
Response.AppendHeader("content-length", result.Length.ToString())
Response.ContentType = MimeType
Response.BinaryWrite(result)
Go to Top of Page
   

- Advertisement -