Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
sharon_siao
Contributor III
Contributor III

Nprinting Cycling report dynamic naming

Hi, I have a cycling report, cycling by Field_A. For report naming, I have Dynamic Naming enabled and under Custom Dynamic Naming I have Cycle fields as an Item (which is mandatory). The problem is some values of Field_A are very long strings and the report fails because Windows does not accept such long file names. I tried to create a variable in the Qlik file, but I am unable to use the variable anywhere in dynamic naming and I'm not able to get away from 'Cycle fields' automatically using Field_A.

Thanks for any help.

Labels (1)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

How about shortening your long field values in script?

for example:

left(field_A,10)&’_’&autonumber(field_A,’field_A’)) as field FieldA2

i this would ensure that you always have unique values and short file names

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

9 Replies
Frank_S
Support
Support

Hi @sharon_siao 

Unless someone else here has found a unique and safe workaround, I would suggest reworking the length of the field name so as to not conflict with windows file name limits.

Most evidence from Microsoft and other site (found in a google search with search phrase "windows file name too long") that shortening the name used is the most robust and safest way to resolve your issue.

Kind regards...

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Agree with Frank.

also remember that some characters are not allowed in filenames neither...like / or : , which are often part of a date format or timestamp format

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
sharon_siao
Contributor III
Contributor III
Author

Thank you @Frank_S  and @Lech_Miszkiewicz  for your helpful suggestions and tips. As Frank mentioned, I did try to "rework" the length of the field by creating a variable Field_A_short = Left(Field_A, 20) in the hopes that I might be able to access and use this variable somewhere in Nprinting where I'm setting dynamic naming. But it didn't present itself for dynamic naming. In addition to this, as mentioned in my original post, it is mandatory to pick Cycle fields as one item (which I understand), but it also forces you to use the field that you cycle on (Field_A for me), so there is no way for me to  set this to anything else. As for windows file name restrictions, Lech_M, there is no problem with special characters, the long string is just a string of letters, no special characters. But thanks both of you for taking the time to respond.

Frank_S
Support
Support

Hi @sharon_siao 

If the field is not available for cycling, check that:

  • you reloaded your source connection to the document that you changed. the connection must be refreshed before it can be seen in NPrinting.
  • the name is not a duplicate. duplicate names may not work as expected

If either or both of the above, that might be the cause of the issue.

Kind regards...

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sharon_siao
Contributor III
Contributor III
Author

Sorry, I may not have been clear about where the problem is.

1) This works: Set up report and enable cycling on Field_A. The report runs successfully, cycles through Field_A. If there are 5 values in Field_A, then I get an output of 5 Excel files saved in a Windows folder. So in response to Frank's last post above, I am able to select Field_A to cycle on. And the report works great. 

2) This is the problem: For another run of the report, Field_A has let's say 7 values, but 3 of them are very long strings. The report runs fine cycling through values of Field_A. There should be an output of 7 Excel files. The names of these files are created using Field_A concatenated with some other elements (items) that we can customize. Because some values of Field_A are very long, the filename ends up being very long. And this is where the report fails. If I could find a way for the report to not use the Field_A (as is) in the filename, I can circumvent this problem.

In summary, if I did not have long Field_A values, the report would be fine.  

Thanks all the same.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

How about shortening your long field values in script?

for example:

left(field_A,10)&’_’&autonumber(field_A,’field_A’)) as field FieldA2

i this would ensure that you always have unique values and short file names

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

And using FieldA2 in your cycle...

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Or simply autonumber(fieldA) in script and use it as a cycle field. It will produce number which will not mean anything to you but at least it will produce the rxpected outcome

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
sharon_siao
Contributor III
Contributor III
Author

Yes, Lech_M I think this is the way to go. Although, I have not been able to get my report to work because there are other kinks to work out, meaning I'm not getting my expected results. I need to look to closely at what else I need to take care of in the report in order for it to work. But the cycyling on Field_A2 works. So I will mark this as the solution.

Thanks everyone for your valuable input.