Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Reporting Services format:PDF

[es] :: .NET :: ASP.NET :: Reporting Services format:PDF

[ Pregleda: 1457 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Dragan BL
Dragan Lalos
Banja Luka

Član broj: 79680
Poruke: 96
80.87.240.*

Sajt: www.micronanostudio.com


Profil

icon Reporting Services format:PDF25.08.2011. u 11:00 - pre 154 meseci
Da li je moguce da kada zelim da exportujem report u PDF dobijem da se PDF otvara u brauzeru a ne da mi nudi da downloadujem to?

Moze li se to kako zaobici promijeniti header IIS bilo sta?

Hvala
 
Odgovor na temu

sparc
Sladjan Parc

Član broj: 65760
Poruke: 134
*.static.isp.telekom.rs.



Profil

icon Re: Reporting Services format:PDF25.08.2011. u 11:57 - pre 154 meseci
ja koristim sledeci kod da RDLC direktno prikazem u PDF-u ili u Excel-u.

Ovaj kod je na stanici koja sadrzi reportViewer.

Imports System.Web
Imports Microsoft.Reporting
Imports Microsoft.Reporting.WebForms
Imports System.IO
Imports System.Data

..............

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Session("fileType") = Request.QueryString("fileType")
Session("fileName") = Request.QueryString("fileName")
Session("contType") = Request.QueryString("contType")
End Sub

Protected Sub Page_SaveStateComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SaveStateComplete
Dim warnings As Warning() = Nothing
Dim streamids As String() = Nothing
Dim mimeType As String() = Nothing
Dim encoding As String = Nothing
Dim extension As String = Nothing
Dim bytes As Byte()

'proveravamo da li postoji file i ako postoji brisemo ga
Dim filepath As String = Server.MapPath("~/Izvestaji") & "\" & Session("fileName")
File.Delete(filepath)

'render reporta
bytes = ReportViewer1.LocalReport.Render(Session("fileType"), Nothing, Nothing, encoding, extension, streamids, warnings)
Dim fs As New FileStream(filepath, FileMode.Create)
fs.Write(bytes, 0, bytes.Length)
fs.Close()

'prikaz
Select Case Session("fileType")
Case "PDF"
Response.ContentType = Session("contType")
Response.WriteFile(filepath)
Response.End()
Case "Excel"
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ContentType = Session("contType")
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" & Session("fileName"))
HttpContext.Current.Response.BinaryWrite(bytes)
HttpContext.Current.Response.End()
Case Else
End Select

End Sub

A stranicu pozivam na sledeci nacin:
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Response.Redirect("Imestranice.aspx" & "?fileType=PDF&fileName=Imefajla.PDF&contType=Application/pdf")
End Sub
 
Odgovor na temu

Dragan BL
Dragan Lalos
Banja Luka

Član broj: 79680
Poruke: 96
80.87.240.*

Sajt: www.micronanostudio.com


Profil

icon Re: Reporting Services format:PDF25.08.2011. u 12:54 - pre 154 meseci
Nasao sam i ja nesto slicno tome...evo linka na koji sam ja mislio da to sredim ...XXXX.rdl&rs:Format=PDF&rs:Command=Render&Jezik=lat&CSID=226&IzdatiIzvodiID=60 e sada on ponudi da se to snimi, a ja bi htio da otvori INLINE (u brazueru).

Ovo sam isto nasao da postoji ali ne znam da li to radi i je li neko to probao ReportViewer.ExportContentDisposition Property?

Hvala
 
Odgovor na temu

[es] :: .NET :: ASP.NET :: Reporting Services format:PDF

[ Pregleda: 1457 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.