Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Thursday, March 29, 2012

Error Rendering SSRS Reports via SOAP

I am running SQL Reporting Services and SQL Server 2005 on a Windows 2003
server. The configuration has been unchanged for approx. 3 weeks. Suddenly
over the last two days, reports being accessed via an ASP.NET 2.0 application
(on Windows 2003 Server with IIS 6) using a SOAP call to the reportserver
became inaccessable. End users received the following error:
********************************************************
Message: An error occurred during rendering of the report. -->
An error occurred during rendering of the report. -->
An error occurred during rendering of the report. -->
An error occurred during rendering of the report. -->
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
Stack Trace: at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at IFA.CAP.SQLReportingService.ReportingService.Render(String Report,
String Format, String HistoryID, String DeviceInfo, ParameterValue[]
Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle,
String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed,
Warning[]& Warnings, String[]& StreamIds) in C:\Applications\IFACAP\Web
References\SQLReportingService\Reference.vb:line 1319
at IFA.CAP.BusinessObjects.Reports.Certificate(Int32 certificateID,
Boolean isDraft, Boolean isCertified) in
C:\Applications\IFACAP\BusinessObjects\IFA.CAP.BusinessObjects.Report.vb:line
551
at IFA.CAP.CertificateDetail.PrintCertificate(Object sender, EventArgs e)
in C:\Applications\IFACAP\Main\CertificateDetail.aspx.vb:line 2287
********************************************************
A short term resolution has been to perform iisrest on the ReportServer.
However, the problem reappears later at random intervals.
This only seems to be an issue with reports being called using SOAP.
Reports being rendering in the .NET Report Viewer control appear unaffected.
Here is some sample code to illustrate how we call some of our reports from
ASP.NET through the SSRS web service:
************************************************************
Private callback As New
System.Net.Security.RemoteCertificateValidationCallback(AddressOf
RemoteCertificateValidationCallback)
Private Function RemoteCertificateValidationCallback(ByVal sender As Object, _
ByVal cert As
System.Security.Cryptography.X509Certificates.X509Certificate, _
ByVal chain As
System.Security.Cryptography.X509Certificates.X509Chain, _
ByVal sslPolicyErrors As System.Net.Security.SslPolicyErrors) As Boolean
Return True
End Function
Sub RenderReport()
Dim rs As New SQLReportingService.ReportingService
Dim results As [Byte]() = Nothing
System.Net.ServicePointManager.ServerCertificateValidationCallback = callback
rs.Credentials = New System.Net.NetworkCredential("User", "Password",
"Domain")
results = rs.Render(String.Concat("TargerFolder", "ReportName"), "PDF",
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
Nothing, Nothing)
Response.Clear()
Response.Buffer = True
Response.Expires = 0
Response.ContentType = "application/pdf"
Response.AppendHeader("Content-Disposition", "attachment;
filename=Report.pdf")
Response.BinaryWrite(results)
Response.End()
End Sub
************************************************************
Does anyone see a problem with the above code. It has been in production
for 3 weeks now and has been working fine until yesterday. Any help would be
greatly appreciated!Try running memtest: www.memtest.org. You may have bad memory.
"mjorangehawk" wrote:
> I am running SQL Reporting Services and SQL Server 2005 on a Windows 2003
> server. The configuration has been unchanged for approx. 3 weeks. Suddenly
> over the last two days, reports being accessed via an ASP.NET 2.0 application
> (on Windows 2003 Server with IIS 6) using a SOAP call to the reportserver
> became inaccessable. End users received the following error:
> ********************************************************
> Message: An error occurred during rendering of the report. -->
> An error occurred during rendering of the report. -->
> An error occurred during rendering of the report. -->
> An error occurred during rendering of the report. -->
> Attempted to read or write protected memory. This is often an indication
> that other memory is corrupt.
> Stack Trace: at
> System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
> at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> methodName, Object[] parameters)
> at IFA.CAP.SQLReportingService.ReportingService.Render(String Report,
> String Format, String HistoryID, String DeviceInfo, ParameterValue[]
> Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle,
> String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed,
> Warning[]& Warnings, String[]& StreamIds) in C:\Applications\IFACAP\Web
> References\SQLReportingService\Reference.vb:line 1319
> at IFA.CAP.BusinessObjects.Reports.Certificate(Int32 certificateID,
> Boolean isDraft, Boolean isCertified) in
> C:\Applications\IFACAP\BusinessObjects\IFA.CAP.BusinessObjects.Report.vb:line
> 551
> at IFA.CAP.CertificateDetail.PrintCertificate(Object sender, EventArgs e)
> in C:\Applications\IFACAP\Main\CertificateDetail.aspx.vb:line 2287
> ********************************************************
> A short term resolution has been to perform iisrest on the ReportServer.
> However, the problem reappears later at random intervals.
> This only seems to be an issue with reports being called using SOAP.
> Reports being rendering in the .NET Report Viewer control appear unaffected.
> Here is some sample code to illustrate how we call some of our reports from
> ASP.NET through the SSRS web service:
> ************************************************************
> Private callback As New
> System.Net.Security.RemoteCertificateValidationCallback(AddressOf
> RemoteCertificateValidationCallback)
> Private Function RemoteCertificateValidationCallback(ByVal sender As Object, _
> ByVal cert As
> System.Security.Cryptography.X509Certificates.X509Certificate, _
> ByVal chain As
> System.Security.Cryptography.X509Certificates.X509Chain, _
> ByVal sslPolicyErrors As System.Net.Security.SslPolicyErrors) As Boolean
> Return True
> End Function
>
> Sub RenderReport()
> Dim rs As New SQLReportingService.ReportingService
> Dim results As [Byte]() = Nothing
> System.Net.ServicePointManager.ServerCertificateValidationCallback = callback
> rs.Credentials = New System.Net.NetworkCredential("User", "Password",
> "Domain")
> results = rs.Render(String.Concat("TargerFolder", "ReportName"), "PDF",
> Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
> Nothing, Nothing)
>
> Response.Clear()
> Response.Buffer = True
> Response.Expires = 0
> Response.ContentType = "application/pdf"
> Response.AppendHeader("Content-Disposition", "attachment;
> filename=Report.pdf")
> Response.BinaryWrite(results)
> Response.End()
> End Sub
> ************************************************************
> Does anyone see a problem with the above code. It has been in production
> for 3 weeks now and has been working fine until yesterday. Any help would be
> greatly appreciated!
>|||Actually, it turns out the problem was related to a database image that was
being loaded into the report dynamically. The image control on the report
had a MIME type of jpg but we had a few cases of images that had been
inserted into the database as TIF's. Once we replaced those with JPG
versions the problem went away.
"breno" wrote:
> Try running memtest: www.memtest.org. You may have bad memory.
> "mjorangehawk" wrote:
> > I am running SQL Reporting Services and SQL Server 2005 on a Windows 2003
> > server. The configuration has been unchanged for approx. 3 weeks. Suddenly
> > over the last two days, reports being accessed via an ASP.NET 2.0 application
> > (on Windows 2003 Server with IIS 6) using a SOAP call to the reportserver
> > became inaccessable. End users received the following error:
> >
> > ********************************************************
> >
> > Message: An error occurred during rendering of the report. -->
> > An error occurred during rendering of the report. -->
> > An error occurred during rendering of the report. -->
> > An error occurred during rendering of the report. -->
> > Attempted to read or write protected memory. This is often an indication
> > that other memory is corrupt.
> >
> > Stack Trace: at
> > System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
> > at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> > methodName, Object[] parameters)
> > at IFA.CAP.SQLReportingService.ReportingService.Render(String Report,
> > String Format, String HistoryID, String DeviceInfo, ParameterValue[]
> > Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle,
> > String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed,
> > Warning[]& Warnings, String[]& StreamIds) in C:\Applications\IFACAP\Web
> > References\SQLReportingService\Reference.vb:line 1319
> > at IFA.CAP.BusinessObjects.Reports.Certificate(Int32 certificateID,
> > Boolean isDraft, Boolean isCertified) in
> > C:\Applications\IFACAP\BusinessObjects\IFA.CAP.BusinessObjects.Report.vb:line
> > 551
> > at IFA.CAP.CertificateDetail.PrintCertificate(Object sender, EventArgs e)
> > in C:\Applications\IFACAP\Main\CertificateDetail.aspx.vb:line 2287
> >
> > ********************************************************
> >
> > A short term resolution has been to perform iisrest on the ReportServer.
> > However, the problem reappears later at random intervals.
> >
> > This only seems to be an issue with reports being called using SOAP.
> > Reports being rendering in the .NET Report Viewer control appear unaffected.
> >
> > Here is some sample code to illustrate how we call some of our reports from
> > ASP.NET through the SSRS web service:
> >
> > ************************************************************
> >
> > Private callback As New
> > System.Net.Security.RemoteCertificateValidationCallback(AddressOf
> > RemoteCertificateValidationCallback)
> >
> > Private Function RemoteCertificateValidationCallback(ByVal sender As Object, _
> > ByVal cert As
> > System.Security.Cryptography.X509Certificates.X509Certificate, _
> > ByVal chain As
> > System.Security.Cryptography.X509Certificates.X509Chain, _
> > ByVal sslPolicyErrors As System.Net.Security.SslPolicyErrors) As Boolean
> >
> > Return True
> >
> > End Function
> >
> >
> > Sub RenderReport()
> > Dim rs As New SQLReportingService.ReportingService
> > Dim results As [Byte]() = Nothing
> >
> > System.Net.ServicePointManager.ServerCertificateValidationCallback = callback
> >
> > rs.Credentials = New System.Net.NetworkCredential("User", "Password",
> > "Domain")
> >
> > results = rs.Render(String.Concat("TargerFolder", "ReportName"), "PDF",
> > Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
> > Nothing, Nothing)
> >
> >
> > Response.Clear()
> > Response.Buffer = True
> > Response.Expires = 0
> > Response.ContentType = "application/pdf"
> > Response.AppendHeader("Content-Disposition", "attachment;
> > filename=Report.pdf")
> > Response.BinaryWrite(results)
> > Response.End()
> > End Sub
> >
> > ************************************************************
> >
> > Does anyone see a problem with the above code. It has been in production
> > for 3 weeks now and has been working fine until yesterday. Any help would be
> > greatly appreciated!
> >

Error rendering report as HTML

I am rendering a report as HTML4.0 via Web Services interface and the report
appears...but only the first page. I notice a small yellow error icon on the
bottom of the page and if I double-click it reads:
Line: 20
Error: 'Report' is undefined
Code: 0
If I view the page source, around line 20 is the following:
function OnLoadReport()
{
var pageHits = null;
var rep = new Report(1, 155, pageHits, false, docMapIds);
if (parent != self) parent.OnLoadReport(rep);
}
What gives? This report works if I render as PDF. What am I doing wrong?
Thanks
- dwdw,
Take a look at the renderstream method: http://tinyurl.com/5q4qb
Bob
"dw" <dw@.discussions.microsoft.com> wrote in message
news:EE900282-8684-44A8-BDD5-780F9B071EF8@.microsoft.com...
> I am rendering a report as HTML4.0 via Web Services interface and the
report
> appears...but only the first page. I notice a small yellow error icon on
the
> bottom of the page and if I double-click it reads:
> Line: 20
> Error: 'Report' is undefined
> Code: 0
> If I view the page source, around line 20 is the following:
> function OnLoadReport()
> {
> var pageHits = null;
> var rep = new Report(1, 155, pageHits, false, docMapIds);
> if (parent != self) parent.OnLoadReport(rep);
> }
> What gives? This report works if I render as PDF. What am I doing wrong?
> Thanks
> - dw

Tuesday, March 27, 2012

error rebuild index with dbcc

I have an error like this, every time I reindex this table
via db maintenance plan.
Rebuilding indexes for table 'tbJOTrStatusbyWC'
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 1934:
[Microsoft][ODBC SQL Server Driver][SQL Server]DBCC failed
because the following SET options have incorrect
settings: 'QUOTED_IDENTIFIER, ARITHABORT'.
What does it means this error ?
How to setting 'QUOTED_IDENTIFIER, ARITHABORT'
thx.You most probably have an index on a computed columns or an indexed view. And unfortunately, the
maint plan doesn't execute the needed SET commands to be able to rebuild these indexes. You would
have to create your own (TSQL) job where you execute needed SET commands and then DBCC DBREINDEX (or
DBCC INDEXDEFRAG).
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"kresna rudy kurniawan" <kresnark@.yahoo.com> wrote in message
news:3c9401c37b42$a2255740$a601280a@.phx.gbl...
> I have an error like this, every time I reindex this table
> via db maintenance plan.
> Rebuilding indexes for table 'tbJOTrStatusbyWC'
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 1934:
> [Microsoft][ODBC SQL Server Driver][SQL Server]DBCC failed
> because the following SET options have incorrect
> settings: 'QUOTED_IDENTIFIER, ARITHABORT'.
> What does it means this error ?
> How to setting 'QUOTED_IDENTIFIER, ARITHABORT'
> thx.|||Tibor is correct in that the maintenance wizard has issues with things such
as computed columns and indexed views. I suggest you create your own
scheduled job to do the DBREINDEX and not use the wizard and all should be
fine.
--
Andrew J. Kelly
SQL Server MVP
"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@.cornerstone.se>
wrote in message news:u$PV9Y2eDHA.3788@.tk2msftngp13.phx.gbl...
> > You are wrong,
> I'm pretty certain that I'm not. But you are welcome to think so, if you
wish.
> I still recommend that you check very closely if you have either indexes
on computed columns or
> indexes on views.
> You do not need any special SET options if you have an PK over several
columns, so it has to be
> something else.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at: http://groups.google.com/groups?oi=djq&as
ugroup=microsoft.public.sqlserver
>
> "kresna rudy kurniawan" <kresnark@.yahoo.com> wrote in message
> news:3d9d01c37b5e$e471ee80$a601280a@.phx.gbl...
> > You are wrong,
> >
> > I don't use a computed columns, I use multi colums(JONo,
> > OPID,seqNo) for my primay key, this is the structure.
> >
> > TrackMainID int 4 1
> > JONo int 4 0
> > OPID int 4 0
> > SeqNo int 4 0
> > QtyIN numeric 5 1
> > QtyOut numeric 5 1
> > QtyOpen numeric 5 1
> > WCID int 4 1
> > FirstInDate datetime 8 1
> > LastOutDate datetime 8 1
> >
> > I still don't understand the message : incorrect
> > settings: 'QUOTED_IDENTIFIER, ARITHABORT'
> >
> > I must setting where ?
> >
> >
> >
> > >--Original Message--
> > >You most probably have an index on a computed columns or
> > an indexed view. And unfortunately, the
> > >maint plan doesn't execute the needed SET commands to be
> > able to rebuild these indexes. You would
> > >have to create your own (TSQL) job where you execute
> > needed SET commands and then DBCC DBREINDEX (or
> > >DBCC INDEXDEFRAG).
> > >
> > >--
> > >Tibor Karaszi, SQL Server MVP
> > >Archive at: http://groups.google.com/groups?oi=djq&as
> > ugroup=microsoft.public.sqlserver
> > >
> > >
> > >"kresna rudy kurniawan" <kresnark@.yahoo.com> wrote in
> > message
> > >news:3c9401c37b42$a2255740$a601280a@.phx.gbl...
> > >> I have an error like this, every time I reindex this
> > table
> > >> via db maintenance plan.
> > >>
> > >> Rebuilding indexes for table 'tbJOTrStatusbyWC'
> > >> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 1934:
> > >> [Microsoft][ODBC SQL Server Driver][SQL Server]DBCC
> > failed
> > >> because the following SET options have incorrect
> > >> settings: 'QUOTED_IDENTIFIER, ARITHABORT'.
> > >>
> > >> What does it means this error ?
> > >> How to setting 'QUOTED_IDENTIFIER, ARITHABORT'
> > >>
> > >> thx.
> > >
> > >
> > >.
> > >
>sql

