Urgent help needed!

J

jens Jensen

I need to send a pdf file generated on the fly using reporting service.
Public users dont have acces to the server hosting reporting service.

My publicly accessible website need to call a page on the reporting servcie
server and send the pdf file back to the client.

I have spent many many days on this now.

Server.exceute does not seem to solve the problem neither.


Any help will be higly appreciated
JJ
 
M

Mark Rae

I need to send a pdf file generated on the fly using reporting service.

If you need to send a PDF file to someone, do you already know their email
address or will they be typing it into a textbox...?
Public users dont have acces to the server hosting reporting service.

I should hope not, but your web server will need to...
My publicly accessible website need to call a page on the reporting
servcie server and send the pdf file to the client.

Just use the System.Web.Mail class, or System.Net.Mail if you're using
ASP.NET 2

Create a new MailMessage object, provide the from address, to address (the
user), the subject, maybe some body text, then add the PDF as an attachment.
 
J

jens Jensen

I'm not sending in that send. This is purely http get/http post.
no mail involved.

They just need to open the page
 
J

jens Jensen

They open a web page on a server . The page request the computeation of a
pdf fil to be sent back to the webclient.
the Response.Redirect does not work as the server that makes pdf is alloweb
to serve public users.

Only the first server can serve phublic users. And sorry, there no email
involved in the process.
 
J

Jacob

Have you tried having your web server make a WebRequest to the backing
server. When the web server has received the WebResponse it can then
pass it on to the client. Watch out for timeouts if it takes time to
generate the reports.
 
J

jens Jensen

Yes,
This is what i'm cunrrently trying.

The problem is what to do with the stream . How do i send a pdf to the
client based on the stream object i have?
 
J

Jacob

Write the stream to a byte array buffer and then do
Response.BinaryWrite. Make sure you set the headers to the appropriate
values for pdf files.
 
J

jens Jensen

How do i compute the byte parameter from sr?
sr beeing:
System.IO.StreamReader sr = new
System.IO.StreamReader(resp.GetResponseStream());?
 
J

Jacob

byte[] buffer = new byte[sr.Length];
sr.Read(buffer, 0, buffer.Length);
Response.BinaryWrite(buffer);
 
J

jens Jensen

It seems like the pdf is being corrupted in the process.
PDF reader reports an error.
 
J

jens Jensen

I have verified that reporting service correctly generates the pdf file.
I can view it in a web page on our network.
 
J

Jacob

There are many good reasons that streams get corrupted. However it's
difficult to debug when I can't see the stream or the code. Try
checking the different stages of the transfer and see where the stream
changes and then you will most likely also find what it is that causes
the error. My guess would be that you are not reading stream from
beginning.
 
J

Jacob

Siden du nu også bruger dk som domæne antager jeg at jeg kan skrive
på dansk.

Så vidt jeg kan forstå så er dit problem at du ikke kan få den fil
som reporting service genererer overført til klienten.

Hvis du prøver at følge datastrømmen så vil du sandsynligvis se
hvor det er at der sker en korruption. Prøv at læs filen til
webserveren først for at se at serveren rent faktisk læser den
rigtigt. Det er mit gæt at det er måden webserveren læser filen på
der genererer fejlen.

Hvis webserveren rent faktisk kan læse filen og vise den, så kan
problemet være at kommunikationen til klienten skaber en fejl. Det er
i så fald lidt mere kompliceret.

Som jeg tidligere har sagt, så er det svært at gætte sig frem til
fejlen hvis jeg ikke kan se koden som læser pdf filen.

Hvis du stadig har behov for hjælp så send mig en direkte mail.
Jacob
 
J

jens Jensen

Thanks to your help, the problem have now been solve.
The problem was header encoding issue.
It now set to 1250 and that solved that problem
Many thanks
JJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top