Solved

Print Manager error message An item with the same key has already been added.


Userlevel 6
Badge +13

I’m getting an error in Print Manager, (An item with the same key has already been added) but the report is still printing. What would cause this? If i print through ‘Order Report’ I don’t get the error. I ger the error if I print using  RMB sql action or when I print using an event trigger sql action. It happens now on two different reports with different views. Has anybody else seen this error when printing?

Thank you,

icon

Best answer by arebbeadle 16 June 2023, 16:41

View original

14 replies

Userlevel 7
Badge +18

Hi @arebbeadle,

I believe you are using a custom menu to order the report? Could you please attach a screenshot of how you are trying to print the report when you receive the error? Also, please let us know your application version and the update version as well.

 

Userlevel 6
Badge +13

We are using IFSAPPS 10 Update 11,

This is the menu SQL

 

DECLARE 
result_key_ Number; 
pr_attr_ varchar2(2000); 
attr_ varchar2(2000);
report_id_ varchar2(2000);
job_id_ number; 
par_attr_ varchar2(2000);
XSO varchar(12):= &ORDER_NO;
XREL varchar(4):= &RELEASE_NO;
XSEQ varchar(4):= &SEQUENCE_NO;
site_ varchar2(5):= &CONTRACT;
BEGIN 
report_id_ := 'ARE_PART_ORDER_INFO_TAG_REP';
Client_SYS.Add_To_Attr('PRINTER_ID', 'DD1REARDOOR',pr_attr_);
Client_SYS.Add_To_Attr('EXPIRE_DATE',sysdate+30,pr_attr_);
Print_Job_API.New(job_id_,pr_attr_);
Client_SYS.Add_To_Attr('REPORT_ID',report_id_,pr_attr_);
Client_SYS.Add_To_Attr('LAYOUT_NAME', 'DD1_RearDoorLabel_2022.rpt', pr_attr_);
Client_SYS.Clear_Attr(par_attr_);
Client_SYS.Add_To_Attr('CONTRACT', site_,par_attr_);
Client_SYS.Add_To_Attr('ORDER_NO', XSO,par_attr_);
Client_SYS.Add_To_Attr('REL_NO', XREL,par_attr_);
Client_SYS.Add_To_Attr('LINE_NO', XSEQ, par_attr_);
Archive_API.New_Instance(result_key_,pr_attr_,par_attr_);
Client_SYS.Clear_Attr(attr_);
Client_SYS.Add_To_Attr('PRINT_JOB_ID', job_id_, attr_);
Client_SYS.Add_To_Attr('RESULT_KEY', result_key_, attr_);
Print_Job_Contents_API.New_Instance(attr_);
Print_Job_API.Print(job_id_);
commit;
END;

Userlevel 7
Badge +18

Hi @arebbeadle,

Could you please try the following and see if that resolves the issue?

 

a. Close all opened IFS applications.
b. Open a command prompt and execute the below command.
c. rundll32 dfshim CleanOnlineAppCache
d. Restart the user’s PC

 

Userlevel 6
Badge +13

Hi Himasha,

The command line process did not resolve the issue.

 

Userlevel 7
Badge +18

Hi @arebbeadle,

Could you please run the sql in the attached document to see what the outcome is?

 

Userlevel 6
Badge +13

Himasha,

Thank you but I don’t see how this script will help. It states- Purpose:    This script lists custom menus with action type 'Create Window with Transfer' where 'Source Key Name' of Key Translations are duplicated.

 

My custom menu is creating a Print job executing a SQL script not a 'Create Window with Transfer'. Will it still help to run the script?

 

Userlevel 7
Badge +18

Hi @arebbeadle,

 

Since you are getting the error ‘An item with the same key has already been added.’, the script will help you in identifying the duplicated source key names. Please ignore the action type stated there as this is something we reuse and the outcome is not filtered with the action type. 

 

Userlevel 6
Badge +13

Ok, I will run the script and post results if possible.

Userlevel 6
Badge +13

 

I attached the log but it has errors. We are running APPS10 UPD 11.

 

      FROM custom_menu_key_trans_tab t,custom_menu_tab m
                                       *
ERROR at line 4:
ORA-06550: line 4, column 40: 
PL/SQL: ORA-00942: table or view does not exist 
ORA-06550: line 3, column 7: 
PL/SQL: SQL Statement ignored 
ORA-06550: line 18, column 42: 
PLS-00364: loop index variable 'REC' use is invalid 
ORA-06550: line 18, column 7: 
PL/SQL: Statement ignored 
 

Userlevel 7
Badge +18

Hi @arebbeadle,

 

I have extracted the SQL query below from the attached script. Please run it and let us know the outcome.

SELECT t.menu_id,m.window,t.source_key_name, count(t.source_key_name)
FROM custom_menu_key_trans_tab t,custom_menu_tab m
WHERE t.menu_id = m.menu_id
GROUP BY t.menu_id,m.window,t.source_key_name
HAVING COUNT (t.source_key_name) > 1;


 

 

Userlevel 6
Badge +13

No results returned,

 

Badge +1

In our Case we have to change a parameter in the Print Server to solve this error. We changed the scale parameter from None to Shrink.

 

Userlevel 6
Badge +13

@Manfred Vogt ,

I’ll will see if this will work for us.

 

Thank you,

Userlevel 6
Badge +13

I resolved the issue causing this error. This error only occured when generating a report that used print media “continuos” feed or reciept paper. What I found was in Crystal report page settings, the page length had to be less than the length of the printer stock paper length setting. When the length are the same IFS would only print the first page and then generate the error in Print Manager, even though if you view the document in Report Archive you can see it is multiple pages long. I was getting the errors in Print Manager multiple times daily until I made this change, now no errors in Print Manager and multi page reports are printing correctly.

 

 

Reply