Showing posts with label written. Show all posts
Showing posts with label written. Show all posts

Tuesday, March 20, 2012

crystal reports (the coder way) ?

Hi

I have a .NET application that needs to obtain the details of the parameters for a crystal report.

I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.

However, the viewer prompts for the parameters, before i get a chance to get the information and display it.:(

My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?

Thanks in anticipation[Moved thread]|||YOu need to populate the parameters to the report before viewing it the viewer or printing it to the printer.

here is a sample from VB on how to populate parameters and formulas.

Dim crFormula As CRAXDRT.FormulaFieldDefinition
Dim crParam As CRAXDRT.ParameterFieldDefinition

crReport.DiscardSavedData

For Each crParam In crReport.ParameterFields
Select Case crParam.Name
Case "{?SortType}"
crParam.AddCurrentValue m_strSortType

End Select
Next crParam


For Each crFormula In crReport.FormulaFields
Select Case crFormula.Name
Case "{@.StartDate}"
crFormula.Text = "DATE( 2001, 01, 01)"
Case "{@.EndDate}"
crFormula.Text = "DATE( 2002, 03, 30)"
crFormula.Text = """All Offices"""
Case "{@.DetailOrSummaryFlag}"
crFormula.Text = """" & m_strSummaryDetailFlag & """"
Case "{@.Seperate}"
crFormula.Text = """FALSE"""
Case "{@.SetShowWarning}"
crFormula.Text = """FALSE"""
Case Else
'do nothing
End Select
Next crFormula|||Hi

I have a .NET application that needs to obtain the details of the parameters for a crystal report.

I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.

However, the viewer prompts for the parameters, before i get a chance to get the information and display it.:(

My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?

Thanks in anticipation

Dim APP As New CRAXDRT.Application
Dim REPORT As CRAXDRT.Report
REPORT = APP.OpenReport("C:\SHIPMENT_SCHEDULE\REPORTS\XL.rpt")

REPORT.EnableParameterPrompting = False
(this is the one you should include...disabling the parameter prompting)

Saturday, February 25, 2012

Cryptic error from SqlXml 3.0 Managed Classes

Hi,
I have a windows service written in C# that is using the SqlXml 3.0 Managed
Classes.
The service has functioned reliably until we came across this problem on one
Windows 2000 server installation.
I'm that SqlXml is returning this message - In order to
troubleshoot I would need to know the service dependencies for SqlXml -
something I have not been able to establish so far from the on-line
documentation.
Message: The service cannot be started, either because it is disabled or
because it has no enabled devices associated with it.
Source: mscorlib
Stacktrace:
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.Data.SqlXml.SqlXmlCommand.fillManagedWrapper()
at Microsoft.Data.SqlXml.SqlXmlCommand.construct()
at Microsoft.Data.SqlXml.SqlXmlCommand..ctor(String cnString)
at xxxxx.DataAccess.SqlClientHelper.ExecSqlXmlQuery(String sqlxmlquery,
String sqlxmlconnectionstring, Hashtable sqlXmlParams, Boolean isSP)
at xxxxx.Occam.ReportQueue.Report.GetNext(Int32 currentLoad, Int32
ceiling, DBConfig dbconfig, Config config, LanguageManager languageManager)
Eagerly awaiting any suggestions on this. This is an important issue for us,
as it's preventing us from completing roll-out to an important client.
regards,
James AshtonHi James,
As far as I know SQLXML does not have any service dependencies,. I think
this is happening because either sqlxml is not registered properly or the
managed wrapper is not being loaded properly. Please make sure that sqlxml
is registered properly and that the managed wrapper is in the assembly
cache.
If you are still hitting this problem let me know.
Thank you,
Amar Nalla
PS: This posting is provided AS IS and confers no rights or warranties.
"James Ashton" <JamesAshton@.discussions.microsoft.com> wrote in message
news:A6967A3A-31D8-4EAE-ABE6-8BDE6BE39A8F@.microsoft.com...
> Hi,
> I have a windows service written in C# that is using the SqlXml 3.0
Managed
> Classes.
> The service has functioned reliably until we came across this problem on
one
> Windows 2000 server installation.
> I'm that SqlXml is returning this message - In order to
> troubleshoot I would need to know the service dependencies for SqlXml -
> something I have not been able to establish so far from the on-line
> documentation.
>
> Message: The service cannot be started, either because it is disabled or
> because it has no enabled devices associated with it.
> Source: mscorlib
> Stacktrace:
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at Microsoft.Data.SqlXml.SqlXmlCommand.fillManagedWrapper()
> at Microsoft.Data.SqlXml.SqlXmlCommand.construct()
> at Microsoft.Data.SqlXml.SqlXmlCommand..ctor(String cnString)
> at xxxxx.DataAccess.SqlClientHelper.ExecSqlXmlQuery(String sqlxmlquery,
> String sqlxmlconnectionstring, Hashtable sqlXmlParams, Boolean isSP)
> at xxxxx.Occam.ReportQueue.Report.GetNext(Int32 currentLoad, Int32
> ceiling, DBConfig dbconfig, Config config, LanguageManager
languageManager)
>
> Eagerly awaiting any suggestions on this. This is an important issue for
us,
> as it's preventing us from completing roll-out to an important client.
> regards,
> James Ashton
>|||I did instruct the client on this, but I haven't heard from them yet as to
whether this was successful. I will contact them to find out, and then updat
e
this thread.
Unfortunately this is one of those where we couldn't reproduce the error in
house. So hopefully, the client will inform me that it's an installation
problem.
many thanks Amar, and hopefully they won't have any more problems.
regards,
James Ashton
"Amar Nalla [MSFT]" wrote:

> Hi James,
> As far as I know SQLXML does not have any service dependencies,. I think
> this is happening because either sqlxml is not registered properly or the
> managed wrapper is not being loaded properly. Please make sure that sqlxml
> is registered properly and that the managed wrapper is in the assembly
> cache.
> If you are still hitting this problem let me know.
> Thank you,
> Amar Nalla
> PS: This posting is provided AS IS and confers no rights or warranties.
> "James Ashton" <JamesAshton@.discussions.microsoft.com> wrote in message
> news:A6967A3A-31D8-4EAE-ABE6-8BDE6BE39A8F@.microsoft.com...
> Managed
> one
> languageManager)
> us,
>
>

Cryptic error from SqlXml 3.0 Managed Classes

Hi,
I have a windows service written in C# that is using the SqlXml 3.0 Managed
Classes.
The service has functioned reliably until we came across this problem on one
Windows 2000 server installation.
I'm confused that SqlXml is returning this message - In order to
troubleshoot I would need to know the service dependencies for SqlXml -
something I have not been able to establish so far from the on-line
documentation.
Message: The service cannot be started, either because it is disabled or
because it has no enabled devices associated with it.
Source: mscorlib
Stacktrace:
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.Data.SqlXml.SqlXmlCommand.fillManagedWra pper()
at Microsoft.Data.SqlXml.SqlXmlCommand.construct()
at Microsoft.Data.SqlXml.SqlXmlCommand..ctor(String cnString)
at xxxxx.DataAccess.SqlClientHelper.ExecSqlXmlQuery(S tring sqlxmlquery,
String sqlxmlconnectionstring, Hashtable sqlXmlParams, Boolean isSP)
at xxxxx.Occam.ReportQueue.Report.GetNext(Int32 currentLoad, Int32
ceiling, DBConfig dbconfig, Config config, LanguageManager languageManager)
Eagerly awaiting any suggestions on this. This is an important issue for us,
as it's preventing us from completing roll-out to an important client.
regards,
James Ashton
Hi James,
As far as I know SQLXML does not have any service dependencies,. I think
this is happening because either sqlxml is not registered properly or the
managed wrapper is not being loaded properly. Please make sure that sqlxml
is registered properly and that the managed wrapper is in the assembly
cache.
If you are still hitting this problem let me know.
Thank you,
Amar Nalla
PS: This posting is provided AS IS and confers no rights or warranties.
"James Ashton" <JamesAshton@.discussions.microsoft.com> wrote in message
news:A6967A3A-31D8-4EAE-ABE6-8BDE6BE39A8F@.microsoft.com...
> Hi,
> I have a windows service written in C# that is using the SqlXml 3.0
Managed
> Classes.
> The service has functioned reliably until we came across this problem on
one
> Windows 2000 server installation.
> I'm confused that SqlXml is returning this message - In order to
> troubleshoot I would need to know the service dependencies for SqlXml -
> something I have not been able to establish so far from the on-line
> documentation.
>
> Message: The service cannot be started, either because it is disabled or
> because it has no enabled devices associated with it.
> Source: mscorlib
> Stacktrace:
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at Microsoft.Data.SqlXml.SqlXmlCommand.fillManagedWra pper()
> at Microsoft.Data.SqlXml.SqlXmlCommand.construct()
> at Microsoft.Data.SqlXml.SqlXmlCommand..ctor(String cnString)
> at xxxxx.DataAccess.SqlClientHelper.ExecSqlXmlQuery(S tring sqlxmlquery,
> String sqlxmlconnectionstring, Hashtable sqlXmlParams, Boolean isSP)
> at xxxxx.Occam.ReportQueue.Report.GetNext(Int32 currentLoad, Int32
> ceiling, DBConfig dbconfig, Config config, LanguageManager
languageManager)
>
> Eagerly awaiting any suggestions on this. This is an important issue for
us,
> as it's preventing us from completing roll-out to an important client.
> regards,
> James Ashton
>
|||I did instruct the client on this, but I haven't heard from them yet as to
whether this was successful. I will contact them to find out, and then update
this thread.
Unfortunately this is one of those where we couldn't reproduce the error in
house. So hopefully, the client will inform me that it's an installation
problem.
many thanks Amar, and hopefully they won't have any more problems.
regards,
James Ashton
"Amar Nalla [MSFT]" wrote:

> Hi James,
> As far as I know SQLXML does not have any service dependencies,. I think
> this is happening because either sqlxml is not registered properly or the
> managed wrapper is not being loaded properly. Please make sure that sqlxml
> is registered properly and that the managed wrapper is in the assembly
> cache.
> If you are still hitting this problem let me know.
> Thank you,
> Amar Nalla
> PS: This posting is provided AS IS and confers no rights or warranties.
> "James Ashton" <JamesAshton@.discussions.microsoft.com> wrote in message
> news:A6967A3A-31D8-4EAE-ABE6-8BDE6BE39A8F@.microsoft.com...
> Managed
> one
> languageManager)
> us,
>
>