Error pulling unicode data from DB2 Linked Server

Greetings,

We have been Selecting data from A DB2 AS400 via Linked Servers in SQL 7.

We began to pull data from new intstance/tables that contain some fields with foreign characters. (double byte, unicode) Some data will pull fine, then we will get an error:

Unexpected NULL value returned for column '[MYLINKEDSERVER].[DB2NAME1].[DB2NAME2].[MYTABLENAME].DESC2' from the OLE DB provider 'MSDASQL'. This column cannot be NULL.

The DBA from the other country tells me that the field is never null.

KB article Q239458 seemed related but doesn't help. We are running SP4, and will be trying on SP3 soon.

Is there any way to turn off this checking for NULL? My guess is that it interprets the unicode as a NULL incorrectly. I've tried to explicitly cast into varchar(30.)

Sometimes this fields is readable in English and it contains data that is critical when we can see it.

Thanks In Advance,
MikeyrowThe Work-Around developed was to use a pass-thru query to the DB2. I used a NULLIF function to replace any nulls, and that prevented the OLE-DB layer from erroring and failing.

Ideally we would want the DBA in the other country to fix this themselves, but sometimes time won't allow the cogs to churn enough to get the ideal solution developed.

Mike Rowland

Thursday, March 22, 2012

Error on Passing parameter to stored procedure

