473,472 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Crystal Reports and Powerbuilder 11.5 or 12.5

10 New Member
We are searching for code samples for creating reports using Crystal Reports to work with Powerbuilder 11.5 or 12.5
May 10 '12 #1
1 5152
serclaudio
1 New Member
String ls_file_report_path, ls_RecordSelectionFormula, ls_path_reports, ls_Report
long gi_return
OLEObject g_ole_crx_application
OLEObject g_ole_crx_report
OLEObject g_ole_crx_connection_info
OLEObject g_ole_crx_export_options

ls_path_reports = "c:\Reports\"
ls_Report = "xxx.rpt"

ls_file_report_path = ls_path_reports + ls_Report

IF not FileExists(ls_file_report_path) THEN
messagebox("Error", "File " + ls_file_report_path + " not exists")
return
end if

g_ole_crx_application = create OLEObject

gi_return = g_ole_crx_application.ConnectToNewObject('CrystalR untime.Application.10')
if gi_return < 0 then
MessageBox("Error", "Error CrystalRuntime.Application.10")
return
end if

g_ole_crx_application = g_ole_crx_application.OpenReport(ls_file_report_pa th, 1)

// Connect Database
g_ole_crx_application.Database.Tables(1).SetLogOnI nfo( "servername", "nome_database", "nome_utente", "password")
// Parameters (optional)
g_ole_crx_application.ParameterFields.GetItemByNam e("nome_parametro").AddCurrentValue("valore_parame tro")
// Record Formula (optional)
ls_RecordSelectionFormula = righttrim(lefttrim(g_ole_crx_application.RecordSel ectionFormula))
if isnull(ls_RecordSelectionFormula) or ls_RecordSelectionFormula='' then
ls_RecordSelectionFormula = 'formula'
else
ls_RecordSelectionFormula = ls_RecordSelectionFormula + 'and ' + 'formula'
end if
g_ole_crx_application.RecordSelectionFormula = ls_RecordSelectionFormula

g_ole_crx_application.EnableParameterPrompting = inv_reportviewer.gb_EnableParameterPrompting


// ole_crviewer: Crystal ActiveX Report Viewer Control 10.0
ole_crviewer.object.ReportSource(g_ole_crx_applica tion)
ole_crviewer.object.EnablePrintButton = True
ole_crviewer.object.EnableExportButton = True
ole_crviewer.object.EnableZoomControl = True
ole_crviewer.object.EnableAnimationCtrl = False
ole_crviewer.object.EnablePopupMenu = True
ole_crviewer.object.EnableProgressControl = True
ole_crviewer.object.EnableDrillDown = True
ole_crviewer.object.enablegrouptree = inv_reportviewer.gb_enablegrouptree
ole_crviewer.object.ViewReport
May 23 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: rAGHU | last post by:
Hi, In my ASP.NET web application project we need to design crystal reports with Crystal Reports version 8.5 enterpraise edition(Please Note:It is not the Crystal Reports that comes with...
13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
0
by: Robert Warnestam | last post by:
Hello, I have some problems deploying Crystal Reports. I'm using Visual Studio 2005 Beta 1. In this version Crystal Reports (9.7.3500.0) is included. I created a small test application...
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
1
by: Lyners | last post by:
Hello all, I have created an ASP.NET website that uses Crystal Reports that works on the localhost (my PC), but when I copy it to the server it does not. The problem is...
2
by: =?Utf-8?B?Um9zcyBNYXNvbg==?= | last post by:
Hi I am interested in using crystal reports for the first time but have a few questions that someone maybe able to help with before I get started. The background to my query is that a client is...
3
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.