Showing posts with label browser. Show all posts
Showing posts with label browser. Show all posts

Monday, February 20, 2012

rendering to browser instead to file

Did anyone have rendered a report in excel format directly to browser
instead to a file? I tried this code below wich works fine for pdf
rendering:
result = rs.Render("/MyReports/SVREL00104", "Excel", Nothing, _
Nothing, params, Nothing, _
Nothing, encoding, mime, history, warnings, streamsId)
Page.Response.ClearContent()
Page.Response.ClearHeaders()
Page.Response.ContentType = mime
Page.Response.BinaryWrite(result)
Page.Response.Flush()
Page.Response.Close()
This code should load the excel into the web browser window, but I'm getting
this errors:
1. A message box saying: The Microsoft Excel can not access the file:
'http://localhost/MyReports/test.aspx'.
2. An input box asking for an alternate name for 'Titulos_de_Impressao'
(Print Title) because this is already an internal name.
Any ideas?
[]s
Renato
--
----
Renato Aloi
Analista Programador
J&W Informática Ltda.
+55 11 30406675If you can tolerate a dialog box asking if the user wants to open or save,
this will work:
Response.ClearContent();
Response.ClearHeaders();
Response.AppendHeader("Content-Disposition",
"attachment;filename=\"MyReport.xls\"");
Response.BinaryWrite(result);
Response.End();
It works for PDF as well. There may be other ways, but this worked for us
so we stuck with it.
"Renato Aloi" wrote:
> Did anyone have rendered a report in excel format directly to browser
> instead to a file? I tried this code below wich works fine for pdf
> rendering:
> result = rs.Render("/MyReports/SVREL00104", "Excel", Nothing, _
> Nothing, params, Nothing, _
> Nothing, encoding, mime, history, warnings, streamsId)
> Page.Response.ClearContent()
> Page.Response.ClearHeaders()
> Page.Response.ContentType = mime
> Page.Response.BinaryWrite(result)
> Page.Response.Flush()
> Page.Response.Close()
> This code should load the excel into the web browser window, but I'm getting
> this errors:
> 1. A message box saying: The Microsoft Excel can not access the file:
> 'http://localhost/MyReports/test.aspx'.
> 2. An input box asking for an alternate name for 'Titulos_de_Impressao'
> (Print Title) because this is already an internal name.
> Any ideas?
> []s
> Renato
> --
> ----
> Renato Aloi
> Analista Programador
> J&W Informática Ltda.
> +55 11 30406675
>
>|||Thanks for your idea, Debra. Though I was really trying to avoid these
dialog boxes. In fact I am 'translating' all my systems' reports from
Crystal Reports to Reporting Services. The problem is my clients are already
using my systems with this export option to excel, without needing to save
any file. If I barelly whisper that they will need to take more clicks to do
something that is already working well, I will be exterminated.
However, I think the approach i will adopt is save a file to disk then use
this code:
Page.Response.ClearContent()
Page.Response.ClearHeaders()
Page.Response.ContentType = mime
Page.Response.WriteFile(savedFile)
Page.Response.Flush()
Page.Response.Close()
This approach works fine without any dialog boxes. The problem is at my
clients using web farms with load balance. I am afraid of exceptions, like
file not found.
Any other ideas, let me know, please.
[]s
Renato
"debra doty" <debradoty@.discussions.microsoft.com> escreveu na mensagem
news:22D7671D-13F2-413F-84B8-022E222F3A4C@.microsoft.com...
> If you can tolerate a dialog box asking if the user wants to open or save,
> this will work:
> Response.ClearContent();
> Response.ClearHeaders();
> Response.AppendHeader("Content-Disposition",
> "attachment;filename=\"MyReport.xls\"");
> Response.BinaryWrite(result);
> Response.End();
> It works for PDF as well. There may be other ways, but this worked for us
> so we stuck with it.
>
> "Renato Aloi" wrote:
> > Did anyone have rendered a report in excel format directly to browser
> > instead to a file? I tried this code below wich works fine for pdf
> > rendering:
> >
> > result = rs.Render("/MyReports/SVREL00104", "Excel", Nothing, _
> > Nothing, params, Nothing, _
> > Nothing, encoding, mime, history, warnings, streamsId)
> >
> > Page.Response.ClearContent()
> > Page.Response.ClearHeaders()
> > Page.Response.ContentType = mime
> > Page.Response.BinaryWrite(result)
> > Page.Response.Flush()
> > Page.Response.Close()
> >
> > This code should load the excel into the web browser window, but I'm
getting
> > this errors:
> >
> > 1. A message box saying: The Microsoft Excel can not access the file:
> > 'http://localhost/MyReports/test.aspx'.
> >
> > 2. An input box asking for an alternate name for 'Titulos_de_Impressao'
> > (Print Title) because this is already an internal name.
> >
> > Any ideas?
> >
> > []s
> > Renato
> >
> > --
> > ----
> > Renato Aloi
> > Analista Programador
> > J&W Informática Ltda.
> > +55 11 30406675
> >
> >
> >

