01-20-2016 04:17 AM - edited 01-20-2016 04:19 AM
I'm was trying to programmatically complete the report path.
The log is saved correctly if I define the list below in the de callback "ReportOptions":
Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"C:\\\\DataLog\\\\<FileYear>\\\\" + FileGlobals.ProductCode + "\\\\<UUTStatus>\\\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>\""
But what I want to do is to complete the "Parameters.ReportOptions.ReportFileSequentialModelExpression"(which is "C:\\DataLog") with "\\<FileYear>\\" + FileGlobals.ProductCode + "\\<UUTStatus>\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>\""
Something rough like below would be in the "ReportOptions":
Parameters.ReportOptions.ReportFileSequentialModelExpression += "\\<FileYear>\\" + FileGlobals.ProductCode + "\\<UUTStatus>\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>\""
01-25-2016 06:02 AM
Hi InspectorGadget,
Which version of TS are you using? I will attach a sequence for TS 2014 that uses a FileGlobal called CustomReportOptions which sets all the ReportOptions manually. This is then set within the ReportOptions callback.
You can use the macros listed within the "ReportPathMacroListString" within the "ReportFileSequentialModelExpression". A full list of possible macros can be found by searching for "macros" within TS help. These must be contained within the macro list string property in order to be used within the file name.
I hope this helps, let me know how it goes.
Pete Woodward
01-26-2016 02:33 AM
Hello PWoodward,
I use TS2014, forgot to mention this.
What I want to do is set 'c:\test' in de second tab of the 'Report Options'.
In the test sequence I want to define the rest of the path.
Parameters.ReportOptions = "C:\\test".
Fileglobals.AdditiveString = "\\Report $(UUT)$(Unique).xml"
Parameters.ReportOptions += Fileglobals.AdditiveString
gr,
01-26-2016 03:38 AM
Hi InspectorGadget,
So I just modified the following:
FileGlobals.ReportOptions.ReportFileSequentialModelExpression = C:\\Test
FileGlobals.AdditiveString = "\\Report $(UUT)$(Unique).xml"
I then changed the ReportOptions Callback to:
Set Custom Report Options (as before)
Append string: Locals.AppendedString = Parameters.ReportOptions.ReportFileSequentialModelExpression + FileGlobals.AdditiveString
Set File path: Parameters.ReportOptions.ReportFileSequentialModelExpression ="\"" + Locals.AppendedString + "\""
Note the "\"" will add the quotation marks that the expression string requires in order to run. This throws up a warning on starting the UUT but it works as intended.
Kind regards
Pete
01-26-2016 04:56 AM
Hello PWoonward,
When running I get a red exclamation mark, and the test stops.
Below is de expression I use(my post before this had some faults).
Locals.Local = Parameters.ReportOptions.ReportFileSequentialModelExpression,
Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\<FileYear>\\\\" + FileGlobals.ProductCodeNIS + "\\\\<UUTStatus>\\\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>" + "\""
01-26-2016 05:17 AM
Hi InspectorGadget,
You will want to use the macros as $(FileYear) , $(UUTStatus) etc as the system has changed for the later versions of TS. These also need to be included in the macro list within the ReportOptions Parameters.
Try making these changes, if it doesn't work could you attach your sequence so I could take a look please? Or a simplified version of the sequence which uses the callback.
Many thanks
Pete
01-26-2016 05:45 AM
PWoodward,
I have tried C:\\logs, C:\\\\logs and C:\\\\\\\\logs, as an expresssion in the report path set in the second tab of report options.
This works.
Locals.Local = "C:\\\\logs",
Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\$(FileYear)\\\\" + FileGlobals.ProductCodeNIS + "\\\\$(UUTStatus)\\\\$(UUT)_Report[$(FileDate)][$(FileTime)]$(Unique).$(FileExtension)" + "\""
This does not work.
Locals.Local = Parameters.ReportOptions.ReportFileSequentialModelExpression,
Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\$(FileYear)\\\\" + FileGlobals.ProductCodeNIS + "\\\\$(UUTStatus)\\\\$(UUT)_Report[$(FileDate)][$(FileTime)]$(Unique).$(FileExtension)" + "\""
01-26-2016 05:50 AM
Hi InspectorGadget,
I expect that the original Parameters.ReportOptions.ReportFileSequentialModelExpression has quotation marks (") within it, this causes problems when we combine the strings later on as it takes it as a literal string of "C:\\logs" instead of C:\\logs.
But it is good that you have a working version now, I hope it serves you well.
Pete
01-26-2016 05:53 AM
PWoodmark,
The lower has to work, how do I remove the quotation marks from "Parameters.ReportOptions.ReportFileSequentialModelExpression"?
Locals.Local = Parameters.ReportOptions.ReportFileSequentialModelExpression,
Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\$(FileYear)\\\\" + FileGlobals.ProductCodeNIS + "\\\\$(UUTStatus)\\\\$(UUT)_Report[$(FileDate)][$(
01-26-2016 06:32 AM
Hi InspectorGadget,
Parameters.ReportOptions.ReportFileSequentialModelExpression = C:\\test (without the quoation marks)
This will cause a syntax error as it expects there to be quotation marks, under the step settings, go to run options, at the bottom tick the "ignore run-time errors"
This should allow you to use the expression correctly, let me know how it goes.
Pete