Wednesday, March 28, 2012

PDF Render Problem

Hello,
Below is the code I have written using SOAP API, VB.Net and ASP.net, so that
user can download the report onto their local drive. everything works fine
except when they open the file it gives errors ' There was an error opening
this document. The file is damaged and could not be repaired'. Please let me
know what is wrong with this code.
Thanks
_sReportLocation = "/BAOS Reporting/DashBoardReport/RepoDashBoard"
_S_DEVICE_INFO = "<DeviceInfo><Toolbar>False</Toolbar><HTMLFragment>true</HTMLFragment></DeviceInfo>"
_bResults = rs.Render(_sReportLocation, "PDF", Nothing,
_S_DEVICE_INFO, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
Nothing, Nothing)
Response.Clear()
Response.ContentType = "application/pdf"
If _sMimeType <> "text/html" Then
Response.AddHeader("Content-Disposition", "attachment;
filename=" & "BarChart.pdf")
End If
Response.BinaryWrite(_bResults)
--
Raj ChandraDoes it work on some computers but not all? This may sound kind of silly,
but we have seen similar problems with Adobe before.
Try deleting all of temp internet files on the client computer and running
the report. Its worked for us in the past when the report runs fine on one
computer but not the next.
"Raj Chandra" wrote:
> Hello,
>
> Below is the code I have written using SOAP API, VB.Net and ASP.net, so that
> user can download the report onto their local drive. everything works fine
> except when they open the file it gives errors ' There was an error opening
> this document. The file is damaged and could not be repaired'. Please let me
> know what is wrong with this code.
> Thanks
> _sReportLocation = "/BAOS Reporting/DashBoardReport/RepoDashBoard"
> _S_DEVICE_INFO => "<DeviceInfo><Toolbar>False</Toolbar><HTMLFragment>true</HTMLFragment></DeviceInfo>"
> _bResults = rs.Render(_sReportLocation, "PDF", Nothing,
> _S_DEVICE_INFO, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
> Nothing, Nothing)
> Response.Clear()
> Response.ContentType = "application/pdf"
> If _sMimeType <> "text/html" Then
> Response.AddHeader("Content-Disposition", "attachment;
> filename=" & "BarChart.pdf")
> End If
> Response.BinaryWrite(_bResults)
> --
> Raj Chandra|||Hi Pinolian, thanks for the response.
I tried on a different machine it did not work and I also tried after
deleting temp files same result.
"Pinolian" wrote:
> Does it work on some computers but not all? This may sound kind of silly,
> but we have seen similar problems with Adobe before.
> Try deleting all of temp internet files on the client computer and running
> the report. Its worked for us in the past when the report runs fine on one
> computer but not the next.
>
> "Raj Chandra" wrote:
> > Hello,
> >
> >
> > Below is the code I have written using SOAP API, VB.Net and ASP.net, so that
> > user can download the report onto their local drive. everything works fine
> > except when they open the file it gives errors ' There was an error opening
> > this document. The file is damaged and could not be repaired'. Please let me
> > know what is wrong with this code.
> >
> > Thanks
> >
> > _sReportLocation = "/BAOS Reporting/DashBoardReport/RepoDashBoard"
> > _S_DEVICE_INFO => > "<DeviceInfo><Toolbar>False</Toolbar><HTMLFragment>true</HTMLFragment></DeviceInfo>"
> >
> > _bResults = rs.Render(_sReportLocation, "PDF", Nothing,
> > _S_DEVICE_INFO, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
> > Nothing, Nothing)
> >
> > Response.Clear()
> > Response.ContentType = "application/pdf"
> >
> > If _sMimeType <> "text/html" Then
> > Response.AddHeader("Content-Disposition", "attachment;
> > filename=" & "BarChart.pdf")
> > End If
> > Response.BinaryWrite(_bResults)
> > --
> > Raj Chandra|||Have you installed Reporting Services Service Pack 1?
"Raj Chandra" wrote:
> Hi Pinolian, thanks for the response.
> I tried on a different machine it did not work and I also tried after
> deleting temp files same result.
>
> "Pinolian" wrote:
> >
> > Does it work on some computers but not all? This may sound kind of silly,
> > but we have seen similar problems with Adobe before.
> >
> > Try deleting all of temp internet files on the client computer and running
> > the report. Its worked for us in the past when the report runs fine on one
> > computer but not the next.
> >
> >
> > "Raj Chandra" wrote:
> >
> > > Hello,
> > >
> > >
> > > Below is the code I have written using SOAP API, VB.Net and ASP.net, so that
> > > user can download the report onto their local drive. everything works fine
> > > except when they open the file it gives errors ' There was an error opening
> > > this document. The file is damaged and could not be repaired'. Please let me
> > > know what is wrong with this code.
> > >
> > > Thanks
> > >
> > > _sReportLocation = "/BAOS Reporting/DashBoardReport/RepoDashBoard"
> > > _S_DEVICE_INFO => > > "<DeviceInfo><Toolbar>False</Toolbar><HTMLFragment>true</HTMLFragment></DeviceInfo>"
> > >
> > > _bResults = rs.Render(_sReportLocation, "PDF", Nothing,
> > > _S_DEVICE_INFO, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
> > > Nothing, Nothing)
> > >
> > > Response.Clear()
> > > Response.ContentType = "application/pdf"
> > >
> > > If _sMimeType <> "text/html" Then
> > > Response.AddHeader("Content-Disposition", "attachment;
> > > filename=" & "BarChart.pdf")
> > > End If
> > > Response.BinaryWrite(_bResults)
> > > --
> > > Raj Chandra|||Yes, I have RS SP1 installed. XL file works fine I am trouble only with PDF
files.
"Kevin Weir" wrote:
> Have you installed Reporting Services Service Pack 1?
>
> "Raj Chandra" wrote:
> > Hi Pinolian, thanks for the response.
> >
> > I tried on a different machine it did not work and I also tried after
> > deleting temp files same result.
> >
> >
> > "Pinolian" wrote:
> >
> > >
> > > Does it work on some computers but not all? This may sound kind of silly,
> > > but we have seen similar problems with Adobe before.
> > >
> > > Try deleting all of temp internet files on the client computer and running
> > > the report. Its worked for us in the past when the report runs fine on one
> > > computer but not the next.
> > >
> > >
> > > "Raj Chandra" wrote:
> > >
> > > > Hello,
> > > >
> > > >
> > > > Below is the code I have written using SOAP API, VB.Net and ASP.net, so that
> > > > user can download the report onto their local drive. everything works fine
> > > > except when they open the file it gives errors ' There was an error opening
> > > > this document. The file is damaged and could not be repaired'. Please let me
> > > > know what is wrong with this code.
> > > >
> > > > Thanks
> > > >
> > > > _sReportLocation = "/BAOS Reporting/DashBoardReport/RepoDashBoard"
> > > > _S_DEVICE_INFO => > > > "<DeviceInfo><Toolbar>False</Toolbar><HTMLFragment>true</HTMLFragment></DeviceInfo>"
> > > >
> > > > _bResults = rs.Render(_sReportLocation, "PDF", Nothing,
> > > > _S_DEVICE_INFO, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
> > > > Nothing, Nothing)
> > > >
> > > > Response.Clear()
> > > > Response.ContentType = "application/pdf"
> > > >
> > > > If _sMimeType <> "text/html" Then
> > > > Response.AddHeader("Content-Disposition", "attachment;
> > > > filename=" & "BarChart.pdf")
> > > > End If
> > > > Response.BinaryWrite(_bResults)
> > > > --
> > > > Raj Chandra

No comments:

Post a Comment