Create a Crystal report to display the sum of G/L account code within a specific period
Hi,
Just wonder is it possible to create a crystal report to display the total of a G/L account code within a specific period?
How to write the query to get the sum within a specific period?
For example:
Period: 2014-06-01-2014-06-10
Account code A: USD "TOTAL"
Account code B: USD "TOTAL"
Thanks
Hi Olga,
Please check below Query.
SELECT T1.[Account], T1.[ShortName], SUM (T1.[Debit]) as Debit, SUM (T1.[Credit]) As Credit, SUM (T1.[FCDebit]) As FCDebit, SUM (T1.[FCCredit]) As FCCredit, SUM (T1.[SYSDeb]) As SysDebit , SUM (T1.[SYSCred]) As SysCredit FROM OJDT T0 INNER JOIN JDT1 T1 ON T0.[TransId] = T1.[TransId] WHERE T1.[RefDate] >=[%3] AND T1.[RefDate] <=[%4]
Hope this Help
Regards::::
Atul Chakraborty
Similar Messages
-
Create a Crystal Report listing all the crystal reports in CMS
How do I create a Crystal Report listing out all the Crystal reports in a specific folder in CMS?
Hi Mauren,
You can each report at a time with in the folder of the CMC.
Multiple reports cannot be done and feature is not avaialable.
Thanks,
Naveen. -
Unable to create a crystal report 2013 on the top of SAP BW 7.00
Hello Team,
We are trying to connect SAP Crystal Reports 2013 to SAP BW 7.00 SP26. This crystal report is being developed on the top of a BEx query accessing through OLAP.
1. We are getting an error- 'Internal Error: The reports applicatiton server failed'.
2. Also, when we try to upload the same report from CMC, we get an error."...................Failed to read data from the report. Reason: Unable to open the OLAP Cube......."
Please advise.
Thanks.BI Platform
-Abhilash -
Report to display the contracts that are to expiry
Hi experts,
I have to create a report to display the contracts that are to expiry for a given time period.
can anybody tell me what are the tables and fields involved. the module is MM.
Thanks.Hi,
you can refer the given below link
http://www.sapgenie.com/abap/tables.htm
Thanks
Arun -
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. -
Creating a crystal report using excel
I have an excel spreadsheet that I would like to access to create a crystal reports. But it seems that I have to first save it as an access or other database file. But this information changes frequently so I it would be more efficient to access the excel file directly. I tried using the crystal wizard addin in excel, but then when I run the report I get the error message "Server has not yet been opened". Any other ideas on how to create report of excel data directly?
Hello Guys ,
I have something similar problem ,but not exactly.
our requirement is We are scheduling one crystal report to generate excel and sent to FTP location.This Excel file (in FTP) should be the input of new Crystal Report using ODBC (RDO) connection.
I am able to create the ODBC connection,but that ODBC connection is not showing me the selected excel sheet in the Crystal Report ODBC Connection.I tried with Remote as well as local drive Excel also.
I tried on different machine (thought ,it could be Driver specific),but all machines does have same issue.
Is there any settings or driver upgrades require for CR XI R2 /2008 in order to use ODBC (RDO) for EXCEL FILES.I didnt find any comments /resolution in Google too.
My steps -
1) Create a sample Excel file - only few records
2) Created a System ODBC connection pointing this excel file say "TEST1"
3) Opened A Blank Crystal Report
4) Create a New connection
5) Select ODBC RDO
6) Create new connection and selected the newly created SYSTEM DSN "TEST1"
7) check the selected excel is displayed in ODBC RDO connection??
If it is a Crystal Report issue or ODBC Driver issue ,please let me know if anyone have came across similar issues.
thanks in advance.
Nitin -
Is there a way how to create new Crystal Report template programmatically?
Hi all,
I would like to know if there is any way how to call .NET code using Crystal Reports for VS2010 to create Blank Crystal Report template with specific DataDefinition?
I want to save work with opening Crystal Reports application and manually adding DataDefinition fields which my application provides...
Thank you for your reply in advance,
Honza
Edited by: honzajic on Sep 20, 2011 3:53 PMHello Honza
You will have to use the InProc RAS SDK as this includes report creation APIs. A few resources to get you started:
[How to Use The RAS SDK .NET With In-Process RAS Server|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10b840c0-623f-2b10-03b5-9d1913866b32]
[Samples|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]
[Programming tutorial|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b050afe0-2fa5-2b10-658d-98f214ba6a4a]
[Report Application Server .NET API Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip]
[Report Application Server .NET SDK Developer Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip]
You may also find [this|http://book.soundonair.ru/sams/] website quite interesting.
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports] -
How do I assign a cell to display the sum of a column?
I am doing an expense report for the first time.
How can I create a cell to display the sum of numbers in a given column?
Can I have a cell display the sum of specific rows that contain a specific word, like "SUPPLIES"?
Thanks!JP,
The answers are to use the SUM function, and to use the SUMIF function, respectively.
Download the Formulas and Functions User Guide from the Help Menu to study how the functions work. It's free.
Jerry -
Viewing Report created in Crystal Report Designer
<p>Hi,</p><p>I'm new to CR4E and tries to work with existing report. I saw many error while trying this, please excuse me to the long email below that I explain all the errors I saw......</p><p>I have some reports that were created in Crystal Report Designer (CR XI Release 2) connecting to the Oracle Database using "Oracle Server" type connection. How can I access it from CR4E? I have the following problem (in the order I see them)</p><p>1) In the Eclipse's JSP page, I specified the full path to the report, but I get a report not found error. Must the report locate within the project? Is there any way we can open a report outside of the project?</p><p>2) I copied the report to the project, </p><p> a) followed jrc_print_report example to print the report, get "JNDI name not found" error. </p><p> b) then generate a viewer page, but I get the Driver "crdb_oracle.dll" is not supported error.</p><p>3) I setup the new JNDI followed the jrc_changedatasource.jsp example to change the datasource, but I still get the "JNDI name not found" error.</p><p>4) I imported the report intoEclipse and changed the connection. Then I can create a jsp page to print it to a printer (I still can't view it, but my goal is to print, so that's ok). However, </p><p> a) the original report has a "Command" object from the Oracle database to control where to select the report's data, when I remap, this object disappear and I cannot see how to recreate it. Any suggestion?</p><p> b) also, the report is very complex with many subreports and it will be nightmare to go in and change all of the datasource, also a maintenance nightmare to maintain two copies. Any better suggestions?</p><p>Thank you very much! Your help is very appreciated.</p><p>Celia</p>
Hi Celia
1. Yes the Java Reporting Component (JRC) which is the runtime component of the Crystal Reports for Eclipse can open reports outside the project.  Its often better to have the reports inside the project for deployment purposes but you are welcome to put the report where ever you need it.Â
Note: To use absolute paths, ensure that the CRConfig.xml file does not contain a reportlocation tag.
2. The JRC can't report off of Oracle directly, you would need to use a JDBC driver to connect your reports to Oracle. The crdb_oracle.dll will never connect because its not Java.Â
3. When the JRC finds that the report is not using a supported database driver it will do a lookup to find the name of the report datasource. When it finds the datasource name it will then do a JNDI lookup for a JDBC datasource with the same name. If your Application server doesn't have a datasource with that name it will through the error you were seeing.Â
4. I'm not sure about losing the Command object when changing the datasource but this is probably happening because the Command is linked to the database driver.
5. What you could try doing is creating a JDBC Datasource on your application server where this app will run with a JNDI name that matches your report datasource name. If your reports datasource name is "MyOracleDatasource" then I believe the JNDI name for new JDBC Datasource would have to be "jdbc/MyOracleDatasource".
You could give this a try.
Rob Horne
http://diamond.businessobjects.com/blog/10 -
Creating a Crystal Report for B1 without parameters
Hi Experts,
My question is a simple one.
I create a crystal report for SAP B1 8.8 Patch 10 using CR 2008 SP02.
I have no parameters since its showing sales figures of the past month.
But when I run the report in SAP, a selection criteria screen pops up without any fields.
Just OK and Cancel.
I dont want my users to have to click OK. I need the report to pop-up once the user click on the SAP Menu for the report.
My report file has no parameters.
Thanks for the help
DenisDeinis,
In your report, do you mean:
- you have parameter created, but not used in the report? OR
- there is no parameter field in the report at all?
The reason I am asking is:
If you have parameter fields, But, you did not use it in the report, I think when you run the report within SAP B1, it will still prompts for user to enter something.
Also, if you are using subreport, make sure there is no parameter in the subreport, Although you do not use them. Just delete the parameter field from the list if you are not using them.
Edited by: Shwu Hua Gan on Jun 20, 2010 2:59 AM -
How to create a Crystal Report to connect to Oracle
Hi,
When I create a Crystal report to connect to SQL Server, I create a stored procedure to get all data I need and connect to it from Crystal Report.(In the stored procedure, I created temp tables, used cusor etc to run data.) But now I need to use a Oracle database. I heard I need to create a package and put this stored procedure in this package. Questions:
1. if I need to create a package, how can I call the stored procedure from it?
2. Can I create temp table in this procedure too? I need to create some temp tables to join together to get complex data.
3. if I want the return data from stored procedure, do I still "select ... from ..." or there is another other ways?
I am so desperated. Please help. I know this are very silly questions. But please.Hi Jenny,
We are also using Crystal Reports for our Oracle Database, we normally just select the tables we want to use or create our own SQL query.
However, if you really want to use Oracle stored-procedure (which performs faster than a SQL query because the stored procedure is compiled in advance), you can look at this document:
http://support.businessobjects.com/communityCS/TechnicalPapers/scr_oracle_stored_procedures.pdf
Hope this will answer your questions. -
How to create a crystal Report using C# and SQL Server
Hi, im new in creating crystal report using SQL Server, and im making a project.. and could someone help me how to connect your .sdf (SQL Server File) from the bin to your crystal report? thanks a lot.. i followed some instructions like this one (https://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?forum=csharpgeneral)
but i got an error on the adding of server name and database portion.. thanks a lot in advanceHello,
Crystal Reports are supported on
http://scn.sap.com/community/crystal-reports.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}}) -
Database Logon Failed which created by Crystal Report 2008
this time i meet the famous error again which is database logon failed.
i created a crystal report 2008 starting from blank report, then connect with odbc
i use 2008 method
objRpt.SetDatabaseLogon(db_username, db_password, odbc_name, database_name);
2008 method will get database logon failed even set database location and verify database again
then i use 8.5 method and try again for 2008 report. it said field name is unknown for one of formula
then i drag field again for formula and set database location and verify database again
it said the same error.
then i uninstall 8.5 crytal report software in window 7 deployment machine, and do above again, it said the same error
//'Create a new Stored Procedure Table to replace the reports current table.
CrystalDecisions.ReportAppServer.DataDefModel.Procedure boTable = new CrystalDecisions.ReportAppServer.DataDefModel.Procedure();
//'boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
PropertyBag boMainPropertyBag = new PropertyBag();
//'boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
//'In the main property bag (boMainPropertyBag)
PropertyBag boInnerPropertyBag = new PropertyBag();
//'Set the attributes for the boInnerPropertyBag
boInnerPropertyBag.Add("Connect Timeout", "15");
//boInnerPropertyBag.Add("Data Source", "MyDataSource");
boInnerPropertyBag.Add("Data Source", "10.1.1.191");
boInnerPropertyBag.Add("DataTypeCompatibility", "0");
boInnerPropertyBag.Add("General Timeout", "0");
//boInnerPropertyBag.Add("Initial Catalog", "MyCatalog");
boInnerPropertyBag.Add("Initial Catalog", database_name);
boInnerPropertyBag.Add("Integrated Security", "False");
boInnerPropertyBag.Add("Locale Identifier", "1033");
boInnerPropertyBag.Add("MARS Connection", "0");
//boInnerPropertyBag.Add("OLE DB Services", "-5");
//boInnerPropertyBag.Add("ODBC", "-5");
boInnerPropertyBag.Add("ODBC", "Cheque");
boInnerPropertyBag.Add("Provider", "SQLNCLI");
boInnerPropertyBag.Add("Tag with column collation when possible", "0");
boInnerPropertyBag.Add("Trust Server Certificate", "0");
boInnerPropertyBag.Add("Use Encryption for Data", "0");
//'Set the attributes for the boMainPropertyBag
boMainPropertyBag.Add("Database DLL", "crdb_ado.dll");
//boMainPropertyBag.Add("Database DLL", "p2sodbc.dll");
//boMainPropertyBag.Add("QE_DatabaseName", "VEPILOT");
boMainPropertyBag.Add("QE_DatabaseName", database_name);
//boMainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)");
boMainPropertyBag.Add("QE_DatabaseType", "ODBC");
//'Add the QE_LogonProperties we set in the boInnerPropertyBag Object
boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
boMainPropertyBag.Add("QE_ServerDescription", "MyServer");
boMainPropertyBag.Add("QE_SQLDB", "True");
boMainPropertyBag.Add("SSO Enabled", "False");
//'Create a new ConnectionInfo object
CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//'Pass the database properties to a connection info object
boConnectionInfo.Attributes = boMainPropertyBag;
//'Set the connection kind
boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
//'*EDIT* Set the User Name and Password if required.
boConnectionInfo.UserName = db_username;
boConnectionInfo.Password = db_password;
//'Pass the connection information to the table
boTable.ConnectionInfo = boConnectionInfo;
CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables = objRpt.ReportClientDocument.DatabaseController.Database.Tables;
CrystalDecisions.CrystalReports.Engine.Tables tables = objRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
if (!string.IsNullOrEmpty(table.Name))
//boTable.Name = table.Name;
//boTable.QualifiedName = database_name + ".dbo." + table.Name;
//boTable.Alias = table.Name;
boTable.Name = "sp_ChequeIssueDetRpt";
boTable.QualifiedName = database_name + ".dbo.sp_ChequeIssueDetRpt";
boTable.Alias = "sp_ChequeIssueDetRpt";
objRpt.ReportClientDocument.DatabaseController.SetTableLocation(boTables[0], boTable);
objRpt.VerifyDatabase();
http://sourceforge.net/projects/aspchequesprint/files/ChequeIssueDet.rpt/downloadNo subreport, only a stored procedure with final two lines are
print @m_sql
exec (@m_sql)
After use generated code in the link above
Error at boReportDocument.VerifyDatabase();
Inner Exception : no error
Message "Logon failed"
ErrorID : CrystalDecisions.CrystalReports.Engine.EngineExceptionErrorID.LogOnFailed
HelpLink : null
stacktrace : CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()\r\n at viewReport.Page_Load(Object sender, EventArgs e) 於 d:
Data
My Documents
Visual Studio 2008
WebSites
Cheques
viewReport.aspx.cs: row 1302\r\n at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n 於 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
TargetSite : {Void VerifyDatabase()}
string reportPath = report_path + "ChequeIssueDet.rpt";
boReportDocument = new ReportDocument();
//**EDIT** Change the path and report name to the report you want to change.
boReportDocument.Load(reportPath, OpenReportMethod.OpenReportByTempCopy);
//Create a new Stored Procedure Table to replace the reports current table.
CrystalDecisions.ReportAppServer.DataDefModel.Procedure boTable =
new CrystalDecisions.ReportAppServer.DataDefModel.Procedure();
//boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
PropertyBag boMainPropertyBag = new PropertyBag();
//boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
//In the main property bag (boMainPropertyBag)
PropertyBag boInnerPropertyBag = new PropertyBag();
//Set the attributes for the boInnerPropertyBag
boInnerPropertyBag.Add("Database", database_name);
boInnerPropertyBag.Add("DSN", "Cheque");
boInnerPropertyBag.Add("UseDSNProperties", "False");
//Set the attributes for the boMainPropertyBag
boMainPropertyBag.Add("Database DLL", "crdb_odbc.dll");
boMainPropertyBag.Add("QE_DatabaseName", database_name);
boMainPropertyBag.Add("QE_DatabaseType", "ODBC (RDO)");
//Add the QE_LogonProperties we set in the boInnerPropertyBag Object
boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
boMainPropertyBag.Add("QE_ServerDescription", "Cheque");
boMainPropertyBag.Add("QE_SQLDB", "True");
boMainPropertyBag.Add("SSO Enabled", "False");
//Create a new ConnectionInfo object
CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo =
new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//Pass the database properties to a connection info object
boConnectionInfo.Attributes = boMainPropertyBag;
//Set the connection kind
boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
//**EDIT** Set the User Name and Password if required.
boConnectionInfo.UserName = db_username;
boConnectionInfo.Password = db_password;
//Pass the connection information to the table
boTable.ConnectionInfo = boConnectionInfo;
//Get the Database Tables Collection for your report
CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables;
boTables = boReportDocument.ReportClientDocument.DatabaseController.Database.Tables;
//For each table in the report:
// - Set the Table Name properties.
// - Set the table location in the report to use the new modified table
boTable.Name = "sp_ChequeIssueDetRpt;1";
boTable.QualifiedName = database_name+".dbo.sp_ChequeIssueDetRpt;1";
boTable.Alias = "sp_ChequeIssueDetRpt;1";
boReportDocument.ReportClientDocument.DatabaseController.SetTableLocation(boTables[0], boTable);
//Verify the database after adding substituting the new table.
//To ensure that the table updates properly when adding Command tables or Stored Procedures.
boReportDocument.VerifyDatabase();
//**EDIT** Set the value for the Stored Procedure parameters.
string m_curUser = "";
int spid = Convert.ToInt32(Request.Cookies["login_cookie"]["spid"]);
queryString = "select * from v_All_Session where SPID=" + spid.ToString();
//string _connectionString = ConfigurationManager.ConnectionStrings["ChequeConnectionString"].ConnectionString;
using (SqlConnection connection = new SqlConnection(_connectionString))
SqlCommand command = connection.CreateCommand();
command.CommandText = queryString;
connection.Open();
using (SqlDataReader datareader = command.ExecuteReader())
if (datareader.HasRows == true)
while (datareader.Read())
if (datareader["UserID"] != System.DBNull.Value)
m_curUser = datareader["UserID"].ToString();
datareader.Close();
connection.Close();
boReportDocument.SetParameterValue("@UserID", m_curUser);
if (string.IsNullOrEmpty(Session["fm_CoCode"].ToString()))
boReportDocument.SetParameterValue("@fm_CoCode", Session["fm_CoCode"].ToString());
if (string.IsNullOrEmpty(Session["to_CoCode"].ToString()))
boReportDocument.SetParameterValue("@to_CoCode", Session["to_CoCode"].ToString());
if (string.IsNullOrEmpty(Session["fm_BankACNo"].ToString()))
boReportDocument.SetParameterValue("@fm_BankACNo", Session["fm_BankACNo"].ToString());
if (string.IsNullOrEmpty(Session["to_BankACNo"].ToString()))
boReportDocument.SetParameterValue("@to_BankACNo", Session["to_BankACNo"].ToString());
if (string.IsNullOrEmpty(Session["fm_BatchNo"].ToString()))
boReportDocument.SetParameterValue("@fm_BatchNo", Session["fm_BatchNo"].ToString());
if (string.IsNullOrEmpty(Session["to_BatchNo"].ToString()))
boReportDocument.SetParameterValue("@to_BatchNo", Session["to_BatchNo"].ToString());
Edited by: Mathew_666 on Jul 19, 2011 4:27 AM
Edited by: Mathew_666 on Jul 19, 2011 4:28 AM -
Using Jsp to create a crystal report
Hi,
I am using Jsp to create a crystal report from an oracle database.To create a new report document,i am using the ReportClientDocument class in the
"com.crystaldecisions.sdk.occa.report.application.ReportClientDocument " package.
I am using this code:
ReportClientDocument rpt=new ReportClientDocument ();
rpt.newDocument();The report application server running on my machine does not support this.
I have to use an IReportAppFactory interface method which is part of the package com.crystaldecisions.sdk.occa.managedreports.*,, in order to create a new report document.Can anbody help be know how to use this interface in a Jsp??
Any help would be appreciated.
Thanks,<p>Hi Tim,</p><p> For security reasons we do not save the database password with the report. There are a few ways to solve what you are trying to do:</p><ol><li>Use the Create Viewer JSP page wizard to auto-generate the code. You will need to use the API option and select the option to <strong>"Log on to existing data connections" </strong>as well as the option to <strong>"Connect the CrystalReportPageViewer" </strong>(Note: I suspect that the reason you had a blank page the first time you tried this is because you did not have an Output option selected) <br /><br />The code that is generated will provide you with the ability to pass in the database authentication and then launch the report in the viewer.<br /><br /></li><li>The other option is to use a JNDI Connection at runtime. If you setup a JNDI Data Source you should have the ability to store the database authentication with the Data Source. To have the report use a JNDI connection at runtime you will need to set the name of the JNDI Data Source using the Properties View of the database in the Report Designer.</li></ol><p>Anyway, give this a shot and let me know how you make out.</p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <strong><a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a></strong> </p>
-
Display the Sum in the break header
Is it possible to display the Sum in the break header instead of the breaker footer? Thanks.
You can put a sum calculation anywhere you want. Insert a cell, and copy (or move) the existing sum formula into your newly created cell(s). If you stay within the block (table) then the numbers will stay the same. If you move outside the block (into a stand-alone cell, for example) then you may have to set the context of the calculation.
Note that a running total may return different results than a standard total, which makes sense.
Maybe you are looking for
-
Communication problem between air application from swf at browser
Hi, I am trying to communicate adobe air native application from brwser using swf, I check for native application installed or not. If installed then launch and if not then install and launch. I am facing problem when browser crashes and communicatio
-
I recently updated and restored my Iphone on a Mac. My music was erased, therefore, I am trying to sync all of the music from my computer into the iPhone, but it says that I need to use the original computer/itunes in order to sync, but it is the sam
-
Hi All, Animated gif seems to have an issue in flex. seemingly a swf will solve the problems. Does anyone have a swf corresponding to the progress indicator? Any help will be highly appreciated. Thanks Yukti
-
Connect via Windows Powershell in SCCM 2012 CONSOLE (with PowerShell 4.0 installed)
Hi, When trying to "Connect via Windows Powershell" in the SCCM 2012 console, I get the message that Powershell 3.0 is not installed... (which actually isn't installed, we have PS4.0 installed). Do we need to install PS3.0 also to get it working or i
-
Receive connector to allow relay for localhost
I have set up a relay receive connector to allow anonymous relay from another exchange server (send mails with Send-MailMessage cmdlet ) and it works just fine, but trying to send same mail from localhost falls into default receive connector and retu