Hi,

I have a procedure that will save to table in sql server 200 via stored procedure. When I hit the save button it alwasy give me an error saying "Procedure 'sp_AddBoard' expects parameter '@.dtmWarrantyStart', which was not supplied" even though I supplied it in the code

which is

Dim ParamdtmWarrantyStart As SqlParameter = New SqlParameter("@.dtmWarrantyStart", SqlDbType.datetime, 8)
ParamdtmWarrantyStart.Value = dtmWarrantyStart
myCommand.Parameters.Add(ParamdtmWarrantyStart)

below is the stored procedure.

create Proc sp_AddBoard(@.BrandID int,
@.strPcName varchar(50),
@.bitAccounted bit,
@.dtmAccounted datetime,
@.dtmWarrantyStart datetime,
@.dtmWarrantyEnd datetime,
-- @.strDescription varchar(500),
@.intStatus int,
@.ModelNo varchar(50),
@.intMemorySlots int,
@.intMemSlotTaken int,
@.intAgpSlots int,
@.intPCI int,
@.bitWSound bit,
@.bitWLan bit,
@.bitWVideo bit,
@.dtmAcquired datetime,
@.stat bit output,
@.intFSB int) as
if not exists(select strPcName from tblBoards where strPcName=@.strPcName)
begin
insert into tblBoards
(BrandID, strPcName, bitAccounted,
dtmAccounted, dtmWarrantyStart,
dtmWarrantyEnd, --strDescription,
intStatus,
ModelNo, intMemorySlots, intMemSlotTaken,
intAgpSlots, intPCI, bitWLan,
bitWVideo, dtmAcquired,intFSB,bitWSound)

