Jump to content
Sign in to follow this  
vgarza

Carriage Return on Report Center

Recommended Posts

Hello everybody,

I am working on a report with MACs. We are running a command to get the update status. The output of that command could be several lines (with carriage return). I am saving that information on the DB (longtext) . If I make a SELECT to that table on the DB and I see the carriage return (I see the brake line). I tried to detect wich CR is save on the DB with these queries:

SELECT * FROM tbl_bt_mac_updates WHERE UpdateStatus REGEXP "\r\n";
SELECT * FROM tbl_bt_mac_updates WHERE UpdateStatus REGEXP "\r";
SELECT * FROM tbl_bt_mac_updates WHERE UpdateStatus REGEXP "\n"; -- <- Good
 

It seems that the \n is save on the DB because it returns rows.

I tried to create a report on LT. The information is there but without carriage return. Everything is in one line. I tried to create a view on the DB to replace that \n, where is part of the query:

SELECT
  `tbl_bt_mac_updates`.`ComputerID`   AS `ComputerID`,
  `tbl_bt_mac_updates`.`UpdateStatus` AS `UpdateStatus`,
  REPLACE(`tbl_bt_mac_updates`.`UpdateStatus`,'\n','\r\n') AS `UpdateStatusRN`,
  REPLACE(`tbl_bt_mac_updates`.`UpdateStatus`,'\n','\r') AS `UpdateStatusR`,
  `tbl_bt_mac_updates`.`TimeGen`      AS `TimeGen`
FROM `tbl_bt_mac_updates`
 

Report Center shows one line anyway. 

I tried to use a "Calculate Field" and use the replace function like this:

Replace( [UpdateStatus] , '\n' , '-' )

It doesn't work. I tried different ways to use the replace but it never match. If I replace any other letter the replace function works fine but it never shows any line brake on the report.

Can someone help me on this?

Thanks in advance.

 

 

 

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...