Solved

Bold format character </b> not being recognized in string.Format command

Posted on 2011-02-27
10
3,480 Views
Last Modified: 2012-08-14
I am trying to turn off bold in a character string but for some reason it is ignoring my command.  This data is stored in a variable and then assinged to a web based HTML editor.  Can someone point me in the right direction?

Here is the raw output in the editor:

<BR><BR><FONT color=blue><B>Physical Exam</B></FONT><BR>
</B>EyesLeft pupil: reactive to light<BR></B>
// Concantenate PE Array
                        int PEsecondindex;
                        MyGlobalVars.PEConCat = "<br /><br /><font color=blue><b>Physical Exam</b></font><br />";
                        for (PEsecondindex = 0; PEsecondindex < MyGlobalVars.PECount; PEsecondindex++)
                        {
                            MyGlobalVars.PEConCat = string.Format("<b>{0}</b>{1}<br />", MyGlobalVars.PEConCat, MyGlobalVars.PE[PEsecondindex]);
                        }

Open in new window

0
Comment
Question by:kwh3856
  • 7
  • 3
10 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
Comment Utility
What do you mean by "turn of bold"? If you don't want the text to be bold you need to remove the <b> and </b> tags surrounding the currently bold text.
0
 

Author Comment

by:kwh3856
Comment Utility
Currenty the output in the HTML editor look like this

Physical Exam
EyesLeft pupil: reactive to light


I need the output to look like this
Physical Exam
EyesLeft pupil: reactive to light
0
 
LVL 52

Expert Comment

by:Carl Tawn
Comment Utility
Can you post the resulting HTML? There isn't anything in the snippet you posted that would suggest that "reactive to light" should be appearing in bold.
0
 

Author Comment

by:kwh3856
Comment Utility
I have tried to do that here

