Insert Carriage Return into SSRS report
Hello folks I am trying in RB2 to replicate the functionality of a lookupset. I have some SQL (below) which is generating single record correctly for a number of records in another table (in this case MAC addresses and IP addresses) and pushing in a comma between the values which is great. What I am trying to do however is to present this data as seperate lines and have tried to replace the ', ' string with CHAR(10), CHAR(13) and also vbcrlf to no avail. Would someone have seen this done before? SELECT DISTINCT SYS.ResourceID , SYS.Netbios_Name0, CASE WHEN datalength(SCU.TopConsoleUser0) >1 THEN SCU.TopConsoleUser0 + ' (a)' ELSE CSYS.Username0 + ' (i)' END AS UserName, OPSYS.Caption0 as OperatingSystem, OPSYS.Version0, CAST (MEM.TotalPhysicalMemory0 AS INT) / 1024 AS MemoryMB, OPSYS.LastBootUpTime0 , OPSYS.Organization0 , OPSYS.RegisteredUser0 , CSYS.Manufacturer0, CSYS.Model0, Processor.Name0, Round ((CAST (Processor.MaxClockSpeed0 AS FLOAT) /1000) , 1 ,1) as Clockspeed , v_GS_LOGICAL_DISK.FreeSpace0, v_GS_LOGICAL_DISK.Size0, v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 , 'Chassis Name' = CASE ChassisTypes0 WHEN '1' THEN 'Other' WHEN '2' THEN 'Unkown' WHEN '3' THEN 'Desktop' WHEN '4' THEN 'LowProfileDesktop' WHEN '5' THEN 'Pizza Box' WHEN '6' THEN 'Mini-Tower' WHEN '7' THEN 'Tower' WHEN '8' THEN 'Portable' WHEN '9' THEN 'Laptop' WHEN '10' THEN 'Notebook' WHEN '11' THEN 'Hand - Held' WHEN '12' THEN 'Docking Station' WHEN '13' THEN 'ALL- IN -One' WHEN '14' THEN 'Sub Notebook' WHEN '15' THEN 'Space Saving Chassis' WHEN '16' THEN 'Lunch Box' WHEN '17' THEN 'Main System Chassis' WHEN '18' THEN 'Expansion Chassis' WHEN '19' THEN 'Sub Chassis' WHEN '20' THEN 'Bus Expansion Chassis' WHEN '21' THEN 'Peripheral Chassis' WHEN '22' THEN 'Storage Chassis' WHEN '23' THEN 'Rack Mounted Chassis' WHEN '24' THEN 'Sealed CASE PC' WHEN '25' THEN 'Tablet -PC' end , REPLACE( ( SELECT MAC_Addresses0 + ', ' FROM dbo.v_RA_System_MACAddresses as mac WHERE mac.resourceID = sys.resourceID ORDER BY MAC_Addresses0 FOR XML PATH('') )+'..', ', ..', '') as [MAC Addresses], ( SELECT IP_Addresses0 + ', ' FROM dbo.v_RA_System_IPAddresses as ip WHERE ip.resourceID = sys.resourceID ORDER BY ip_Addresses0 FOR XML PATH('') ) as [IP Addresses] FROM v_R_System_Valid SYS LEFT JOIN v_GS_X86_PC_MEMORY MEM on SYS.ResourceID = MEM.ResourceID LEFT JOIN v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP SCU on SYS.ResourceID = SCU.ResourceID LEFT JOIN v_GS_COMPUTER_SYSTEM CSYS on SYS.ResourceID = CSYS.ResourceID LEFT JOIN v_GS_PROCESSOR Processor on Processor.ResourceID = SYS.ResourceID LEFT JOIN v_GS_OPERATING_SYSTEM OPSYS on SYS.ResourceID=OPSYS.ResourceID LEFT JOIN v_GS_SYSTEM_ENCLOSURE ON SYS.ResourceID = v_GS_SYSTEM_ENCLOSURE.ResourceID LEFT JOIN v_ClientCollectionMembers ON SYS.ResourceID = v_ClientCollectionMembers.ResourceID LEFT JOIN v_GS_SYSTEM_CONSOLE_USER on SYS.ResourceID = v_GS_SYSTEM_CONSOLE_USER.ResourceID LEFT JOIN v_GS_LOGICAL_DISK on SYS.ResourceID = v_GS_LOGICAL_DISK.ResourceID WHERE v_ClientCollectionMembers.CollectionID IN (@CollID) AND v_GS_LOGICAL_DISK.DeviceID0 = 'C:' AND v_GS_LOGICAL_DISK.Description0='Local Fixed Disk' and V_GS_SYSTEM_ENCLOSURE.Tag0 = 'System Enclosure 0' order by 1
May 22nd, 2012 10:34am

Hi There In SSRS Please replace comma in your expression with this Chr(10) not with CHAR(10), So expression might look like this Replace(Fields!Workdate.Value,,, Chr(10)) Please do it inside SSRS I have done it lot of time and it works for me and I hope it will work for you as well Many Thanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2012 7:17pm

Hi there Syed Thanks for coming back to me. I should have responded to this beforehand when I worked out how to do this. What I did was to replace the comma with a text string which would never appear in the result (~) and then replace that with a VbCrLf in the report display.
May 25th, 2012 9:56am

Hi there Syed Thanks for coming back to me. I should have responded to this beforehand when I worked out how to do this. What I did was to replace the comma with a text string which would never appear in the result (~) and then replace that with a VbCrLf in the report display.
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2012 9:56am

Hi there Syed Thanks for coming back to me. I should have responded to this beforehand when I worked out how to do this. What I did was to replace the comma with a text string which would never appear in the result (~) and then replace that with a VbCrLf in the report display.
May 25th, 2012 10:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics