Engineering Workbench Ops Comments

Just a quick question thats landed on my desk this morning, Its to do with opteration comments when type text in the and do some basic formatting like leaving spaces between lines when they come to print the Job Traveller the formating is gone and the test is just clumped together. is there any way to correct this?

Cheers for any help.

In our comment fields on the job traveler the expression replaces some line break codes:

=First(REPLACE(REPLACE(REPLACE(Fields!CommentText.Value, chr(13) & chr(10), VbLf), chr(13), VbLf), chr(10),VbCrLf))

=First(REPLACE(REPLACE(REPLACE(Fields!Instructions.Value, chr(13) & chr(10), VbLf), chr(13), VbLf), chr(10),VbCrLf))

I donā€™t recall if we put this feature in place recently, or if it came that way.

Thank you i will go take alook and see whats there myself , thanks again for the pointer.

Itā€™s a bit galling that SSRS, which literally has ā€œSQL Serverā€ in the title, doesnā€™t handle SQL new line characters. Hereā€™s a less verbose option of dealing with that:

Replace(Fields!YourCommentFieldHere.Value, Chr(13), Environment.NewLine)

I (like SSRS) ignore chr(10) entirely. Iā€™ve personally found Environment.NewLine to cause fewer issues than VbCrLf in SSRS.

3 Likes

Iā€™ll never remember thatā€¦ but nice tip @jtownsend.

Iā€™ve been doing the same thing whenever possible. SSRS, C#, VB.Netā€¦Environment.NewLine is the way to go.

Ive done similar straight out of SSRS when its going to an Excel Spreadsheet
Replace(YourValuehere,ā€™ ,ā€˜,ā€™ ') . syntax not right ( replace all commas with a space) but commas wreak havoc on spreadsheets and ESPECIASLLY csv filed ( comma seperated value) readā€¦ Bartender drop files for us that havenā€™t migrated to web / cloud Bartender yetā€¦