Tuesday, March 27, 2012
Converting Crystal Code
to this format. However I've ran in to a problem and it is to do with a
function written in Crystal syntax but I cannot seem to be able to convert
this logic Heres the functio
----
StringVar name = "";
If NOT IsNull({Query.FIELD1_Company}) Then
name := {Query.FIELD1_Company};
If NOT IsNull({Query.FIELD2_COMPANY}) Then
name := {Query.FIELD2_COMPANY};
If NOT IsNull({Query.FIELD3_COMPANY}) Then
name := {Query.FIELD3_COMPANY};
If NOT IsNull({Query.FIELD4_COMPANY}) Then
name := {Query.FIELD4_COMPANY};
If NOT IsNull({Query.FIELD5_COMPANY}) Then
name := {Query.FIELD5_COMPANY};
If NOT IsNull({Query.FIELD6_COMPANY}) Then
name := {Query.FIELD6_COMPANY};
If NOT IsNull({Query.FIELD7_COMPANY}) Then
name := {Query.FIELD7_COMPANY};
If NOT IsNull({Query.FIELD8_COMPANY}) Then
name := {Query.FIELD8_COMPANY};
name
----
For a start, 'Null' cannot be used, neither can System.DBNull etc only
Nothing.
StringVar is a variable declaration in Crystal. What this all does is
prevents empty fields being returned (in Column 1) and the report format is
something similar to this
Company, Number of..., Export To..., etc
SomeCompany, 1, 1, etc
NULL, 0, 3, etc
So the code prevents record number 2 from appearing in the report and
returns the company name from one of the other columns (as code above).
NOTE All columns actually return the Company name but we are simply doing a
DISTINCTCOUNT on all the other columns(Query.FIELD2_COMPANY etc), so Column 1
will always have a company name (if the code works, as in Crystal).
Any ideas on this? and thanks in advanceIs TSql It is
ISNULL(Filed1, ISNULL(Field2, ISNULL(Field3, ISNULL(Field4,
ISNULL(Field5,'')))))
What this does is if Field1 is null it moves to Field2. A lot less
complicated.
"slk55guy" wrote:
> I'm evaluating Reporting Services and currently converting a Crystal Report
> to this format. However I've ran in to a problem and it is to do with a
> function written in Crystal syntax but I cannot seem to be able to convert
> this logic Heres the function
> ----
> StringVar name = "";
> If NOT IsNull({Query.FIELD1_Company}) Then
> name := {Query.FIELD1_Company};
> If NOT IsNull({Query.FIELD2_COMPANY}) Then
> name := {Query.FIELD2_COMPANY};
> If NOT IsNull({Query.FIELD3_COMPANY}) Then
> name := {Query.FIELD3_COMPANY};
> If NOT IsNull({Query.FIELD4_COMPANY}) Then
> name := {Query.FIELD4_COMPANY};
> If NOT IsNull({Query.FIELD5_COMPANY}) Then
> name := {Query.FIELD5_COMPANY};
> If NOT IsNull({Query.FIELD6_COMPANY}) Then
> name := {Query.FIELD6_COMPANY};
> If NOT IsNull({Query.FIELD7_COMPANY}) Then
> name := {Query.FIELD7_COMPANY};
> If NOT IsNull({Query.FIELD8_COMPANY}) Then
> name := {Query.FIELD8_COMPANY};
> name;
> ----
> For a start, 'Null' cannot be used, neither can System.DBNull etc only
> Nothing.
> StringVar is a variable declaration in Crystal. What this all does is
> prevents empty fields being returned (in Column 1) and the report format is
> something similar to this
> Company, Number of..., Export To..., etc
> SomeCompany, 1, 1, etc
> NULL, 0, 3, etc
> So the code prevents record number 2 from appearing in the report and
> returns the company name from one of the other columns (as code above).
> NOTE All columns actually return the Company name but we are simply doing a
> DISTINCTCOUNT on all the other columns(Query.FIELD2_COMPANY etc), so Column 1
> will always have a company name (if the code works, as in Crystal).
> Any ideas on this? and thanks in advance
>
Sunday, March 25, 2012
Converting AS2000 DSO from VB6 to VS2005
I have a VB6 program that uses Analysis Services 2000 DSO to Automatically Process an AS2000 Database. I ran the Upgrade Wizard in VS2005 for Visual Basic on this VB6 program but the result has an error I can't find how to correct.
Here is the original code -
Dim mdDatabase As DSO.MDStore
Dim dsoServer As DSO.Server
Set dsoServer = New DSO.Server
dsoServer.Connect ("CubeServer")
Set mdDatabase = dsoServer.MDStores("TestCubes")
mdDatabase.Process
Here is the code as a result of the 2005 upgrade wizard -
Dim mdDatabase As DSO.MDStore
Dim dsoServer As DSO.Server
Set dsoServer = New DSO.Server
dsoServer.Connect ("CubeServer")
mdDatabase = dsoServer.MDStores("TestCubes")
The above line displays the following error: 'DSO.OlapCollection Cannot be indexed'
mdDatabase.Process
Can anyone tell me what's wrong? I can't use AMO because it doesn't work against AS2000. How do I select a specific AS2000 Databse with VB in VS2005 and process it?
Thanks,
JohnWC
Try posting this question on the on the Visual Basic General discussion forum.
Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
I did find the answer in the OLAP Managed Newsgroup. For anyone who may be interested, the following code line works.
mdDatabase = dsoServer.MDStores.Item("TestCubes")
JohnWC