How to create reports for java programs?
Hi,
I have planned to do a project using java,that will help to create reports for java programs. To create reports for java programs i used two options.
1)Crystal reports
2)Write the code to produce reports for each java programs
The second one little cumbersome.SO i planned to develop a software that is compatible for creating java reports.
I would like to know how i will do the project?Can you help me to made it a successful project.Hope you can help me.
Expecting your reply
PreethiRenjith
Uggg... Crystal reports...
I would personally write a generic report generator, It would probably be easier than fighting w/
crystal reports (CR is popular, but painful :) )
Anyhow, I've written report generators for many different applications. It is one of the simplest projects you
can take on, and the results make you feel special --
If your need nicely formated, portable, printable reports, you could have your report generator make PDF files (the format is open, and VERY simple, plus people like pdf files) you can get the pdf spec from adobe or from wotsit.org (the famous wotsit file format archive).
enjoy!
Similar Messages
-
How 2 creat report for displaying the details of a Delivery Document using
how to create report for displaying the details of a Delivery Document using the tables LIKP, LIPS
thank you
regards,
jagrut bharatkumar shukla
points will be rewardedHI
I AM GIVING YOU MY DELIVERY DOCUMENT CODE...MODIFY IT ACCORDING TO YOUR REQUIREMENT
*& Report ZDELIVERY *
report zdelivery message-id z9bhu .
types: begin of t_likp,
vbeln type likp-vbeln, "Delivery
erdat type likp-erdat, "Date for rec creation
* LFDAT TYPE LIKP-LFDAT, "Delevery Date
* WAERK TYPE LIKP-WAERK, "Currency
kunnr type likp-kunnr, "Ship-To Party
kunag type likp-kunag, "Sold-to party
traty type likp-traty, "Means-of-Transport
end of t_likp.
types: begin of t_lips,
vbeln type lips-vbeln, "Delivery
posnr type lips-posnr, "Delivery item
matnr type lips-matnr, "Material Number
arktx type lips-arktx, "Short Text for Sales Order Item
lfimg type lips-lfimg, "Actual quantity delivered
netpr type lips-netpr,
* MEINS TYPE LIPS-MEINS, "Base Unit of Measure
vgbel type lips-vgbel, "Doc no of the reference document
end of t_lips.
types: begin of t_vbpa,
vbeln type vbpa-vbeln, "SD DocumenT Number
posnr type vbpa-posnr, "Item number
parvw type vbpa-parvw, "Partner function
kunnrb type vbpa-kunnr, "Customer Number 1
end of t_vbpa.
types: begin of t_kna1,
kunnr type kna1-kunnr, "Customer Number 1
name1 type kna1-name1, "Name 1
ort01 type kna1-ort01, "City
adrnr type kna1-adrnr, "Address
end of t_kna1.
types: begin of t_li_vbpa,
vbeln type likp-vbeln, "Delivery
erdat type likp-erdat, "Date for rec creation
* LFDAT TYPE LIKP-LFDAT, "Delevery Date
* WAERK TYPE LIKP-WAERK, "Currency
kunnr type likp-kunnr, "Ship-To Party
kunag type likp-kunag, "Sold-to party
traty type likp-traty, "Means-of-Transport
vbeln1 type lips-vbeln, "Delivery
posnr type lips-posnr, "Delivery item
matnr type lips-matnr, "Material Number
arktx type lips-arktx, "Short Text for Sales Order Item
lfimg type lips-lfimg, "Actual quantity delivered
netpr type lips-netpr, "Net Price
* MEINS TYPE LIPS-MEINS, "Base Unit of Measure
vgbel type lips-vgbel, "Doc no of the reference document
vbeln3 type vbpa-vbeln, "SD DocumenT Number
parvw type vbpa-parvw, "Partner function
kunnrb type vbpa-kunnr, "Customer Number 1
end of t_li_vbpa.
types: begin of t_final,
vbeln type likp-vbeln, "Delivery
erdat type likp-erdat, "Date for rec creation
kunnr type likp-kunnr, "Ship-To Party
kunag type likp-kunag, "Sold-to party
traty type likp-traty, "Means-of-Transport
vbeln1 type lips-vbeln, "Delivery
posnr type lips-posnr, "Delivery item
matnr type lips-matnr, "Material Number
arktx type lips-arktx, "Short Text for Sales Order Item
lfimg type lips-lfimg, "Actual quantity delivered
netpr type lips-netpr, "Net Price
vgbel type lips-vgbel, "Doc no of the reference document
vbeln3 type vbpa-vbeln, "SD DocumenT Number
parvw type vbpa-parvw, "Partner function
kunnrb type vbpa-kunnr, "Customer Number 1
name1 type kna1-name1, "Name 1
ort01 type kna1-ort01, "City
adrnr1 type kna1-adrnr, "Address
name2 type kna1-name1, "Name 1
ort02 type kna1-ort01, "City
adrnr2 type kna1-adrnr, "Address
name3 type kna1-name1, "Name 1
ort03 type kna1-ort01, "City
adrnr3 type kna1-adrnr, "Address
end of t_final.
* D A T A D E C L A R A T I O N
*&*********Internal Table Declaration****************&*
data: it_likp type standard table of t_likp.
data: it_lips type standard table of t_lips.
data: it_vbpa type standard table of t_vbpa.
data: it_kna1 type standard table of t_kna1.
data: it_li_vbpa type standard table of t_li_vbpa.
data: it_li_vbpa_temp type standard table of t_li_vbpa.
data: it_final type standard table of t_final.
*&*********Work Area Declaration********************&*
data: wa_likp type t_likp.
data: wa_lips type t_lips.
data: wa_vbpa type t_vbpa.
data: wa_kna1 type t_kna1.
data: wa_li_vbpa type t_li_vbpa.
data: wa_li_vbpa_temp type t_li_vbpa.
data: wa_final type t_final.
*&*********Data Declaration************************&*
data: d_vbeln type likp-vbeln.
data: flag type i value 0.
* S E L E C T I O N S C R E E N D E C L A R A T I O N
selection-screen begin of block block2 with frame title text-001.
select-options: s_vbeln for d_vbeln obligatory. "Delivery no
selection-screen end of block block2.
* A T S E L E C T I O N - S C R E E N E V E N T S
*AT SELECTION-SCREEN.
*PERFORM VALIDATE_DATA.
* S T A R T O F S E L E C T I O N E V E N T S
start-of-selection.
perform fetch_data.
perform merge_data_kna1.
*INCLUDE Z9BT_SH_***4_FORMS.
call function 'OPEN_FORM'
exporting
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
device = 'PRINTER'
* DIALOG = 'X'
* FORM = ' '
language = sy-langu
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
exceptions
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
codepage = 11
others = 12
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
sort it_final by vbeln.
loop at it_final into wa_final.
call function 'START_FORM'
exporting
* ARCHIVE_INDEX =
form = 'Z9BT_DELIVERY'
language = sy-langu
* STARTPAGE = ' '
* PROGRAM = ' '
* MAIL_APPL_OBJECT =
* IMPORTING
* LANGUAGE =
exceptions
form = 1
format = 2
unended = 3
unopened = 4
unused = 5
spool_error = 6
codepage = 7
others = 8
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'WRITE_FORM'
exporting
element = 'ITEM_LIST'
function = 'SET'
type = 'BODY'
window = 'MAIN'
* IMPORTING
* PENDING_LINES =
* EXCEPTIONS
* ELEMENT = 1
* FUNCTION = 2
* TYPE = 3
* UNOPENED = 4
* UNSTARTED = 5
* WINDOW = 6
* BAD_PAGEFORMAT_FOR_PRINT = 7
* SPOOL_ERROR = 8
* CODEPAGE = 9
* OTHERS = 10
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'END_FORM'
* IMPORTING
* RESULT =
exceptions
unopened = 1
bad_pageformat_for_print = 2
spool_error = 3
codepage = 4
others = 5
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
call function 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
exceptions
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
others = 6
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*& Form VALIDATE_DATA
* text
* --> p1 text
* <-- p2 text
form validate_data .
select single vbeln into wa_likp-vbeln
from likp where vbeln in s_vbeln.
append wa_likp to it_likp.
if sy-subrc <> 0.
flag = 1.
endif.
endform. " VALIDATE_DATA
*& Form FETCH_DATA
* text
* --> p1 text
* <-- p2 text
form fetch_data .
select a~vbeln
a~erdat
a~kunnr
a~kunag
a~traty
b~vbeln
b~posnr
b~matnr
b~arktx
b~lfimg
b~netpr
b~vgbel
c~vbeln
c~parvw
c~kunnr
into table it_li_vbpa
from likp as a
left outer join lips as b on a~vbeln = b~vbeln
inner join vbpa as c on b~vgbel = c~vbeln
where a~vbeln in s_vbeln and
c~parvw = 'RE'.
endform. " FETCH_DATA
*& Form MERGE_DATA_KNA1
* text
* --> p1 text
* <-- p2 text
form merge_data_kna1 .
if it_li_vbpa[] is not initial.
it_li_vbpa_temp[] = it_li_vbpa[].
sort it_li_vbpa_temp by kunnr.
delete adjacent duplicates from it_li_vbpa_temp comparing kunnr.
loop at it_li_vbpa into wa_li_vbpa.
read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
wa_li_vbpa-kunag.
if sy-subrc <> 0.
wa_li_vbpa_temp = wa_li_vbpa.
append wa_li_vbpa_temp to it_li_vbpa_temp.
endif.
read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
wa_li_vbpa-kunnrb.
if sy-subrc <> 0.
wa_li_vbpa_temp = wa_li_vbpa.
append wa_li_vbpa_temp to it_li_vbpa_temp.
endif.
endloop.
endif.
if it_li_vbpa_temp[] is not initial.
select kunnr
name1
ort01
adrnr into table it_kna1 from kna1
for all entries in it_li_vbpa_temp
where kunnr = it_li_vbpa_temp-kunnr.
endif.
loop at it_li_vbpa into wa_li_vbpa .
wa_final-vbeln = wa_li_vbpa-vbeln.
wa_final-erdat = wa_li_vbpa-erdat.
*it_final-LFART = it_li_vbpa-LFART.
wa_final-kunnr = wa_li_vbpa-kunnr.
wa_final-kunag = wa_li_vbpa-kunag.
*it_final-VSTEL = it_li_vbpa-VSTEL.
wa_final-traty = wa_li_vbpa-traty.
wa_final-vbeln1 = wa_li_vbpa-vbeln.
wa_final-posnr = wa_li_vbpa-posnr.
wa_final-matnr = wa_li_vbpa-matnr.
wa_final-arktx = wa_li_vbpa-arktx.
wa_final-lfimg = wa_li_vbpa-lfimg.
wa_final-netpr = wa_li_vbpa-netpr.
*wa_final-GEWEI = it_li_vbpa-GEWEI.
*it_final-VOLUM = it_li_vbpa-VOLUM.
*it_final-VOLEH = it_li_vbpa-VOLEH.
wa_final-vgbel = wa_li_vbpa-vgbel.
wa_final-vbeln3 = wa_li_vbpa-vbeln.
*wa_final-PARVW = wa_li_vbpa-PARVW.
wa_final-kunnrb = wa_li_vbpa-kunnrb.
read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnr.
if sy-subrc = 0.
wa_final-name1 = wa_kna1-name1.
wa_final-ort01 = wa_kna1-ort01.
wa_final-adrnr1 = wa_kna1-adrnr.
endif.
read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunag.
if sy-subrc = 0.
wa_final-name2 = wa_kna1-name1.
wa_final-ort02 = wa_kna1-ort01.
wa_final-adrnr2 = wa_kna1-adrnr.
endif.
read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnrb.
if sy-subrc = 0.
wa_final-name3 = wa_kna1-name1.
wa_final-ort03 = wa_kna1-ort01.
wa_final-adrnr3 = wa_kna1-adrnr.
endif.
append wa_final to it_final.
clear wa_final.
endloop.
endform. -
How to create tcode for modulepool program with selection screen?
hi,
How to create tcode for modulepool program with selection screen?
thanks,
sagarHi,
We need to goto SE80.
In our program we right click on object name and goto create
-> transaction. Enter the module pool program and screen number and save and activate.
Or by SE93 also we can create a transaction code for our program.
Hope ths helps.
plz reward if useful.
thanks,
dhanashri..
Edited by: Dhanashri Pawar on Jul 22, 2008 8:29 AM -
How to create report for user in terminal licens
Dear Sir,
how to take report for terminal server license, I have windows 2008 r2, I am trying to create a report for cal per user license
it is disable.
windows 2008 r2
workgroup
citrix 6.5
thanks
saud alam
saudalamHi,
Thank you for posting in Windows Server Forum.
Agree with words of TP, to create per user CAL report server must be domain joined. You cannot create report in workgroup mode. Please check beneath article for guide.
Track the Issuance of Remote Desktop Services Per User Client Access Licenses
http://technet.microsoft.com/en-us/library/cc754625.aspx
Hope it helps!
Thanks.
Dharmesh Solanki -
How to create reports in java or j2ee???
I want to know how can we create reports in java or j2ee like we use crystal report in vb or .net.do we use jsp or servlet to generate the reports or is there any other tool to do the same?Members,please,do help me.
Well, you can use JasperResports (http://www.jasperforge.org/) and Eclipse Birt (http://www.eclipse.org/birt/phoenix/)
-
How to create Reports for the infopath form data
Hi All,
I have a requirement to generate reports in SharePoint based on InfoPath form data which is submitted into form library. Do I need to store each InfoPath form data into SQL Database/MS Access Database. if yes, can any one help me on this how
to save InfoPath form data into DB while submitting into "Form Library". based on the data stored in DB how to create and view the report in SharePoint?.
Thanks in Advance,
Satish
Thanks & Regards Satish DugasaniThank you for asking the questions for clarification, my requirement is like below
1. Need to insert all infopath form fields data into Access Database when i am submitting to the Form library
2. Create Access Reports like based on time period, based on submitter name, based on state, city, and combination of these etc.
3. Sync Access Database every time i am updating the form
4. View Access Reports in share point site
PS: I worked on this like below approch
1. Written Web Service to Sync Access Database for the Infopath form
2. Create Access Reports
3. Publish using "Publish to Access Services" by providing site URL it will create a subsite there i can able to see reports, tables, macros etc. but that is not an user friendly like i am not able to apply my branding because it is pointing to /_Layouts/accsrv/Modifyapplication.aspx.
could any one suggest me on this.
Thanks & Regards Satish Dugasani -
How to create help for java application
Thanks very much for any suggestions how to create help file for java application
how to set up the environment variable JAVAHELP_HOME
-
How to create report in Java?
I'm trying to use JasperReport, but I feel it is so difficult. Do you know other tool to create Report?
Hi
Have u tried iReport is cool for Jasper. Lovely
HomePage : http://ireport.sourceforge.net/ -
How to create reports for add-on
Hello,
I have an Add-on with two parts: 1. a web interface that has regular SQL tables and 2. a SBO UI API interface that thas UDT.
I want to create several reports for this add-on but I am not sure what i should use:
1. I cannot use XL Reporter since i cannot run reports on UDT.
2. I cannot use Query Manager because i cannot see the regular SQL tables.
3. I know I cannot use Print Layout Designer.
Also, it is true that when i upgrade SBO my regular SQL tables are going to be erased?
Thank you for your help,
IrinaHi Irina,
I think most developers revert to using a third-party add-on such as Crystal Reports or SQL Reporting Services as these offer an easy way to interface with .NET.
You should be able to reference non-SBO tables in a Query Manager query, SBO won't stop you querying any data from either your local database or any linked server (assuming your login has the necessary permissions). If the tables are in different databases and have different collations then you may get collation conflicts but these can normally be prevented by creating temporary tables and enforcing the correct collation. I'm not sure if you can then link this type of query to a report to get a printout.
I've never heard of any non-SBO tables being deleted or modified by either a patch upgrade or a version upgrade. According to the certification process, it's allowed but not recommended.
Kind Regards,
Owen -
How to create setup for Java Application?
Hello,
I have created one Java Application. Now I want to create setup for that. I want to know if there is any tool is available for Java Application. If yes, then please help me to get that.
My emal id is "[email protected]"
Thanks in advance.
SamGo to www.zerog.com
Download InstallAnyWhere4now (free)
it is Awsome youll love it
M
bakbjo -
How to create report for Slow / Non moving inventory
Hi
I want to create one report Slow / Non moving inventory reports.
I need it in following form
Plant Material Desc UOM Current stock Value Last consumption date Last Movement date
I have found & confirmend table & fields names from which data should come into this report which is as follows
Plant(T001L - WERKS) Material(MARA - MATNR) Desc(MAKT - MAKTX) UOM(MARA - MEINS ) Current stock(MARD - LABST) Value(MBEW-SALK3.) Last consumption date (BUDAT - MKPF) Last Movement date(BUDAT - MKPF)
As I am creating this report at first time, I am not getting how to go ahead.
Do I need to create new datasource as existing datasource doesnt have all of these fields..
Please help me.
Dont send me links & documents which are there on sdn. I already have gone through it.
Thanks
SwatiHi
You have to create Generic Data source as you know the filed/tables names.
Hope you know how to build a Generic Delta or else.https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
Create a Generic Data Source
a). Select the Data Source type and assign a technical name to it.
b). Choose Create The screen for creating a generic Data Source appears.
3. a) Choose an application Component to which the data source is to be assigned.
b) Enter the descriptive texts. You can choose these freely.c) Choose Generic Delta.
4. Specify the delta-specific field and the type for this field. Maintain thesettings for the generic delta:
Specify a safety interval. (NOTE: Safety interval should be set sothat no document is missed u2013 even if it
was not stored in the DB table whenthe extraction took place.
4. Select Delta type: New status for changed records (I.e.after-image); This can be used with Data target ODS (AIE). Additive Delta (I.e. aggregated data records) (ADD)Then choose Save.
6. After step 4, the screen of step 3 comes back. Now choose Save again. This will generate the data source. After generating the data source, you will see the Delta Update flag selected.
7. Choose Save again.
Hope it helps -
How to create tcode for modulepool program !
in the se93.....after i give tcode and press create...
which option i willl select for module pool
for report i selected the second oneActually i am trying to recreate the copy of VF01.
What i have done is
1. in se38 i have copied the SAPMV60A i.e the program for vf01...(got it from system--->status) into YVF01.
2. I have created the tcode(zvf01) as you said in se93 selecting first option.
3. When i am giving this tcode and enter it is taking me to the samescreen of VF01....BUT THERE ARE SOME PROBLEMS..
a) the display is not as good as what nomally comes in vf01...some gui problem
b)its showing a error that transaction ZVF01 missing in table T180
PLEASE HELP
THNAKS in advance -
How to create reports in java swing
I am doing an offline project for that I need to show daily report, weekly report and monthly report how to display a report in my application. Please show me with coding
ABCDERTYUIOP wrote:
I am doing an offline project for that I need to show daily report, weekly report and monthly report how to display a report in my application. Please show me with codingDownload iReport and Google for tutorials it's easy to use. -
How to create Rfc for EP system in Solution manager
Dear experts,
I am doing ChaRM configuration for my EP system ( java only).
I also configured CTS+ successfully but we want to integrate this with Chram in solman.
I have done all configuration according to standard doc for ChaRM.
But when creating project from solar_admin it is giving " NO RFC for DEP system"
so please suggest me how to create RFC for java system in Solution manager.
thanks in advance
dhirajHello,
You need to setup an ABAP communication client and system, that's done through the TMS settings:
For source system:
- CTC 1
- CTS_SYSTEM_TYPE JAVA (others for a MDM system)
- NON_ABAP_SYSTEM 1
- COMMUNICATION_SYSTEM: (SAPSID of the ABAP communication system (e.g. the domain controller))
- NON_ABAP_WBO_CLIENT (Client of the ABAP stack on which the Transport Organizer Web UI (CTS_BROWSER) is activated and will run.)
- WBO_GET_REQ_STRATEGY TAGGED
- WBO_REL_REQ_STRATEGY MANUAL
For quality and production Java system (target systems):
- CTC 1
- CTS_SYSTEM_TYPE JAVA (others for a MDM system)
- NON_ABAP_SYSTEM 1
- COMMUNICATION_SYSTEM: (SAPSID of the ABAP communication system (e.g. the domain controller))
- DEPLOY_WEB_SERVICE CTSDEPLOY
- DEPLOY_DATA_SHARE:
When this is done correctly, you will see the fields ABAP communication system and client populated in SMSY.
When ChaRM needs to operate on the non ABAP systems, it will take the RFCs for the communication system and client.
Best regards,
Miguel Ariñ -
How to create a report with data using the Crystal Reports for Java SDK
Hi,
How do I create a report with data that can be displayed via the Crystal Report for Java SDK and the Viewers API?
I am writing my own report designer, and would like to use the Crystal Runtime Engine to display my report in DHTML, PDF, and Excel formats. I can create my own report through the following code snippet:
ReportClientDocument boReportClientDocument = new ReportClientDocument();
boReportClientDocument.newDocument();
However, I cannot find a way to add data elements to the report without specifying an RPT file. Is this possible? I seems like it is since the Eclipse Plug In allows you to specify your database parameters when creating an RPT file.
is there a way to do this through these packages?
com.crystaldecisions.sdk.occa.report.data
com.crystaldecisions.sdk.occa.report.definition
Am I forced to create a RPT file for the different table and column structures I have?
Thank you in advance for any insights.
Ted JenneyHi Rameez,
After working through the example code some more, and doing some more research, I remain unable to populate a report with my own data and view the report in a browser. I realize this is a long post, but there are multiple errors I am receiving, and these are the seemingly essential ones that I am hitting.
Modeling the Sample code from Create_Report_From_Scratch.zip to add a database table, using the following code:
<%@ page import="com.crystaldecisions.sdk.occa.report.application.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.document.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.definition.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
<%@ page import = "com.crystaldecisions.report.web.viewer.*"%>
<%
try {
ReportClientDocument rcd = new ReportClientDocument();
rcd.newDocument();
// Setup the DB connection
String database_dll = "Sqlsrv32.dll";
String db = "qa_start_2012";
String dsn = "SQL Server";
String userName = "sa";
String pwd = "sa";
// Create the DB connection
ConnectionInfo oConnectionInfo = new ConnectionInfo();
PropertyBag oPropertyBag1 = oConnectionInfo.getAttributes();
// Set new table logon properties
PropertyBag oPropertyBag2 = new PropertyBag();
oPropertyBag2.put("DSN", dsn);
oPropertyBag2.put("Data Source", db);
// Set the connection info objects members
// 1. Pass the Logon Properties to the main PropertyBag
// 2. Set the Server Description to the new **System DSN**
oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_LOGONPROPERTIES, oPropertyBag2);
oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_SERVERDESCRIPTION, dsn);
oPropertyBag1.put("Database DLL", database_dll);
oConnectionInfo.setAttributes(oPropertyBag1);
oConnectionInfo.setUserName(userName);
oConnectionInfo.setPassword(pwd);
// The Kind of connectionInfos is CRQE (Crystal Reports Query Engine).
oConnectionInfo.setKind(ConnectionInfoKind.CRQE);
// Add a Database table
String tableName = "Building";
Table oTable = new Table();
oTable.setName(tableName);
oTable.setConnectionInfo(oConnectionInfo);
rcd.getDatabaseController().addTable(oTable, null);
catch(ReportSDKException RsdkEx) {
out.println(RsdkEx);
catch (Exception ex) {
out.println(ex);
%>
Throws the exception
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed
There was other sample code on SDN which suggested the following - adding the table after calling table.setDataFields() as in:
String tableName = "Building";
String fieldname = "Building_Name";
Table oTable = new Table();
oTable.setName(tableName);
oTable.setAlias(tableName);
oTable.setQualifiedName(tableName);
oTable.setDescription(tableName) ;
Fields fields = new Fields();
DBField field = new DBField();
field.setDescription(fieldname);
field.setHeadingText(fieldname);
field.setName(fieldname);
field.setType(FieldValueType.stringField);
field.setLength(40);
fields.add(field);
oTable.setDataFields(fields);
oTable.setConnectionInfo(oConnectionInfo);
rcd.getDatabaseController().addTable(oTable, null);
This code succeeds, but it is not clear how to add that database field to a section. If I attempt to call the following:
FieldObject oFieldObject = new FieldObject();
oFieldObject.setDataSourceName(field.getFormulaForm());
oFieldObject.setFieldValueType(field.getType());
// Now add it to the section
oFieldObject.setLeft(3120);
oFieldObject.setTop(120);
oFieldObject.setWidth(1911);
oFieldObject.setHeight(226);
rcd.getReportDefController().getReportObjectController().add(oFieldObject, rcd.getReportDefController().getReportDefinition().getDetailArea().getSections().getSection(0), -1);
Then I get an error (which is not unexpected)
com.crystaldecisions.sdk.occa.report.lib.ReportDefControllerException: The field was not found.---- Error code:-2147213283 Error code name:invalidFieldObject
How do I add one of the table.SetDataFields() to my report to be displayed?
Are there any other pointers or suggestions you may have?
Thank you
Maybe you are looking for
-
So the site is www.fulcrumcwi.com and the page URL is: FulcrumCWI Rebecca Morgan Operations Strategy Consulting Newsletters. if you choose the first HTML link to the current newsletter when you try to use the close buttons neither of them work. Yet
-
Check-In not locked for structure element in SOLMAN_DIRECTORY
Hi, In the solution manager, as a pre-requisite of the one of the upgrade project, all the BPS nodes should be checked in the solution directory. But we are not able to check in . Getting below error message. " Check-In not locked for structure ele
-
Can I disable Fill & Sign toolbar?
The latest 11.0.09 release of Reader by default opens the Fill & Sign toolbar on any PDF with fillable forms. My web application makes heavy use of embedded PDFs and fillable forms, but I do not want the toolbar to appear. I cannot seem to find any
-
How to set java.library.path form code
I'm new to JNI. I see there are several ways to set JVM to look for libraries dll, so, etc. System.setProperty("java.library.path", "."); System.loadLibrary("hello");That's when UnsatisfiedLinkError java.lang.UnsatisfiedLinkError: no hello
-
Hello, i have vi that was writen on Windows2000 with screen settings size X*Y. How can i do that same vi on another computer with different screen settings will be seen as on original computer (include all objects). P.S.: VI Property Window Size (Mai