crystal reports viewers, crystal reports schedulers, view crystal reports, report analyzers, burst reporting, report scheduler
 
view crystal reports, rpt viewer, crystal reports viewers, crystal reports schedulers, report analyzers, burst reporting, report scheduler
desktop viewer, crystal reports viewers, crystal reports schedulers, report analyzers, burst reporting, report scheduler

Crystal Reports Tools: Improve Performance While Saving Time and Money

  Resources  
Best sellers:
cView
Report Analyzer
cViewSERVER
ReCrystallize
 


Articles:
Administration
Advanced
Basic
Crystal eNL
Database
Financial
Problems Solved

Books:
CR Books

Database Books
Developer Books

 
Tools:
Analyzers
Bestsellers

CR Schedulers
CR UFLs
CR Viewers
DataBase Tools
Graphics
International
Mail UFLs
ReCrystallizePro


Add'l:

About us

Contact Us
cViewSUITE Ppt
Support

 

CrystalReports
on Steroids

Crystal Reports: COM Data Sources

COM data sources: gateways to data in your legacy systems.

This is really information for developers, but users can gain insight from it as well.

These COM data sources have been available for a couple of versions now and we are only just discovering how useful they can be. A COM data source is an ADO record set created by a VB program. You then use this as the source of data for your report.

The Visual Basic code is as simple as:

Public Function MyDataSource() As ADODB.Recordset 
Dim rsOut As New ADODB.Recordset 
‘Some code to build the rsOut recordset…. 
Set MyDataSource = rsOut 
End Function

So, where can you use one? Anywhere your data are not stored in a convenient database, but can be retrieved using Visual Basic. We have read of suggestions of using one to retrieve some legacy data from another system, or reading a text file.

If you can write some Visual Basic code to see the data and present them to a user, then you can wrap the function code above around your code, and compile it into a DLL. Register the DLL and use that to send your data to your Crystal Report.

Now, here's something very interesting to end-users, Crystal Report writers, and Crystal Report admins. A COM data driver is the key to our cViewIMAGE utility. cViewIMAGE is a COM data driver that can reference an image file in a field and return the embedded image to use in your report. This is an excellent way to raise the perceived value of any report and increase your own job security!

Click here for an example of how to include a single image in a report.

See below for a Microsoft table that shows data types used in COM. The source for this is http://msdn.microsoft.com/en-us/library/sak564ww.aspx

 

This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects.

 

The following table shows data types used in COM and their corresponding .NET Framework built-in value types or classes. Any type not explicitly identified in this table is converted to an Int32 system type. For corresponding types in Visual Basic 2005, C#, and C++, see the Introduction to the .NET Framework Class Library.

 
COM value type COM reference type System type

bool

bool *

System.Int32

char, small

char *, small *

System.SByte

short

short *

System.Int16

long, int

long *, int *

System.Int32

Hyper

hyper *

System.Int64

unsigned char, byte

unsigned char *, byte *

System.Byte

wchar_t, unsigned short

wchar_t *, unsigned short *

System.UInt16

unsigned long, unsigned int

unsigned long *, unsigned int *

System.UInt32

unsigned hyper

unsigned hyper *

System.UInt64

float

float *

System.Single

double

double *

System.Double

VARIANT_BOOL

VARIANT_BOOL *

System.Boolean

void *

void **

System.IntPtr

HRESULT

HRESULT *

System.Int16 orSystem.IntPtr

SCODE

SCODE *

System.Int32

BSTR

BSTR *

System.String

LPSTR or [string, …] char *

LPSTR *

System.String

LPWSTR or [string, …] wchar_t *

LPWSTR *

System.String

VARIANT

VARIANT *

System.Object

DECIMAL

DECIMAL *

System.Decimal

DATE

DATE *

System.DateTime

GUID

GUID *

System.Guid

CURRENCY

CURRENCY *

System.Decimal

IUnknown *

IUnknown **

System.Object

IDispatch *

IDispatch **

System.Object

SAFEARRAY(type)

SAFEARRAY(type) *

type[]

The following table lists COM value and reference types that convert to corresponding element types. For example, a COM coclass automatically maps to a managed class with the same name.

 
COM value type COM reference type Element type

Typedef BaseType MyType

ByRef BaseType

BaseType

MyStruct

ByRef VALUETYPE<MyStruct>

valuetype<MyStruct>

MyEnum

ByRef VALUETYPE<MyEnum>

valuetype<MyEnum>

MyInterface *

ByRef CLASS <MyInterface>

Class <MyInterface>

MyCoClass

ByRef CLASS <_Class>

Class <_Class>