Rendering reports on PDA, mobile devices

Hi,

I am using URL access method to render the reports in a browser. But the same URL does not work with PDA devices. Report is not displayed on the PDA device. Any idea how to render a report on PDA device using the URL access.

Thanks.

Kavita

You could try to add the following device info to your existing URL (pointing to http://servername/reportserver/... to render to HTML 3.2 format:
... &rc:Format=HTML3.2

-- Robert

Rendering problem in browser

I have a basic report with 3 text boxes. The first text box contains a title
and two smaller text boxes. The two smaller textboxes contain a string
"Report Created:" and the date and time the report was created. The layout in
VS is correct, it is correct in the preview within in VS. When I export the
report to Adobe, Excel, etc. it is correct. However, when I deploy the report
it is not correct. The two smaller text boxes are below the main text box.
Below is an example of how I want it to look and how it looks in preview,
Adobe, Excel, etc..
|----|
| Report Title
|
|
|
|
|
| -- --
|
||Report Created:||Date and Time| |
| -- --
|
|
|
|----|
Table data
And this is how it looks in a browser:
|----|
| Report Title
|
|
|
|
|
|
|
|
|
|
|
|
|
|----|
|Report Created:|
|Date and Time|
Table data
Does anyone have any thoughts about what is going on or any suggestions on
how to correct this. I have deleted and recreated the report several times, I
have changed the properties on all the text boxes (grow, shrink, etc.) and no
luck.
Thanks.On Tue, 25 Jan 2005 09:15:04 -0800, "MAGrimsley"
<MAGrimsley@.discussions.microsoft.com> wrote:
>I have a basic report with 3 text boxes. The first text box contains a title
>and two smaller text boxes. The two smaller textboxes contain a string
>"Report Created:" and the date and time the report was created. The layout in
>VS is correct, it is correct in the preview within in VS. When I export the
>report to Adobe, Excel, etc. it is correct. However, when I deploy the report
>it is not correct. The two smaller text boxes are below the main text box.
>Below is an example of how I want it to look and how it looks in preview,
>Adobe, Excel, etc..
>|----|
>| Report Title
> |
>|
> |
>|
> |
>| -- --
> |
>||Report Created:||Date and Time| |
>| -- --
> |
>|
> |
>|----|
>Table data
>And this is how it looks in a browser:
>|----|
>| Report Title
> |
>|
> |
>|
> |
>|
> |
>|
> |
>|
> |
>|
> |
>|----|
>|Report Created:|
> |Date and Time|
>Table data
>Does anyone have any thoughts about what is going on or any suggestions on
>how to correct this. I have deleted and recreated the report several times, I
>have changed the properties on all the text boxes (grow, shrink, etc.) and no
>luck.
>Thanks.
Your textboxes could be too close to each other. Either move them
apart, or use the header row(s) in your table instead. You can also
consolidate these 2 textboxes into 1 and set its value to:
= "Report created: " & Now()|||Thanks for your help, I combinded both textboxes to one and it stil shows up
under the main textbox.
"Usenet User" wrote:
> On Tue, 25 Jan 2005 09:15:04 -0800, "MAGrimsley"
> <MAGrimsley@.discussions.microsoft.com> wrote:
> >I have a basic report with 3 text boxes. The first text box contains a title
> >and two smaller text boxes. The two smaller textboxes contain a string
> >"Report Created:" and the date and time the report was created. The layout in
> >VS is correct, it is correct in the preview within in VS. When I export the
> >report to Adobe, Excel, etc. it is correct. However, when I deploy the report
> >it is not correct. The two smaller text boxes are below the main text box.
> >
> >Below is an example of how I want it to look and how it looks in preview,
> >Adobe, Excel, etc..
> >
> >|----|
> >| Report Title
> > |
> >|
> > |
> >|
> > |
> >| -- --
> > |
> >||Report Created:||Date and Time| |
> >| -- --
> > |
> >|
> > |
> >|----|
> >
> >Table data
> >
> >And this is how it looks in a browser:
> >
> >|----|
> >| Report Title
> > |
> >|
> > |
> >|
> > |
> >|
> > |
> >|
> > |
> >|
> > |
> >|
> > |
> >|----|
> >
> >|Report Created:|
> > |Date and Time|
> >
> >Table data
> >
> >Does anyone have any thoughts about what is going on or any suggestions on
> >how to correct this. I have deleted and recreated the report several times, I
> >have changed the properties on all the text boxes (grow, shrink, etc.) and no
> >luck.
> >
> >Thanks.
>
> Your textboxes could be too close to each other. Either move them
> apart, or use the header row(s) in your table instead. You can also
> consolidate these 2 textboxes into 1 and set its value to:
> = "Report created: " & Now()
>|||On Tue, 25 Jan 2005 10:53:04 -0800, "MAGrimsley"
<MAGrimsley@.discussions.microsoft.com> wrote:
>Thanks for your help, I combinded both textboxes to one and it stil shows up
>under the main textbox.
>
Hmm, the example you provided showed Report Title on top and 2 smaller
textboxes underneath (i.e. in 2 rows) while after deployment you were
getting them in 3 rows...
Anyway, if spreading textboxes apart doesn't help (also make sure they
do not overlap), use a table instead - this is always a much cleaner
solution, no surprises. I stopped using textboxes a long time ago for
this very reason (flawed positioning), and only use them for
well-isolated fields and labels. Tables can have multiple header and
footer rows, plus you can have separate tables consisting only of
header and/or footer rows, which you can use to substitute report
headers/footers and page headers/footers.
>"Usenet User" wrote:
>> On Tue, 25 Jan 2005 09:15:04 -0800, "MAGrimsley"
>> <MAGrimsley@.discussions.microsoft.com> wrote:
>> >I have a basic report with 3 text boxes. The first text box contains a title
>> >and two smaller text boxes. The two smaller textboxes contain a string
>> >"Report Created:" and the date and time the report was created. The layout in
>> >VS is correct, it is correct in the preview within in VS. When I export the
>> >report to Adobe, Excel, etc. it is correct. However, when I deploy the report
>> >it is not correct. The two smaller text boxes are below the main text box.
>> >
>> >Below is an example of how I want it to look and how it looks in preview,
>> >Adobe, Excel, etc..
>> >
>> >|----|
>> >| Report Title
>> > |
>> >|
>> > |
>> >|
>> > |
>> >| -- --
>> > |
>> >||Report Created:||Date and Time| |
>> >| -- --
>> > |
>> >|
>> > |
>> >|----|
>> >
>> >Table data
>> >
>> >And this is how it looks in a browser:
>> >
>> >|----|
>> >| Report Title
>> > |
>> >|
>> > |
>> >|
>> > |
>> >|
>> > |
>> >|
>> > |
>> >|
>> > |
>> >|
>> > |
>> >|----|
>> >
>> >|Report Created:|
>> > |Date and Time|
>> >
>> >Table data
>> >
>> >Does anyone have any thoughts about what is going on or any suggestions on
>> >how to correct this. I have deleted and recreated the report several times, I
>> >have changed the properties on all the text boxes (grow, shrink, etc.) and no
>> >luck.
>> >
>> >Thanks.
>>
>> Your textboxes could be too close to each other. Either move them
>> apart, or use the header row(s) in your table instead. You can also
>> consolidate these 2 textboxes into 1 and set its value to:
>> = "Report created: " & Now()
>>