Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Powerbuilder

83 views
Skip to first unread message

sam

unread,
Jul 25, 2009, 6:12:20 AM7/25/09
to
long ll_rc
dw_1.SETTRANSOBJECT(SQLCA)
dw_1.retrieve()
g_ole_crx_application = create oleobject
g_ole_crx_report = create oleObject
g_ole_crx_connection_info = create oleObject
Resultset lrs_resultset
ADOResultset lrs_adoresultset
oleobject loo_AdoRecordset
DataStore lds_temp
lds_temp =create Datastore
lds_temp.Dataobject="dw_print"
lds_temp.settransobject(sqlca)
lds_temp.retrieve()
lrs_resultset=create resultset
ll_rc=lds_temp.generateresultset(lrs_resultset)
lrs_adoresultset = create adoresultset
ll_rc = lrs_adoresultset.SetResultset(lrs_resultset)

loo_AdoRecordset = Create OleObject
ll_rc= lrs_adoresultset.getrecordset(loo_adorecordset)
object type_object
type_object=typeof(loo_adorecordset)

long p,a
a=dw_1.rowcount()
p=loo_adorecordset.recordcount

gi_return=g_ole_crx_application.ConnectToNewObject
('CrystalRuntime.Application.8.5')

long llng_result

if gi_return < 0 then
MessageBox("Error","Could Not Connect To The Crystal Application
Object")
return
end if


llng_result= CreateFieldDefFile(loo_adorecordset,"D:\Sameer
\sss.ttx",true)
llng_result= CreateReportOnRunTimeDs(loo_adorecordset,"D:\Sameer
\ee.rpt","D:\Sameer\ee.ttx",true,true)
gs_rpt_file_name="D:\Sameer\ddd.rpt"
ole_1.object.ReportName(gs_rpt_file_name)
g_ole_crx_report = g_ole_crx_application.OpenReport(gs_rpt_file_name,
1)
g_ole_crx_report.DiscardSavedData
g_ole_crx_report.Database.SetDataSource( loo_adorecordset,3,1)

ole_1.object.ReportSource(g_ole_crx_report)
ole_1.object.ViewReport()
createfielddeffile and createreportonruntime functions are not
running. Bad runtime fuction refence error message is displayed... plz
help me its urgent

Adam Simmonds

unread,
Jul 26, 2009, 6:53:52 PM7/26/09
to

Are the two functions you refer to on the Crystal Reports OLE object?
If so you probably need to reference the object

llng_result=
g_ole_crx_application.CreateFieldDefFile(loo_adorecordset,"D:\Sameer\sss.ttx",true)

sam

unread,
Jul 27, 2009, 12:43:11 AM7/27/09
to
i have refence the ole object, createfielddeffile is returning 0 and
createreportonruntimeDS is posing error calling external function

sam

unread,
Jul 27, 2009, 2:07:14 AM7/27/09
to
how can i refenceplz help me i am new to programming...

sam

unread,
Jul 27, 2009, 3:27:53 AM7/27/09
to
i am using createfielddeffile and createreportonruntimeds by
declaring
p2smon.dll library

Roland Smith [TeamSybase]

unread,
Jul 28, 2009, 8:35:26 AM7/28/09
to
Perhaps you should create the reports using DataWindows instead of Crystal
Reports. The DataWindow is one of the primary reasons to use PowerBuilder.

"sam" <priyanka...@gmail.com> wrote in message
news:a46693f7-4a05-4911...@t13g2000yqt.googlegroups.com...

KL

unread,
Jul 28, 2009, 11:36:39 AM7/28/09
to
Don't do crystal reports, but:
'These functions are purely for development purposes (they
are not required at runtime).
'

How are you declaring them?
VB would be:

Declare Function CreateFieldDefFile Lib "p2smon.dll"(lpUnk
As Object, ByVal fileName As String, ByVal
bOverWriteExistingFile As Long) As Long

Parameter Description

- LpUnk The active data source used to create the field
definition file. In C or C++, this is a pointer to an
IUnknown derived COM interface relating to a DAO or ADO
Recordset. In Visual Basic, this is a Recordset or Rowset
object.

- Filename The path and file name of the field definition
file to be created.

- bOverWriteExistingFile If a field definition file already
exists with the specified path and file name, this flag
indicates whether or not to overwrite that file.

Declare Function CreateReportOnRuntimeDS Lib "p2smon.dll" (
lpUnk As Object, ByVal reportFile As String, ByVal
fieldDefFile As String, ByVal bOverWriteFile As Long, ByVal
bLaunchDesigner As Long) As Long

Parameter Description

- LpUnk The active data source used to create the field
definition file. In C or C++, this is a pointer to an
Iunknown derived COM interface relating to a DAO or ADO
Recordset. In Visual Basic, this is a Recordset or Rowset
object.

- ReportFile The path and file name of the report file to be
created.

- FieldDefFile The path and file name of the field
definition file to be created.

- BoverWriteFile If a field definition file already exists
with the specified path and file name, this flag indicates
whether or not to overwrite that file.

- BlaunchDesigner If True (1), Crystal Reports is launched
with the newly created report file opened. Crystal Reports
must be installed on the system.

HTH KL

Adam Simmonds

unread,
Jul 29, 2009, 2:39:23 AM7/29/09
to
Roland Smith [TeamSybase] wrote:
> Perhaps you should create the reports using DataWindows instead of Crystal
> Reports. The DataWindow is one of the primary reasons to use PowerBuilder.

Good point, however I believe people tend to go with Crystal for its
custom reporting abilities but I always try to counter that argument
with the use of Infomaker as an alternative tool.

sam

unread,
Jul 29, 2009, 8:23:30 AM7/29/09
to

KL wrote:
> Don't do crystal reports, but:
> 'These functions are purely for development purposes (they
> are not required at runtime).
> '
>
> How are you declaring them?
> VB would be:
>
> Declare Function CreateFieldDefFile Lib "p2smon.dll"(lpUnk
> As Object, ByVal fileName As String, ByVal
> bOverWriteExistingFile As Long) As Long
>

I am declaring these functions in powerbuilder 9

Function long CreateFieldDefFile ( ref oleobject lpunk, String
FileName, long bOverWriteExistingFile) Library "p2smon.dll"

Function long CreateReportOnRunTimeDs(ref oleobject lpunk,String
reportFile,String fieldDefFile, long bOverWriteFile,long
bLaunchDesigner) Library "p2smon.dll"

KL

unread,
Jul 29, 2009, 1:25:26 PM7/29/09
to
Use TRY CATCH to get a better error description?
Use 1 instead of True in the call.

JAWAG KL

> KL wrote:
> > Don't do crystal reports, but:
> > 'These functions are purely for development purposes
> > (they are not required at runtime).
> > '
> >
> > How are you declaring them?
> > VB would be:
> >
> > Declare Function CreateFieldDefFile Lib
> > "p2smon.dll"(lpUnk As Object, ByVal fileName As String,
> > ByVal bOverWriteExistingFile As Long) As Long
> >
>
> I am declaring these functions in powerbuilder 9
>
> Function long CreateFieldDefFile ( ref oleobject lpunk,
> String FileName, long bOverWriteExistingFile) Library
> "p2smon.dll"
>
> Function long CreateReportOnRunTimeDs(ref oleobject lpunk

> ,String reportFile,String fieldDefFile, long
> bOverWriteFile,long bLaunchDesigner) Library "p2smon.dll"

Aiza Artillero

unread,
May 20, 2016, 3:34:49 AM5/20/16
to
>>>> Can anyone help me with regards to Power Builder Tutorial?
0 new messages