SayeyeZohor Posted February 21, 2019 Share Posted February 21, 2019 من یک فیلد دارم در اسکیوال از نوع nvarchar(max) این فیلد را از طریق یک uniHtmlMemo پر می کنم که این شکلی در دیتابیس ذخیره می شود <div align="right">شسیشیش</div><div align="right">شسبنشنبتدش</div><div align="right">شنبتاشن</div> حالا زمان نمایش این فیلد در گرید من گزینه DisplayMemo رو فعال کردم و به خوبی اطلاعات نمایش داده می شه مشکل من زمانی هستش که اطلاعات وارد شده در این فیلد بالا میره و به این شکل میشه و ترکیب گرید رو به هم می ریزه من میخوام به طور مثال حداکثر 100 کاراکتر از این فیلد رو نمایش بدم با calcfield هم کد زدم نشد procedure TUniCheckListNezaratD2D3ProbNew.UQ_NezaratD3CalcFields(DataSet: TDataSet); var Len: Integer; begin Len := StrToIntDef(IFTHEN(Length(UQ_NezaratD3SharhHtmlNew.AsWideString) <= 100, IntToStr(Length(UQ_NezaratD3SharhHtmlNew.AsWideString)), '100'), 0); UQ_NezaratD3SharhHtmlShort.AsString := UQ_NezaratD3SharhHtml.AsString; //Copy(UQ_NezaratD3SharhHtmlNew.AsWideString, 0, Len) + ' ...'; end; Link to comment Share on other sites More sharing options...
SayeyeZohor Posted February 23, 2019 Author Share Posted February 23, 2019 aloooo, is anybody here? Link to comment Share on other sites More sharing options...
SayeyeZohor Posted February 23, 2019 Author Share Posted February 23, 2019 Link to comment Share on other sites More sharing options...
SayeyeZohor Posted February 23, 2019 Author Share Posted February 23, 2019 @FmSoft Farshad Mohajeri × Link to comment Share on other sites More sharing options...
Sherzod Posted February 23, 2019 Share Posted February 23, 2019 5 hours ago, SayeyeZohor said: aloooo, is anybody here? Can you translate to English ? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted February 24, 2019 Administrators Share Posted February 24, 2019 Hi, I have read your post. Can you explain what is the problem? It is not clear from your post. PS: When you decide to show HTML content in your grid cell the end result will be solely determined by HTML rules. uniGUI can not change how HTML content will be rendered. Link to comment Share on other sites More sharing options...
SayeyeZohor Posted February 25, 2019 Author Share Posted February 25, 2019 Hi, with this code, I Remove all tag in html text in sql function and then I copy and display a part of the text I made a trick tnx @Sherzod @Farshad Mohajeri CREATE FUNCTION [dbo].[udf_StripHTML](@HTMLText VARCHAR(MAX)) RETURNS VARCHAR(MAX) AS BEGIN DECLARE @Start INT DECLARE @End INT DECLARE @Length INT SET @Start = CHARINDEX('<',@HTMLText) SET @End = CHARINDEX('>',@HTMLText,CHARINDEX('<',@HTMLText)) SET @Length = (@End - @Start) + 1 WHILE (@Start > 0) AND (@End > 0) AND (@Length > 0) BEGIN SET @HTMLText = STUFF(@HTMLText,@Start,@Length,' ') SET @Start = CHARINDEX('<',@HTMLText) SET @End = CHARINDEX('>',@HTMLText,CHARINDEX('<',@HTMLText)) SET @Length = (@End - @Start) + 1 END RETURN LTRIM(RTRIM(@HTMLText)) END Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 18, 2019 Administrators Share Posted March 18, 2019 Thanks for feedback. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now