Showing posts with label formatting. Show all posts
Showing posts with label formatting. Show all posts

Monday, March 12, 2012

Removing Rich Text formatting from a field

I have a field where the data is stored with RTF. I know SQL Reporting Services cannot display it properly. Is there way to remove the RTF formatting codes through a function to just pull out the text and displya it in the text box?

I had a similiar problem and found this link helpful:

http://www.4guysfromrolla.com/webtech/042501-1.shtml

I just took the function provided in the above link and placed it in the Code section of my report. It may need some tweaking depending on your specific needs but hopefully it will help.

|||

place this code in your Code section:

function StripRTF(ByVal rtf as String) as String
rtb.Rtf = rtf
return rtb.Text
end function

Add a reference to the System.Windows.Forms namespace and create a class instance of System.Windows.Forms.RichTextBox with an instance name of rtb

|||

Hi,

Code Snippet

function StripRTF(ByVal rtf as String) as String
rtb.Rtf = rtf
return rtb.Text
end function

I've similar problem and the above function works in Report Designer. However, when it is deployed in ReportServer, it didn't work at all.

Is there something we need to do in the Report Server?

For your info, both Report Designer and Report Server sits in different machine.

Please help.

Regards

Kamal

|||I am having the same issue. The code works fine in report designer, but out on the report server I get "#Error" in place of what is supposed to be the parsed text.

Ideas?

Thanks in advance

Removing Rich Text formatting from a field

I have a field where the data is stored with RTF. I know SQL Reporting Services cannot display it properly. Is there way to remove the RTF formatting codes through a function to just pull out the text and displya it in the text box?

I had a similiar problem and found this link helpful:

http://www.4guysfromrolla.com/webtech/042501-1.shtml

I just took the function provided in the above link and placed it in the Code section of my report. It may need some tweaking depending on your specific needs but hopefully it will help.

|||

place this code in your Code section:

function StripRTF(ByVal rtf as String) as String
rtb.Rtf = rtf
return rtb.Text
end function

Add a reference to the System.Windows.Forms namespace and create a class instance of System.Windows.Forms.RichTextBox with an instance name of rtb

|||

Hi,

Code Snippet

function StripRTF(ByVal rtf as String) as String
rtb.Rtf = rtf
return rtb.Text
end function

I've similar problem and the above function works in Report Designer. However, when it is deployed in ReportServer, it didn't work at all.

Is there something we need to do in the Report Server?

For your info, both Report Designer and Report Server sits in different machine.

Please help.

Regards

Kamal

Wednesday, March 7, 2012

Removing formatting from imported file

I have a file I'm pulling from another type of database into an Excel spreadsheet and then using my dtsx package to import the spreadsheet into my SQL database. The problem I'm having is that one of the fields coming out of the database to the spreadsheet has the thousands seperator in the field that I want to use as a numeric field without the ",". Right now I have a macro that I run on the spreadsheet to reset the field to straight numbers without commas before importing it, but would like to configure my Integration package to do it automatically.

Any ideas would be appreciated.

Thanks in Advance

Bring the column in as a string, then use a Derived Column transform to clean it and cast it to a number.

Code Snippet

(DT_I4) (REPLACE( [YourColumn] ,",","" ) )