Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/07/2009, 15:10
Avatar de neo101
neo101
 
Fecha de Ingreso: julio-2007
Mensajes: 73
Antigüedad: 16 años, 9 meses
Puntos: 1
Respuesta: exportar active report a html

Mmm... pues, la verdad no se usar esas librerias, pero buscando en los foros de satadynamics encontré este código..

Código vb.net:
Ver original
  1. Public Function GetHTMLReport(ByVal ReportPath As String) As String
  2.  
  3. Dim sTemp As String
  4. Dim clsStream As System.IO.Stream
  5.  
  6. 'NOTE: this implemented class is vital to this process - look for
  7. documentation about implementing
  8. 'the DataDynamics.ActiveReports.Export.Html.IOutputHtml object...
  9. Dim clsOutput As New MyProject.HtmlOutput()
  10.  
  11. Dim clsReport As New DataDynamics.ActiveReports.ActiveReport()
  12. Dim clsExport As New
  13. DataDynamics.ActiveReports.Export.Html.HtmlExport()
  14.  
  15. Try
  16.  
  17. 'load report - here's where you could alternately configure a
  18. data source or other parameters...
  19. clsReport.LoadLayout(ReportPath)
  20.  
  21. 'run report...
  22. clsReport.Run()
  23.  
  24. 'export to HTML...
  25. Call clsExport.Export(clsReport.Document, clsOutput, "1-" &
  26. clsReport.Document.Pages.Count.ToString)
  27.  
  28. 'get HTML output...
  29. sTemp = clsOutput.OutputString
  30.  
  31. 'release objects...
  32. clsExport = Nothing
  33. clsReport = Nothing
  34. clsOutput = Nothing
  35.  
  36. 'fix up HTML - not sure what these characters are about, but
  37. it's easy to fix...
  38. sTemp = Replace(sTemp, "o;?", "")
  39.  
  40. 'add padding - reports are designed for PDF which adds margins
  41. by default...
  42. sTemp = Replace(sTemp, "body leftmargin=""0"" topmargin=""0""",
  43. "body leftmargin=""25"" topmargin=""25""")
  44.  
  45. 'return...
  46. Return sTemp
  47.  
  48. Catch ex As System.Exception
  49.  
  50. Return ex.Message & ": " & ex.StackTrace
  51.  
  52. End Try
  53.  
  54. End Function
  55.  
  56. ...you could then call this function from a Web Form like this:
  57.  
  58. Private Sub StreamHTML()
  59.  
  60. Dim sTemp As String
  61. Dim sReportPath As String = "PATH TO RPX FILE"
  62.  
  63. 'get report contents...
  64. sTemp = GetHTMLReport(sReportPath)
  65.  
  66. 'clear buffer...
  67. Response.Clear()
  68. Response.ClearContent()
  69. Response.ClearHeaders()
  70.  
  71. 'set up header for streaming access...
  72. Response.AddHeader("content-disposition", "inline;
  73. filename=report.html")
  74.  
  75. 'write to response buffer...
  76. Response.Write(sTemp)
  77.  
  78. 'flush and close buffer...
  79. Response.Flush()
  80. Response.Close()
  81. Response.End()
  82.  
  83. End Sub

No se realmente cuanto te sirva, pero puedes seguir buscando en aquellos foros, el enlace es:

http[dos puntos]//www[punto]datadynamics[punto]com/forums/29967/ShowPost.aspx

saludos!!