Sunday, February 19, 2012

cross-column & cross-row consistency Sql server 2005 sp2.

(The previous edition of this post has some written errors
which can make what I say unclear .Now those written errors are correctd.)

[cross-column & cross-row consistency]
Transaction Consistency In Sql server 2005 sp2.

How are cross-column and cross-row consistency in SQL SERVER 2000/2005?

Now there is a table named T,and its structure is as follow:
T(value , twice_value),
which means [twice_value] is twice of [value].
I filled it with some rows ,then it looks as follow:
--
value |twice_value
--
1 |2
32 |64
78 |156
--
Then I run the statement:
-
Update T
set
[value] = [value] * 2 ,
[twice_value] = [twice_value] * 2
--(In the previous edition of this post ,here the " * 2 " was fogetten)
-
At this point , towpuzzles arise into my brain:
[1].Is there some isolation leve in which
[VALUES 1] can be read possibly in some cases?

[VALUES 1]
--
value |twice_value
--
1 |2
64 |128
78 |156
--
(Note: every row is consistent,
but the table[64|128] is not consistent against the above "upate".)

[2].Is there some isolation leve in which
[VALUED 2] can be read possibly in some cases?

[VALUED 2]
--
value |twice_value
--
2 |2
32 |64
78 |156
--
(Note:the first row[2|2] it self is not consistent)