values

(@.BrandID,@.strPcName,@.bitAccounted,
@.dtmAccounted,@.dtmWarrantyStart,
@.dtmWarrantyEnd,--@.strDescription,
@.intStatus,
@.ModelNo,@.intMemorySlots,@.intMemSlotTaken,
@.intAgpSlots,@.intPCI,@.bitWLan,
@.bitWVideo,@.dtmAcquired,@.intFSB,@.bitWSound)
end
else
begin
set @.stat=1
end

The table is also designed to accept nulls on that field but still same error occured.

Please helpjust check if there is any value in the parameter value. the way i normally do is :


myCommand.Parameters.Add(New SqlParameter("@.cusbday",SqlDbType.datetime))
If len(trim(bday.Text)) = 0 Then
myCommand.Parameters("@.cusbday").Value = SqlDateTime.null
Else
myCommand.Parameters("@.cusbday").Value = DateTime.Parse(bday.Text)
End If

also you need to import the namespace System.Data.SqlTypes to use sqldatetime.null

<%@. import Namespace="System.Data.SqlTypes" %>

hthsql

Monday, March 19, 2012

Error on copying the database

Hi guys,
I can't find what is wrong.
I am copying a database via DTS and I get an error mid way "Invalid object dbo.fx_get_role_from_ownerid". But the object does exist and it has benn in production for a while now.
Why would I get his error, if the object does exist?Sounds like a user defined function...|||it is, and it's there. Why would I get this error?|||On the face of it...I'd say the stupid Object Id is out of whack with the object name...

try and recompile the function...then try it...

Why are you using DTS instead of dump and restore?|||Hi,
I have recompiled the function and still get the error.
I am using DTS to copy all databases on the server to another server every week automaticaly.
Any other ideas?|||How often do you back up the databases?

Why not attach them...

Would be the fastest thing to do...