473,760 Members | 9,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Integrate Reports in ASP.Net Web Form

Hi,

I have my reports at http:\\localhos t\ReportServer and need to use them in
ASP.NET Web Form.I have a few questions reg. this

------> I want to generate a PDF when a button labeled "Generate Report" is
clicked"

(1) I tried this using the below code:

Dim myResponse As Byte()
Dim url As String = http://localhost/reportserver?/Reports/Sales
Invoice&ORDER_I D=1879&rs:Forma t=PDF
Dim myWebClient As New WebClient
myWebClient.Cre dentials = CredentialCache .DefaultCredent ials
myResponse = myWebClient.Dow nloadData(url)
Response.Conten tType = "applicatio n/pdf"
Response.AddHea der("content-disposition", "attachment ; filename=Sales
Invoice.PDF")
Response.Binary Write(myRespons e)

But got the error "The remote server returned an error: (403) Forbidden"
I have included "<identity impersonate="tr ue"/>" in Web.Config File.
This Error is because the Credentials is null. I don't know why the
credentials are null even after I use myWebClient.Cre dentials =
CredentialCache .DefaultCredent ials

The same code works if I Create new Credentials specifying UserName and
Password. But I am cannot specify Username and password. The Application has
take the credentials from the server.

(2) Why can't I use the following one line of code(This works, I want to
know are there any kind issues with
this)Response.R edirect(http://localhost/reportserver?/Reports/Sales
Invoice&ORDER_I D=1879&rs:Forma t=PDF)

(3) What are other ways to integrate reports with ASP.NET Web Form.

(4)I need to deploy the Reports that I created in my machine to the server
I tried to deploy setting TargetServerURL =http://servername/ReportServer in
Project Properties, but got the error
"The permissions granted to user are insufficient for performing this
operation". What kind of permissions are required.

(5)What are different ways to deploy Reports on a Server.
Nov 19 '05 #1
1 2626
Hi Kiran:

1) Are you allowing anonymous users into the site? What do the
authentication and authorization sections of your web.config look
like? The web application will have to authenticate the user first in
order to properly impersonate with thier credentials.

2) This is the easiest way to integrate with SSRS, it's a perfectly
acceptable solution and is one of the scenarios the product was
designed for.

3) There is a web serivce API to interface with the report server
programatically . With web service calls you can render reports,
retrieve report parameters, essenitally anything the Report Manager UI
can do.
See this article for some examples, and there are other examples on
the site:
http://odetocode.com/Articles/95.aspx

4) You have to be at least in the Content Manager role. By default
only the report server local administrators group is in a role, you'll
probably have to add your domain account. More information here:
http://odetocode.com/Articles/215.aspx