What I can make sure is that
[VALUED 1] can be read possibly in some cases when
Table T is updated by the following statement.
-
Update T
set
[value] = [value] * 2 ,
[twice_value] = [twice_value] * 2
--(In the previous edition of this post ,here the " * 2 " was fogetten)
where [value] = 32
Update T
set
[value] = [value] * 2 ,
[twice_value] = [twice_value] * 2
--(In the previous edition of this post ,here the " * 2 " was fogetten)
where not([value] = 32)
-

What Tom Phillips said:

First, the update command you have listed above cannot create the values you show, since you set [twice_value]=[twice_value], unless you have a trigger setting the twice_value.

Second, the UPDATE statement creates an implicit transaction. Which means either all the records update or none of the records update and if there is a lock, it will wait for that lock to release. So there should be no possible way to create the results you describe after the query succeeds. Unless, you have something else changing the data, like a trigger.

If the isolation level was set to "READ UNCOMMITTED", a query could return what you describe, while the update was running. This is not unique to SP2.

With my corrected UPDATE statement, I cannot duplicate what you describe under any of the 3 versions of 2005, including SP2, I have or 2000 SP4, after the query has finished successfully.

Please post a duplication script of your problem.

|||

What Tengiz Kharatishvili MSFT said:

As Tom Phillips already mentioned your actual scenario is not really clear. But assuming that Tom's interpretation of your question is correct (except in the part that he as far as I can see implicitly supposes that you never run the queries that observe the data in the table concurrently with the updates – but I’m not 100% sure if this time I interpret him correctly), the answers are the following:

In general when reading the row using the interfaces available through T-SQL the transactional cross-column consistency for a single row is guaranteed by the engine for all isolation levels except the READ UNCOMMITTED. One example when the cross-column consistency could be violated when using dirty reads is when certain columns are not physically stored in the row – those include off-row LOB values or the variable length non-LOB columns that were pushed off-row because they don’t fit the data page.

The cross-row consistency is a different story and in order to be absolutely certain that an arbitrary DML statement will never see inconsistent results, one should use the SERAILIZABLE isolation level. For the queries is could also be guaranteed by the SNAPSHOT isolation level. However, in your particular example of the UPDATE statement where no rows are added or deleted, the REPEATABLE READ would also guarantee both the cross-column for a single row, and the cross-row transactional consistency for the entire table for any kind of query.


Microsoft SQL Server - Storage Engine - Access Methods

cross-column & cross-row consistency Sql server 2005 sp2.

(The previous edition of this post has some written errors
which can make what I say unclear .Now those written errors are correctd.)

[cross-column & cross-row consistency]
Transaction Consistency In Sql server 2005 sp2.

How are cross-column and cross-row consistency in SQL SERVER 2000/2005?

Now there is a table named T,and its structure is as follow:
T(value , twice_value),
which means [twice_value] is twice of [value].
I filled it with some rows ,then it looks as follow:
--
value |twice_value
--
1 |2
32 |64
78 |156
--
Then I run the statement:
-
Update T
set
[value] = [value] * 2 ,
[twice_value] = [twice_value] * 2
--(In the previous edition of this post ,here the " * 2 " was fogetten)
-
At this point , towpuzzles arise into my brain:
[1].Is there some isolation leve in which
[VALUES 1] can be read possibly in some cases?

[VALUES 1]
--
value |twice_value
--
1 |2
64 |128
78 |156
--
(Note: every row is consistent,
but the table[64|128] is not consistent against the above "upate".)

[2].Is there some isolation leve in which
[VALUED 2] can be read possibly in some cases?

[VALUED 2]
--
value |twice_value
--
2 |2
32 |64
78 |156
--
(Note:the first row[2|2] it self is not consistent)

What I can make sure is that
[VALUED 1] can be read possibly in some cases when
Table T is updated by the following statement.
-
Update T
set
[value] = [value] * 2 ,
[twice_value] = [twice_value] * 2
--(In the previous edition of this post ,here the " * 2 " was fogetten)
where [value] = 32
Update T
set
[value] = [value] * 2 ,
[twice_value] = [twice_value] * 2
--(In the previous edition of this post ,here the " * 2 " was fogetten)
where not([value] = 32)
-


by the way ,

Is there Anyone that knows available e-paper about "log storage and data storage"?

|||SO EARGERLY FOR SOME ANSWERS.|||MARK|||up|||First, the update command you have listed above cannot create the values you show, since you set [twice_value]=[twice_value], unless you have a trigger setting the twice_value.

Second, the UPDATE statement creates an implicit transaction. Which means either all the records update or none of the records update and if there is a lock, it will wait for that lock to release. So there should be no possible way to create the results you describe after the query succeeds. Unless, you have something else changing the data, like a trigger.

If the isolation level was set to "READ UNCOMMITTED", a query could return what you describe, while the update was running. This is not unique to SP2.

With my corrected UPDATE statement, I cannot duplicate what you describe under any of the 3 versions of 2005, including SP2, I have or 2000 SP4, after the query has finished successfully.
Please post a duplication script of your problem.

|||

As Tom Phillips already mentioned your actual scenario is not really clear. But assuming that Tom's interpretation of your question is correct (except in the part that he as far as I can see implicitly supposes that you never run the queries that observe the data in the table concurrently with the updates – but I’m not 100% sure if this time I interpret him correctly), the answers are the following:

In general when reading the row using the interfaces available through T-SQL the transactional cross-column consistency for a single row is guaranteed by the engine for all isolation levels except the READ UNCOMMITTED. One example when the cross-column consistency could be violated when using dirty reads is when certain columns are not physically stored in the row – those include off-row LOB values or the variable length non-LOB columns that were pushed off-row because they don’t fit the data page.

The cross-row consistency is a different story and in order to be absolutely certain that an arbitrary DML statement will never see inconsistent results, one should use the SERAILIZABLE isolation level. For the queries is could also be guaranteed by the SNAPSHOT isolation level. However, in your particular example of the UPDATE statement where no rows are added or deleted, the REPEATABLE READ would also guarantee both the cross-column for a single row, and the cross-row transactional consistency for the entire table for any kind of query.

|||up|||UP|||UP