("<b>{0}</b>{1}<br />"


I turn on the bold at the beginning of the first field, then turn it off, then display the next field.
0
 

Author Comment

by:kwh3856
Comment Utility
here is the entire output of the HTML editor in RAW mode:

By the way, I am using an Infragistics HTML editor if that makes a difference.



<B><FONT color=blue>Chief Complaint</B></FONT><BR>neck pain/ cervical radiculopathy46 yr old female Post OP F/UP per dr alexander c/o neck pain radiate to bilat shoulders <BR><BR><FONT color=blue><B>Medications</B></FONT><BR>Lunesta 3 mg Tab <B>Rx Strength = </B>3 <B>Take = </B>3 <B>Frequency = </B><B>Duration = </B><B>Dispense = </B><B>Refills = </B>1 <BR>Allegra D <B>Rx Strength = </B>60 mg <B>Take = </B>1 tab <B>Frequency = </B>bid <B>Duration = </B>60 <B>Dispense = </B><B>Refills = </B><BR>Clarinex <B>Rx Strength = </B>5 mg <B>Take = </B>1 tab(s) <B>Frequency = </B>once a day <B>Duration = </B>30 <B>Dispense = </B><B>Refills = </B><BR>Vioxx <B>Rx Strength = </B>25 mg <B>Take = </B>1 tab <B>Frequency = </B>qd <B>Duration = </B><B>Dispense = </B><B>Refills = </B><BR>lipitor <B>Rx Strength = </B>10mg <B>Take = </B>as directed <B>Frequency = </B>daily <B>Duration = </B><B>Dispense = </B><B>Refills = </B><BR><BR><BR><B><FONT color=blue>Allergies</B></FONT><BR>Coumadin <B>Drug Allergy:</B> <B>Reaction:</B> rash<BR>Lipitor <B>Drug Allergy:</B> <B>Reaction:</B> <BR>MORPHINE AND RELATED <B>Drug Allergy:</B> <B>Reaction:</B> unknown<BR>* No known food allergies <B>Drug Allergy:</B> <B>Reaction:</B> <BR>MORPHINE AND RELATED <B>Drug Allergy:</B> <B>Reaction:</B> unknown<BR><BR><BR><B><FONT color=blue>Diagnosis</B></FONT><BR>Gastrointestinal bleeding NOS<B> Diagnosis Notes:</B><B> Onset Date:</B>1/1/1753 12:00:00 AM<BR>Gastroesophageal reflux disease<B> Diagnosis Notes:</B>Medical therapy begun<B> Onset Date:</B>1/1/1753 12:00:00 AM<BR>Bacteremia<B> Diagnosis Notes:</B><B> Onset Date:</B>1/1/1753 12:00:00 AM<BR>Asthma<B> Diagnosis Notes:</B><B> Onset Date:</B><BR><BR><BR><BR><B><FONT color=blue>HPI</B></FONT><BR>neck pain/ cervical radiculopathy <B>Description:</B> <B>Notes:</B><BR><B>Description:</B>Fever <B>Notes:</B>low grade<BR><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><BR><BR><FONT color=blue><B>Physical Exam</B></FONT><BR></B>EyesLeft pupil: reactive to light<BR></B>IntegumentBack palpation: non-tender<BR></B>IntegumentFinger palpation: non-tender<BR></B>IntegumentAbdomen palpation: non-tender<BR></B>IntegumentCalf palpation: non-tender<BR></B>IntegumentCalf palpation: soft<BR></B>IntegumentKnee palpation: non-tender<BR></B>MS: head/neckDeformities: no deformities<BR></B>MS: head/neckFlexion: full range on flexiion<BR></B>MS: head/neckCervical stability: no laxity<BR></B>MS: head/neckHead: normocephalic<BR></B>MS: left lower extremityHamstrings (S1), tibial nerve: 5/5 strength for all maneuvers<BR></B>MS: left lower extremityEHL (L5), deep peroneal nerve: flexion weakness with 4/5 strength<BR></B>MS: right lower extremitycalf tone: normal tone<BR></B>MS: right lower extremityKnee: no limp<BR></B>MS: right upper extremityPhalen's: negative<BR></B>MS: right upper extremityElbow: full range of motion<BR></B>MS: right upper extremityWrist: normal appearance<BR></B>MS: right upper extremityElbow: full range of motion<BR></B>NeurologicalAlertness: alert and oriented x3<BR></B>NeurologicalRight (graded 0-4+ with 2+ being normal): all testable reflexes normal<BR></B>PsychiatricAffect: a normal exam<BR></B>RespiratoryRight lower lung field: a normal exam<BR><BR><BR><B><FONT color=blue>PFSH</B></FONT><BR>Marital status Married<BR>Number of children 2<BR>Number of cigarettes/day 20 (One Pack)<BR>Number of years using tobacco 15<BR><BR>
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:kwh3856
Comment Utility
Here is additional code if this helps

foreach (var PErec in PEResult)
                    {
                        int PEcount = PEResult.Count();
                        MyGlobalVars.PECount = PEcount;
                        string[] PEarray = new string[PEcount];

                        int PEindex = 0;

                        foreach (var PEdatarec in PEResult)
                        {

                            PEarray[PEindex] = PEdatarec.PEdata.SystemName + PEdatarec.PEdata.SymptomName + "   "  + PEdatarec.PEdata.DescriptionName;

                            MyGlobalVars.PE[PEindex] = PEarray[PEindex];

                            PEindex++;

                        }


                        // Concantenate PE Array
                        int PEsecondindex;
                        MyGlobalVars.PEConCat = "<br /><br /><font color=blue><b>Physical Exam</b></font><br />";
                        for (PEsecondindex = 0; PEsecondindex < MyGlobalVars.PECount; PEsecondindex++)
                        {
                            MyGlobalVars.PEConCat = string.Format("<b>{0}</b>{1}<br />", MyGlobalVars.PEConCat, MyGlobalVars.PE[PEsecondindex]);
                        }

                    }






                    WebHtmlEditor1.Text = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}<br />", MyGlobalVars.ChiefComplaint, MyGlobalVars.ChiefComplaintNote, MyGlobalVars.RxConCat, MyGlobalVars.AllergyConCat, MyGlobalVars.DiagnosisConCat, MyGlobalVars.HPIConCat, MyGlobalVars.PEConCat, MyGlobalVars.PFSHConCat);


0
 

Accepted Solution

by:
kwh3856 earned 0 total points
Comment Utility
Problem solved:

had to include the bolding in the building of the array.

 foreach (var PEdatarec in PEResult)
                        {

                            PEarray[PEindex] = "<b>" + PEdatarec.PEdata.SystemName + PEdatarec.PEdata.SymptomName + "</b>" + PEdatarec.PEdata.DescriptionName;

                            MyGlobalVars.PE[PEindex] = PEarray[PEindex];

                            PEindex++;

                        }


                        // Concantenate PE Array
                        int PEsecondindex;
                        MyGlobalVars.PEConCat = "<br /><br /><font color=blue><b>Physical Exam</b></font><br />";
                        for (PEsecondindex = 0; PEsecondindex < MyGlobalVars.PECount; PEsecondindex++)
                        {
                            MyGlobalVars.PEConCat = string.Format("{0}{1}<br />", MyGlobalVars.PEConCat, MyGlobalVars.PE[PEsecondindex]);
                        }
0
 
LVL 52

Expert Comment

by:Carl Tawn
Comment Utility
Well, your output markup is extremely baddly formed, but it doesn't look like the snippet you posted is the culprit (although that depends partly on what MyGlobalVars.PE[PEsecondindex] is outputting).

It is the problems with the badly formatted markup that is causing the problem, and the browser is just interpreting it as best it can.
0
 

Author Comment

by:kwh3856
Comment Utility
Figured out the solution myself.
0
 

Author Closing Comment

by:kwh3856
Comment Utility
Fixed problem myself...
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now