5) There are at least three options. One is to deploy from Visual
Studio. Another is to upload the reports manually (yuck). Finally, you
can write an rss script. In fact, there is an example rss script
deployed with SSRS (if you installed the samples) that show how to
programatically deploy a report (it uses the web service API I talked
about in answer #1). These are executed weith the RS.exe utility.
See:
http://msdn.microsoft.com/library/de...rs_v1_5fxe.asp

Hope this helps,

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 21 Dec 2004 16:01:29 -0000, "Kiran" <Ki***@nospam.n et> wrote:
Hi,

I have my reports at http:\\localhos t\ReportServer and need to use them in
ASP.NET Web Form.I have a few questions reg. this

------> I want to generate a PDF when a button labeled "Generate Report" is
clicked"

(1) I tried this using the below code:

Dim myResponse As Byte()
Dim url As String = http://localhost/reportserver?/Reports/Sales
Invoice&ORDER_ ID=1879&rs:Form at=PDF
Dim myWebClient As New WebClient
myWebClient.Cr edentials = CredentialCache .DefaultCredent ials
myResponse = myWebClient.Dow nloadData(url)
Response.Conte ntType = "applicatio n/pdf"
Response.AddHe ader("content-disposition", "attachment ; filename=Sales
Invoice.PDF" )
Response.Binar yWrite(myRespon se)

But got the error "The remote server returned an error: (403) Forbidden"
I have included "<identity impersonate="tr ue"/>" in Web.Config File.
This Error is because the Credentials is null. I don't know why the
credentials are null even after I use myWebClient.Cre dentials =
CredentialCach e.DefaultCreden tials

The same code works if I Create new Credentials specifying UserName and
Password. But I am cannot specify Username and password. The Application has
take the credentials from the server.

(2) Why can't I use the following one line of code(This works, I want to
know are there any kind issues with
this)Response. Redirect(http://localhost/reportserver?/Reports/Sales
Invoice&ORDER_ ID=1879&rs:Form at=PDF)

(3) What are other ways to integrate reports with ASP.NET Web Form.

(4)I need to deploy the Reports that I created in my machine to the server
I tried to deploy setting TargetServerURL =http://servername/ReportServer in
Project Properties, but got the error
"The permissions granted to user are insufficient for performing this
operation". What kind of permissions are required.

(5)What are different ways to deploy Reports on a Server.


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1850
by: Deano | last post by:
I've been mulling over how to prevent users from clicking back onto my form after they have run a report. I want them to close the report first. The simple solution which I have tested successfully is simply to hide the calling form and make is visible again in the Close event of the report. Seems fine to me but can anyone see any flaws in this?
7
2948
by: DD | last post by:
Hi I want the user to be able to view all reports from a form either by way of a list box or dropdown or ?? any help please DD
4
1652
by: sparks | last post by:
We have a database that reads in and formats raw data. We were using queries to format the data per person and outputing reports. The other database has the persons personal information. I changed the queries on the raw data to maketables, copied the reports into the personal info database and they have the reports from the raw data available for the reports. NOW they want the reports to be displayed as a new tab in the forms. I am not...
1
1289
by: NL | last post by:
Hi: I am faced with 2 problems: the first one, I would like to know if it is possible to allow people to edit a report produced by Access (when I say edit I mean the result not the structure). I tried by exporting into Excel but the format is completely lost which makes it very hard for the user to understand the data. I had better luck with .rtf but I need to be able to link the data contained in this report with formulas contained...
2
2476
by: misscrf | last post by:
I have a search form that is great. I have modified it in such a way, that when search results come up I can bring it back to a useful spot, say an entry form or a report. Here is my lemon ( hoping someone can help me make lemonade!) I have this form implemented with my Candidate entry form, as a find. click the find button, search, subsearch form shows results, click select on the needed record, and the search form closes, the entry...
0
1275
by: Richard | last post by:
I have 2 projects that can run independently. One is built using Windows Forms Application (.NET) and the other is built on pure C++. Both project runs fine, but when I try to integrate them, problems arise. I create new Empty Project, and add the 2 existing project. As for C++ project, most of the includes and coding is in .CPP file whereas .H file only contain class definition. As for the form, it is generated and most of the coding...
0
1151
by: P McGinness | last post by:
Basically, I've a JS function called ValidateForm(), which returns true or false and controls if the form submits. When I integrate this with .NET validators, the .NET always adds it's own call to a function to the end of the form onSubmit script. So if my function returns false, .NETs function is still called and when it returns true will basically render my code pointless. I'm not entirely sure of the best way to integrate custom
1
1452
by: pmak via DotNetMonster.com | last post by:
I am a newbie in dotnet development. What I need to achieve is two pgaes, reports listing page and report viewing page. The report listing page displays all the report names I want to publish. When click on the report name and it will go to the report viewing page to display the report. I can create and deploy reports using sql 2005 RS but I need a simple sample to create this two pages that I can follow or step by step instructions . Many...
3
5126
by: joelpollock | last post by:
I'm having trouble continuously page numbering a large report in MS Access. The report is made up of three separate Access reports which I join together at the end. In the past I have opened the reports and viewed them to see how long they are then go in and manually type the page number and total page number. I am aware of the and lines of code but this resets with each new report.
0
9333
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9945
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3863
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.