Showing posts with label window. Show all posts
Showing posts with label window. Show all posts

Friday, March 30, 2012

ReportViewer exporting

Hi,

When you export a report in localmode using the ReportViewer export function, a new window will pop up with the download. Is there a way to eliminate that new browser window from coming up? Also, I'm having a little trouble writing some custom code to export the report instead of using the export toolbar. I found the following in a previous post...

1Dim bufferAs Byte(), fAs String, fsAs System.IO.FileStream2 f = System.IO.Path.GetTempFileName()3 System.IO.Path.ChangeExtension(f,"xls")4' there is probably a better way to set up the rendered PDF5 ' for redirecting to the Response output, but this one works.67 ' here is the binding bit. Revise to suit your dynamic situation.8 ' if you aren't really dynamically binding data against one9 ' loaded report, but rather changing10 ' reports to suit the user's needs, that will work too.11Dim ReportDataSourceX =New ReportDataSource()12With Me.ReportViewer1.LocalReport13 buffer = .Render("EXCEL", _14Nothing,Nothing,Nothing,Nothing,Nothing,Nothing)15End With1617 fs =New System.IO.FileStream(f, System.IO.FileMode.Create)18 fs.Write(buffer, 0, buffer.Length)19 fs.Close()20 fs.Dispose()2122 Response.ContentType ="Application/vnd.ms-excel"23 Response.WriteFile(f)24 Response.End()25 System.IO.File.Delete(f)
When  I run this and export, the excel file comes up very quarky with all sorts of symbols and such and does not render correctly, e,g,. the rdlc isn't even loaded and it seems like it is taking the whole page into excel from what I can read from the file.
 
Thanks in advance.

Hi Heyden,

You can do this by usingReportViewer.ExportContentDispositionproperty. UseAlwayInline.

For reference -

http://msdn2.microsoft.com/en-us/library/microsoft.reporting.webforms.reportviewer.exportcontentdisposition(VS.80).aspx

|||

and for custom export functionality check this post -

https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=139828&SiteID=1

|||

Many thank for the AlwaysInline. Solved my problem. I was either going to use custom exporting or try to find a way to eliminate that page. Thanks a bunch again!

|||

I have the same problem. A new window pops-up when trying to download the report in excel through the export toolbar. I don't want to open the report inline. I need a separate window to open the report but I don't want the pop-up window to be present while downloading the report. Is there any way to eliminate the blank window or any way to close it once the download is done.

Thanks in advance !

Shabs

sql

Wednesday, March 28, 2012

ReportViewer authentication

I am using Microsofts sample ReportViewer in my asp app
I am using window impersonation but I can not get the viewer to use the
identity
of the user that I am impersonating
Is there a way (within ReportViewer) to set the authentication for viewing
the reports?
--
Dain
Computer ProgrammerHave a look at this link. Hope helps.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_prog_soapapi_dev_6ne8.asp
Regards,
Barbaros
MCDBA, MCAD
"Dain1234" <Dain1234@.discussions.microsoft.com> wrote in message
news:D82A2D58-9C79-4F8A-A0FF-DF328DBA4462@.microsoft.com...
>I am using Microsofts sample ReportViewer in my asp app
> I am using window impersonation but I can not get the viewer to use the
> identity
> of the user that I am impersonating
> Is there a way (within ReportViewer) to set the authentication for viewing
> the reports?
> --
> Dain
> Computer Programmer

Wednesday, March 21, 2012

Reports Viewing in Browser

Hi,

Does anyone know how to browse a report in a new browser window?

regards

Josh

I believe there are several posts in this board that speak directly to this question. Although I have yet to try this, one option is the jump to url and the expression is:

="javascript:void(window.open('url'))"