Two iteration in a report or a subreport in a subreport
Post Author: Juri
CA Forum: JAVA
Hello!I'm not using database directly, instead I'm using POJO datasource. I need to display a table with many fields inside a table. How is it possible to iterate inside iteration?My solution was to create a one big table:| table1-name | table2-field1 | table2-field2 | table2-field3 | table3-field1 | table3-field2 | table3-field3 | Then I grouped by table1-field1 and in the group I have outputed table2-field1 | table2-field2 | table2-field3.I could create a second iteration in a subreport, then I decided to create a formula that hides values:suppress if not defined table2-field1suppress if not defined table2-field2suppress if not defined table2-field3 Is there any other way?
We cant read your situation or your mind, so when you are posting put more info that helps to suggest.
Use Filter icon to filter, if required use Advanced button->select 'Convert this filter to SQL' that helps.
If it works pls mark
Similar Messages
-
Two commands in the report using the same parameter - fail under Java
I have a report that contains 2 SQL commands.
Both of these commands use one parameter X of type Number in their 'WHERE' clause.
When i'm viewing the report in CR 2008, i'm asked for a value of this parameter and all data is filled in the report - OK
The problem occurs when the same report is printed through Crystal Java Runtime:
Report is printed without data! - it's empty.
What we noticed in the debug information thrown by the Crystal libraries is that parameter value is set only in one of these commands:
Original statement 1:
select a.something
from ANM_T a
where a.anmid = {?PARAMETER01Id}
Original statement 2:
SELECT * from ANM_T a
WHERE a.anmid={?PARAMETER01Id}
OUTCOME of Statement 1:
select a.something
from ANM_T a
where a.anmid = 0
OUTCOME of Statement 2:
SELECT * from ANM_T a
WHERE a.anmid=9825
In above example we may see that crystal set the value only in the second statement - first one got 0 - i suspect its some default value.
Parameter in the Java code is set in the right way. In case of using only one statement it works. If we use two separate parameters (whose values are equal ) it also works.
// we have also the loop over the parameters
ParameterFieldController paramFieldController =
report.getDataDefController().getParameterFieldController();
paramFieldController.setCurrentValue( "", paramName, paramValue );
What is strange for me is that Crystal Reports enables to use the same parameter in two commands but if you edit one of them you may change the type of this parameter for a command ( for example from Number to String) but the parameter type in the second command remains unchanged ( it's strange because in my opinion it is the same parameter). In the Field Explorer under the Parameter Fields i still see one parameter of type used in the second command.Hello all,
We have prepared some sample code to illustrate the issue.
We have modified the sample application (Link: [http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/c07fec3e-3e11-2c10-1991-8c0fb0b82b75]) to that it also changes the parameter value. Parameter is used in two commands saved in report.
The code changing the parameters value looks like this:
private static void changeParameters(ReportClientDocument reportClientDoc) throws ReportSDKException {
DataDefController dataDefController = reportClientDoc.getDataDefController();
Fields fields = dataDefController.getDataDefinition().getParameterFields();
for( int i = 0; i < fields.size(); i++ ){
Field field = (Field)fields.getField( i );
if( field.getKind() == FieldKind.parameterField ){
setParameter( ((ParameterField)field).getName(), "9825" , reportClientDoc);
private static void setParameter( String paramName, String paramValue, ReportClientDocument document ) throws ReportSDKException {
ParameterFieldController paramFieldController =
document.getDataDefController().getParameterFieldController();
paramFieldController.setCurrentValue( "", paramName, paramValue );
We have tried the following codes to change the connection info used in commands:
Attempt 1
Tables tables = databaseController.getDatabase().getTables();
//Set the datasource for all main report tables.
for (int i = 0; i < tables.size(); i++) {
ITable table = tables.getTable(i);
//Keep existing name and alias.
table.setName(table.getName());
table.setAlias(table.getAlias());
//Change connection information properties.
IConnectionInfo connectionInfo = table.getConnectionInfo();
//Set new table connection property attributes.
connectionInfo.setAttributes(propertyBag);
//Set database username and password.
//NOTE: Even if these the username and password properties don't change when switching databases, the
//database password is *not* saved in the report and must be set at runtime if the database is secured.
connectionInfo.setUserName(DBUSERNAME);
connectionInfo.setPassword(DBPASSWORD);
connectionInfo.setKind(ConnectionInfoKind.SQL);
table.setConnectionInfo(connectionInfo);
//Update old table in the report with the new table.
databaseController.setTableLocation(table, tables.getTable(i));
//databaseController.setTableLocation(tables.getTable(i), table);
Attempt 2
newConnectionInfo.setAttributes(propertyBag);
connectionInfo.setUserName(DBUSERNAME);
connectionInfo.setPassword(DBPASSWORD);
//preserve subreport links
SubreportController src = doc.getSubreportController();
Map<String, SubreportLinks> linkMapper = new HashMap<String,SubreportLinks>();
for(String subreportName : src.getSubreportNames()){
linkMapper.put(subreportName,
(SubreportLinks) src.getSubreportLinks(subreportName).clone(true));
//If this connection needed parameters, we would use this field.
Fields<IParameterField> pFields = doc.getDataDefController().getDataDefinition().getParameterFields();
replaceConnectionInfos(doc.getDatabaseController(), newConnectionInfo, pFields);
IStrings strs = src.getSubreportNames();
Iterator<String> it = strs.iterator();
while (it.hasNext()) {
String name = it.next();
ISubreportClientDocument subreport = src.getSubreport(name);
pFields = subreport.getDataDefController().getDataDefinition().getParameterFields();
replaceConnectionInfos(subreport.getDatabaseController(), newConnectionInfo, pFields);
//reconnect subreport links since when using replaceConnection links are erased
for(String subreportName : src.getSubreportNames())
src.setSubreportLinks(subreportName, linkMapper.get(subreportName));
private static void replaceConnectionInfos(DatabaseController aDc, IConnectionInfo aNewConnInfo, Fields<IParameterField> aParameterField) throws ReportSDKException {
ConnectionInfos cis = aDc.getConnectionInfos(null);
for (IConnectionInfo oldConnInfo : cis)
aDc.replaceConnection(oldConnInfo, aNewConnInfo, aParameterField, DBOptions._useDefault
+ DBOptions._doNotVerifyDB);
In both cases, the observed problem occurred. In one query the parameter was set properly, while on the other it was set to 0 (or empty string in case of string parameters). What is more, no data appeared on the print.
Do you happen to know the reason of this issue?How can we fix the problem?
Best regards
Mateusz Błaż -
Two problmes between Crystal Reports 2008 and Bex Query
Hi Gurus.
I have two problems with Crystal Reports 2008 when It obtains data from a Bex Query (SAP MDX query connection).
1) I have defined some Parameters Fields using the follow options:
Type: String
List of Values: Dynamic
Value Options Level1:
Show on (Viewer) Panel :Editable
Prompt text: <text>
Sort Order: Ascending by value
Prompt With description Only : False
Optional Prompt: True
Allow multiple values: True
Allow discrete values: True
Allow range values: False
When I execute the report with the client of Crystal Reports 2008 (the developer tool), in the initial screen shows a list box where I can select the values from the left box and add it to the left box (as a usually filter). When the number of options (LOV) is more than the maximum of the system, I have a input box bellow the list box, where I can insert any value (manually) and a button to insert it into the left box. When I publish the Report in the infoview, this filter is modified and the input box where I can introduce manually values is not showed and I can insert only the values showed in the list box, it causes that I can`t select a lot of values that is in the master data of SAP BW, because they arenu2019t listed in the list box.
There is any option to ability this option in the infoview.
2) My Bex query, have a date filter with variable in the restricted key figures, when I execute a Crystal Reports, the infoview (and the Crystal Reports 2008 designer) ask me 2 times the same date, first only the date and second the date and the rest of parameters (introduced in the report of Crystal Reports).
Why I need insert the date 2 times? How can I modify the Crystal Report for ask me only one time all the parameters?.
Thanks.Hi Abhilash.
Thank you for your information.
1) Yes, the parameters are created in the Crystal Reports designer. I have created the parameters in the Crystal Report because I use the same Bex Query to create some Crystal Report, in other case, I will need create some Bex Query.
2)The Bex query has the date filters and I have created some filters in Crystal Reports designer, the date filter from the Bex query is created automatically in the Crystal Report Designer but I don't use it, I haven't created it anytime. I use my filters only in the record selection. The date filters from the Bex query is showed as Static, and I can`t delete it, if I modify the parameter to dynamic or static with values, at first step ask me again static without values and the second step of the report execution ask me the parameter as I have defined in Crystal Reports Designer, my parameters fields are dynamic. A lot of reports have subreport, but I have created one of them without subreport (to trial) and the Crystal Reports ask me the date filters at first execution, and when I insert the date filters, in the second step, ask me the date filters again and my parameters fields again.
Thank you again. -
Crystal Reports for Eclipse and CR2008 with subreports
SQL-Server 2005
CR 2008, Ver.12.0.0.683
Crystal Reports for Eclipse Plug-in Details:
all Plug-in-files from Business Objects have the version 12.2.200.r454
I create a report with subreports in CR2008. It's running perfect.
When I load this report with subreports to Eclipse I can see the subreports in the report and I can click into the subreports. Each subreport is working in Preview, but when I want to preview the whole report with the subreports I get a black screen and the error
eclipse.buildId=M20080911-1700
java.version=1.6.0_11
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Fri Feb 06 08:13:34 CET 2009
Unknown Error (java.lang.NullPointerException)
Info
Fri Feb 06 08:13:34 CET 2009
Plug-in Info: Business Objects, an SAP company - 12.2.200.r454
java.lang.NullPointerException
at com.crystaldecisions.reports.queryengine.QueryInfo.wF(Unknown Source)
at com.crystaldecisions.reports.datafoundation.DFQuery.if(Unknown Source)
at com.crystaldecisions.reports.datafoundation.DFQuery.a(Unknown Source)
at com.crystaldecisions.reports.datafoundation.DFQuery.int(Unknown Source)
at com.crystaldecisions.reports.datalayer.a.do(Unknown Source)
at com.crystaldecisions.reports.dataengine.m.l(Unknown Source)
at com.crystaldecisions.reports.dataengine.m.b(Unknown Source)
at com.crystaldecisions.reports.dataengine.j.b(Unknown Source)
at com.crystaldecisions.reports.dataengine.m.o(Unknown Source)
at com.crystaldecisions.reports.dataengine.m.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.ContextNode.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.ContextNode.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.j.case(Unknown Source)
at com.crystaldecisions.reports.dataengine.h.<init>(Unknown Source)
at com.crystaldecisions.reports.dataengine.DataContext.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.DataProcessor2.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.DataProcessor2.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.DataProcessor2.new(Unknown Source)
at com.crystaldecisions.reports.dataengine.DataProcessor2.try(Unknown Source)
at com.crystaldecisions.reports.dataengine.DataProcessor2.int(Unknown Source)
at com.crystaldecisions.reports.dataengine.DataProcessor2.I(Unknown Source)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.fm(Unknown Source)
at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.if(Unknown Source)
at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.a(Unknown Source)
at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.Y(Unknown Source)
at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.moveToPageN(Unknown Source)
at com.crystaldecisions.reports.formatter.formatter.lightmodel.FCMPageFormatter.goToPage(Unknown Source)
at com.businessobjects.crystalreports.designer.core.elements.formatted.MultiPageModel.B(Unknown Source)
at com.businessobjects.crystalreports.designer.core.elements.formatted.MultiPageModel.A(Unknown Source)
at com.businessobjects.crystalreports.designer.core.elements.formatted.FormattedPages$2.A(Unknown Source)
at com.businessobjects.crystalreports.designer.core.elements.formatted.FormattedPages$2.call(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing.A(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing.syncExecute(Unknown Source)
at com.businessobjects.crystalreports.designer.core.elements.formatted.FormattedPages.create(Unknown Source)
at com.businessobjects.crystalreports.designer.core.elements.formatted.FormattedDocumentModeller.getValidFormattedPages(Unknown Source)
at com.businessobjects.crystalreports.designer.core.elements.formatted.FormattedDocumentModeller$3.doWork(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityTask.run(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.runSubtask(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityProgressAwareRunnable.runSubtask(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.doWork(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$_B.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Any good ideas?
Thanks in advance.
Regards
JensHi Ted,
the error happens in the preview of the main report. Each subreport preview in this main report is running.
Regards
Jens
Edited by: Jens Kutsche on Feb 9, 2009 8:48 AM
The preview of the main report is running in CR2008.
Edited by: Jens Kutsche on Feb 9, 2009 8:56 AM
When I start this main report with a jsp I get the same error:
java.lang.NullPointerException -
How to add two columns in OBIEE report?
Hi to All,
Can anyone tell me how to add two columns in OBIEE report and get that result in a new column?
Thanks in Advance,
ThenmozhiAssume you already have two columns SalesAmt1 and SalesAmt2, and you want to derive 3rd column say SalesAmt3 which would be the sum of SalesAmt1 and SalesAmt2.
For this, as I mentioned above pull SalesAmt1 and SalesAmt2 columns in Report. Now pull another column (say SalesAmt1) and open the fx. Clear the contents of fx. Now locate the columns button in the bottom of the fx. From Here, first select SalesAmt1 and + sign and the select SalesAmt2.
Now in this new column, the fx should look like SalesAmt1 + SalesAmt2.
Let me know if you are looking for something else.
Thanks -
How to get relationship between two views in the reports
How to get relationship between two views in the reports, I am doing a deletion program , it is fully relates to views , how to get relationship between them in the reports
Hi,
Please explain your question in detail...what do you want to read ?
If you want to know about the navigation links between the views then you can use APIs like
wdComponentAPI.getComponentInfo().findInWindows("windowName").getViewUsageByID("Name").getNavigationLinks();
Iterate through the navigationLinkInfo from above collection and can read the other properties .
I haven't tried the above , but it should work !!!
Regards,Anilkumar -
Hi,
I would like to compare two dates on a report.
I would like to compare the opportunity created date and the opportunity modified date. I can't use this formula CASE WHEN Opportunity."Last Modified" = Opportunity."Created Date" then 1 else 0
I think I have to use TIMESTAMPDIFF but I don't know which interval I have to put to analyze the entire date in this format 31/12/1999 16:49:08
Thanks a lot for your help
Regards,Hi !
It depends on the interval you need to compare these dates. If you want to know the number of days between these dates, you'll have to use SQL_TSI_DAY as interval. If it's minutes, you'll need SQL_TSI_MINUTE...
Here are the possible intervals :
*SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY, SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, or
SQL_TSI_YEAR*
Hope this will help, feel free to ask more !
Max -
I have a requirement where I have two queries giving two different outputs, I want these two in one single report with two layouts, I was able to achieve this with Concatenate option and there by build by RTF templates based on the Groups of each query, The problem I found is the performance because everytime view is hit by choosing the required report layout both the queries are running and ther by affecting performance, Is there anyway that when I choose the layout only the query related to that layout is run and other when I choose the other layout?
RegardsHi Srini,
Thanks for your response!
I am not using my "back button".
Clicking the report first time in a session (or viewing the report after modifying it) opens "html" and next time onwards it opens last selected template layout and output format. I am not sure whether this is a bug or intended behavior.
Thanks,
Ashok -
Grouping two sections in one report
Hello,
I am newbie to Crystal Reports.I have one doubt in designing a report.
The proto for the report is:
Date: XX:XX:XXXX
Sales Report - Value
S No Item Increase Decrease
1 XXX
2 YYY
Sales Report - Volume
S No Item Increase Decrease
1 XXX
2 YYY
Here, there is a hyperlink in Item in both Value Report and Volume Report, which opens a subreport about the item.
How can i proceed the proto. It is easy to group an item if it is only Sales - Value Report.
Here, both Value and Volume report should present in main report.How can i proceed with Sales Report - Value and Sales Report - Volume in a single report file, without subreport concept.
If i use the subreport here, i am not able to include a subreport- hyperlink in Item.
Thanks in advance.
With Regards,
Suresh M.In the main report insert a group on Value and in group footer place a subreport that consist of data under Volume group. Pass the Volume field value from main report to subreport using change subreport links by right clicking the subreport.
Regards,
Raghavendra -
How to display two lables in alv report
Is there any chance to display two lables in alv report
for example..
AMOUNT
Rs | Ps
|
like that this for an example.
thanks,
JBHai Babu
Go through the following Code
using Classes & Methods
try with the following Code( Just copy the code & try with in SE38 Tcode & Execute it that all)
REPORT ZALV_SALES_HEADER_DETAIL MESSAGE-ID Z50650(MSG) .
TABLES
TABLES: VBAK . "SALES DOCUMENT HEADER
DATA OBJECTS DECLARATION
DATA: IT_VBAK TYPE STANDARD TABLE OF ZVBAK_STRUC,
IT_VBAP TYPE STANDARD TABLE OF ZVBAP_STRUC,
GS_LAYOUT TYPE LVC_S_LAYO,
GS1_LAYOUT TYPE LVC_S_LAYO,
GRID TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
VBAK_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
VBAP_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
WA_VBAK LIKE LINE OF IT_VBAK,
WA_VBAP LIKE LINE OF IT_VBAP,
SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
TOP_OF_PAGE_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
GRID_VBAP TYPE REF TO CL_GUI_ALV_GRID,
TOP_PAGE TYPE REF TO CL_DD_DOCUMENT,
FLAG(1).
*"EVENT RECIEVER CLASS DEFINITION
CLASS LCL_EVENT_RECIEVER DEFINITION DEFERRED.
DATA: OBJ_EVENT TYPE REF TO LCL_EVENT_RECIEVER.
SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN: END OF BLOCK B1.
CLASS DEFINITION AND DECLARATIONS
CLASS LCL_EVENT_RECIEVER DEFINITION.
PUBLIC SECTION.
EVENTS:DOUBLE_CLICK,
TOP_OF_PAGE.
METHODS:HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW .
METHODS: HANDLE_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID.
ENDCLASS. "LCL_EVENT_RECIEVER DEFINITION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION.
METHOD: HANDLE_DOUBLE_CLICK.
READ TABLE IT_VBAK INDEX E_ROW-INDEX INTO WA_VBAK.
PERFORM FETCH_ITEM_DETAILS USING WA_VBAK.
PERFORM ALV_GRID.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
METHOD: HANDLE_TOP_OF_PAGE.
CALL METHOD TOP_PAGE->ADD_TEXT
EXPORTING
TEXT = 'SALES HEADER & ITEM DETAILS'.
CALL METHOD TOP_PAGE->DISPLAY_DOCUMENT
EXPORTING
PARENT = TOP_OF_PAGE_CONTAINER.
ENDMETHOD. "HANDLER_TOP_OF_PAGE
ENDCLASS. "LCL_EVENT_RECIEVER IMPLEMENTATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
IF S_VBELN IS NOT INITIAL.
SELECT COUNT(*)
FROM VBAK
WHERE VBELN IN S_VBELN.
IF SY-DBCNT = 0.
MESSAGE E000 WITH 'NO TABLE ENTRIES FOUND FOR LOW KEY SPECIFIED'.
ENDIF.
ENDIF.
START-OF-SELECTION.
START-OF-SELECTION.
PERFORM FETCH_SALES_HEADER_RECORD.
PERFORM CREATE_CALL. "CREATION OF OBJECTS & CALLING METHODS
END-OF-SELECTION.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form FETCH_SALES_HEADER_RECORD
text
--> p1 text
<-- p2 text
FORM FETCH_SALES_HEADER_RECORD .
SELECT
VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE IT_VBAK
WHERE VBELN IN S_VBELN
AND VBTYP = P_VBTYP.
ENDFORM. " FETCH_SALES_HEADER_RECORD
*& Form CREATE_CALL
text
--> p1 text
<-- p2 text
FORM CREATE_CALL .
IF CUSTOM_CONTAINER IS INITIAL.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = 'CUSTOM_CONTAINER'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 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.
CREATE OBJECT SPLITTER
EXPORTING
TOP = 5
PARENT = CUSTOM_CONTAINER
ROWS = 3
COLUMNS = 1
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3
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 METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = TOP_OF_PAGE_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = VBAK_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 3
COLUMN = 1
RECEIVING
CONTAINER = VBAP_CONTAINER.
CREATE OBJECT GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAK_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 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.
GS_LAYOUT-GRID_TITLE = 'SALES HEADER DETAILS.'(100).
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAK_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAK
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CREATE OBJECT OBJ_EVENT .
SET HANDLER OBJ_EVENT->HANDLE_DOUBLE_CLICK FOR GRID.
SET HANDLER OBJ_EVENT->HANDLE_TOP_OF_PAGE FOR GRID.
CREATE OBJECT TOP_PAGE
EXPORTING
STYLE = 'ALV_GRID'
CALL METHOD TOP_PAGE->INITIALIZE_DOCUMENT.
CALL METHOD GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = TOP_PAGE.
CALL SCREEN 100.
ENDFORM. " CREATE_CALL
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form FETCH_ITEM_DETAILS
text
--> p1 text
<-- p2 text
FORM FETCH_ITEM_DETAILS USING WA_VBAK TYPE ZVBAK_STRUC .
SELECT
VBELN
POSNR
MATNR
MATWA
PMATN
CHARG
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN = WA_VBAK-VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO RECORDS FOUND FOR SPECIFIED KEY'.
ENDIF.
ENDFORM. " FETCH_ITEM_DETAILS
*& Module STATUS_0200 OUTPUT
text
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
text
MODULE USER_COMMAND_0200 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form alv_grid
text
--> p1 text
<-- p2 text
FORM ALV_GRID .
IF FLAG = ''.
FLAG = 'X'.
CREATE OBJECT GRID_VBAP
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAP_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 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.
ENDIF.
GS1_LAYOUT-GRID_TITLE = 'SALES ITEM DETAILS.'(100).
CALL METHOD GRID_VBAP->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAP_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS1_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAP
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " alv_grid
Thansk & regards
Sreenivasulu P -
I need two query in one report (two detail section in one query)
Hi master sorry for again distribute
Sir I need two query in one report
Because I need two detail section in my one report
Such as
Master
Vno=9088989
Detail 1
=
=
==
=
Total 99999
Detail 2
=
=
==
=
Total 33333
Sir how I get this type of report
Please give me idea
Thanking you
AamirI want to see the report as follow.
d_name: CPU-1
date: -----------
Software installed:
sw_id, software, version, serial_no, sw_type
(list of softwares attached, can be more then one)
Hardware attached:
hw_id, hardware, specification (same like software list, it will contain hardware list attached to specific device),
Please if you can help me that how will i make a query for this.
Thanks and Regards
Maz -
Comparing two dates in a report
Hello,
I am attempting to compare two dates in a report in order to format a column. My code for that portion of the report is as follows:
CASE
WHEN TO_DATE(DATE_DUE,'DD-MON-YYYY') -
TO_DATE(sysdate,'DD-MON-YYYY') <= 5 THEN
'<span class="due">'||DATE_DUE||'</span>'
ELSE
DATE_DUE
END AS DATE_DUE,I'm getting the error message ORA-00932: inconsistent datatypes: expected CHAR got DATE.
I've been trying to fix the condition to get rid of the error with no success.
Thanks
-BrianOne thing I just noticed that may or may not be the problem is that your case statement is returning two different datatypes depending on the condition. In one part, it is returning a character string of the span tags concatenated with the due_date (which in and of itself are incompatible datatypes) and the second part is returning just a date.
Again, not sure if the SQL engine will do automatic conversions for you, but this seems to jive with your "char vs. date" error. -
Can i merge two cell in BO Reports?
Hi!
I'm new to this BO. I've already posted my problem in some other place in this forum. Now, I think that may be a wrong place to post.
So, i'm posting this problem once more here.
I'm giving you that link which i've already posted (Otherwise it will be duplicate thing to post the entire content) ->
[Can i merge two cell in BO Reports?|Can i merge two cell in BO Reports?;
Sorry for this initial mess.
Waiting for your feedback.
Regards.
Satyaki De.Thanks for your reply.
But, my requirement is slightly different than what you have shown.
I've created two reports say report 1 & report 2. And, it should looks like this ->
Report 1,
YEAR QT P1 P2
2001 Q1 25
2002 Q2 13 14
Report 2,
YEAR QT P1 P2
2001 Q1 7 12
2002 Q2 10
And, my required final output should be ->
YEAR QT P1 P2
2001 Q1 7 37
2002 Q2 23 14
So, as you can see - i'm merging and adding the values of two reports into one.
I'm using Oracle 10g as my DB. Is it possible that i can write some SQL query any where in any place of the reports that can do this staff. Then i can go for that kind of solution, too.
But, in that case i need to know where to write the query. Please reply.
But, first -> Is it at all possible in BO?
Thanks again for your valuable time to read this post.
Regards.
Satyaki De. -
I have a scenario like i have two blocks in my report
I have a scenario like i have two blocks in my report.In Block 1 I have drill on Region.
Block 1:
Region Revenue
APAC 2000000$
EU 1200000$
NA 1500000$
Block2:
Country Revenue
India 6000$
China 4000$
USA 8000$
Germany 6000$
Now my requirement is when ever user click on on any region in block1
corresponding countries should appear in Block2.
SCN Moderator: Title was too long (maxed out: no replies possible)You can use Element link to have the desired results:
Here is the initial layout:
After applying Element Link, if you click on California, you will see this:
If you click on Colorado, you will see this:
Hope this helps. -
Post Author: Tony
CA Forum: .NET
I understand that in the .NET version of Crystal Reports you can't do a subreport within a subreport (one level deep only). Is this just a limitation of the version that comes with Visual Studio 2005 or is this also a limitation in the XI Developer version as well?
Thanks.As always, Dell is absolutely correct - no change. I believe there are some work-arounds described on these forums, though I don't know how good they are...
Knowing a bit on how the report engine works, I honestly doubt this will ever be implemented. The complexities, resources and so on would just be much too great. Some of the complexities to consider:
Optimal number of "print jobs" is set to 75.
Any action (paging, drilling, zoom, etc.) in the viewer is a "print job".
A subreport is a "print job". Thus a report in a detail section that returns 75 records, exceeds the optimal print job limit.
I was actually around when subreports were introduced in version 5. Many a friendship was destroyed at the time, trying to figure out how best to do this. Makes me wonder if the world would survive subreport within subreport
- Ludek
Maybe you are looking for
-
Error checking transport group configuration in System BQS
Hi Everyone, I made a client export from Production to Quality. It went successfully,, I noted the requests numbers and transported them from PRD to Quality, but while transporting there was a tp error(which i did not note), next i went to the qualit
-
Reading html files with File class
The methods of the class File does not identify html files. for example the method list() does not return names of html files in a givven directory? does anyone know what is the way to get the html files names and use them for file proccesing? Thanks
-
Writing non-latin Character to Log file from Java application
Hi Everyone, I'm encountering a very strange localization issue. I'm executing the following code from a J2EE application (although the behavior is replicated exactly from a Java console application): File testFile = new File("D:\\Temp\\blah.txt"); t
-
Problem While Installing Enterprice Protal on windows.
Hi Experts, i am installing the EP on Windows, installation has stopped in the Configuration SLD Phase. Error details are : ERROR 2011-11-02 16:50:59 CJSlibModule::writeError_impl() CJS-30059 Java EE Engine configuration error.<br>D
-
I understand that PS CS4 "is not supported" on XP-64 bit. But what exactly does that mean? I'm in a pickle here because our fastest quad core machines run XP-64 and I need to push at least a few of our PS versions up to CS4 and start learn'in. Will C