Showing posts with label below. Show all posts
Showing posts with label below. Show all posts

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

Monday, March 26, 2012

Pdf Export using WebService- Error

Hi,
I am trying SRS2005 export into pdf using webservices,I got an error msg as below,any suggestions appreciated.

System.Web.Services.Protocols.SoapException: The permissions granted to user 'PPCCWDDC450P81\IUSR_PPCCWDDC450P81' are insufficient for performing this operation. > Microsoft.ReportingServices.Diagnostics.Utilities.RSException: The permissions granted to user 'PPCCWDDC450P81\IUSR_PPCCWDDC450P81' are insufficient for performing this operation. > Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'PPCCWDDC450P81\IUSR_PPCCWDDC450P81' are insufficient for performing this operation.
at Microsoft.ReportingServices.Library.RSService._GetReportParameterDefinitionFromCatalog(CatalogItemContext reportContext, String historyID, Boolean forRendering, Guid& reportID, Int32& executionOption, String& savedParametersXml, ReportSnapshot& compiledDefinition, ReportSnapshot& snapshotData, Guid& linkID, DateTime& historyOrSnapshotDate, Byte[]& secDesc)
at Microsoft.ReportingServices.Library.RSService._GetReportParameters(ClientRequest session, String report, String historyID, Boolean forRendering, NameValueCollection values, DatasourceCredentialsCollection credentials)
at Microsoft.ReportingServices.Library.RSService.RenderAsLiveOrSnapshot(CatalogItemContext reportContext, ClientRequest session, Warning[]& warnings, ParameterInfoCollection& effectiveParameters)
at Microsoft.ReportingServices.Library.RSService.RenderFirst(CatalogItemContext reportContext, ClientRequest session, Warning[]& warnings, ParameterInfoCollection& effectiveParameters, String[]& secondaryStreamNames)
at Microsoft.ReportingServices.Library.RenderFirstCancelableStep.Execute()
at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
End of inner exception stack trace
at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
at Microsoft.ReportingServices.Library.RenderFirstCancelableStep.RenderFirst(RSService rs, CatalogItemContext reportContext, ClientRequest session, JobType type, Warning[]& warnings, ParameterInfoCollection& effectiveParameters, String[]& secondaryStreamNames)
at Microsoft.ReportingServices.WebServer.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, Byte[]& Result, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds)
End of inner exception stack trace
at Microsoft.ReportingServices.WebServer.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, Byte[]& Result, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds)

Thanks,
Prabu

That means that you are trying to authenticate to reportserver with the user 'PPCCWDDC450P81\IUSR_PPCCWDDC450P81, this is an anonymous user that ASPNET uses for executing applications, you only have to add this user to the reportfolder or report item and give permissions of browser.sql

Friday, March 23, 2012

Pblm with Nested transactions

Friends,

I've a very basic doubt with Nested transactions (across procedures) in SQL Server and i guess the given below sample code illustarates my doubt well more than my words ..

I've a Proc1 like this

create procedure sp_proc1
as
begin
begin tran sp_proc1
insert into tab1 values (1,2)
exec sp_proc2 1
if <Some cdn statement>
rollback tran sp_proc1
else
commit tran sp_proc1
end

and called proc sp_proc2 is like this

create procedure sp_proc2
(
@.val1 int
)
as
begin tran proc2
update tab2 set col1 = 5
IF <some cdn statement>
begin
rollback tran proc2
end
else
begin
commit tran proc2
end

The pblm is when the 1st proc is executed and when the cdn statement in the 2nd proc is sucess, then it results with the error

Failed to retreive execution plan: Cannot roll back proc2. No transaction or savepoint of that name was found.

any suggestions

--SQLPgmrbegin tran proc2
update tab2 set col1 = 5
IF <some cdn statement> << Checking your tab2 but it still in tran !
begin
...

I think you probably are trying to check some thing that you are not commit yet!

Friday, March 9, 2012

Password Role

In our Oracle DB's we have a role that we assign to users to set up password
limitations, see below
Expire in 90 days
Lock 5 days after expiration
Keep 5 passwords (not to reuse)
Keep passwords for unlimited time
Enforce Password compliance, i.e. at least 1 Caps, 1 number, 1 special
character and at least 8 characters long Lock after 5 failed login attempts
Lock for 30 days
can this be replicated in MS SQL Svr?
Thanks for any help,
MPMThis is why your applications should support Windows logins (i.e., give a Windows user or group
permission to login to SQL Server). In such Case, Windows handles this for you.
There is currently no support for password aging or policies for SQL server logins. There will be in
next version, though.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
news:B86CA4E2-733F-4F9B-907B-BF02C678EFC3@.microsoft.com...
> In our Oracle DB's we have a role that we assign to users to set up password
> limitations, see below
> Expire in 90 days
> Lock 5 days after expiration
> Keep 5 passwords (not to reuse)
> Keep passwords for unlimited time
> Enforce Password compliance, i.e. at least 1 Caps, 1 number, 1 special
> character and at least 8 characters long Lock after 5 failed login attempts
> Lock for 30 days
> can this be replicated in MS SQL Svr?
> Thanks for any help,
> MPM|||Hello Tibor,
In regards to MPM's question. If I use the windows log ins but want to
limit the users access via stored procdures is there a simple method of
accomplishing this? Currently my applcation uses several hunderd stored
procedures. Manaully setting them all is almost impossible which leave
creating a program to do it but every time a change is made to the
application all the user permissions have to be updated.
Also I am assuming SQL 2005 which should be release in Nov will have the
aging MPM talked about, will they also have a better way of setting security
for accessing selected data?
Regards,
John
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:Ouu1xoujFHA.476@.TK2MSFTNGP14.phx.gbl...
> This is why your applications should support Windows logins (i.e., give a
> Windows user or group permission to login to SQL Server). In such Case,
> Windows handles this for you.
> There is currently no support for password aging or policies for SQL
> server logins. There will be in next version, though.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "MANCPOLYMAN" <MANCPOLYMAN@.discussions.microsoft.com> wrote in message
> news:B86CA4E2-733F-4F9B-907B-BF02C678EFC3@.microsoft.com...
>> In our Oracle DB's we have a role that we assign to users to set up
>> password
>> limitations, see below
>> Expire in 90 days
>> Lock 5 days after expiration
>> Keep 5 passwords (not to reuse)
>> Keep passwords for unlimited time
>> Enforce Password compliance, i.e. at least 1 Caps, 1 number, 1 special
>> character and at least 8 characters long Lock after 5 failed login
>> attempts
>> Lock for 30 days
>> can this be replicated in MS SQL Svr?
>> Thanks for any help,
>> MPM
>