I would like to put in bold one word inside a field in crystal reports, may somebody help me to do that or tell me if there is a 3rd party application that can do that
try this ... let me know if you need it in C# ... Dim crReport As New CrystalReport1() Dim crReportObject as ReportObject Dim crTextObject as TextObject Dim ArialFont as New Font("Arial", 30, FontStyle.Bold) For Each crReportObject in Report.Section2.ReportObjects
If crReportObject.Kind = ReportObjectKind.TextObject Then crTextObject = CType(crReportObject, TextObject) crTextObject.ApplyFont(ArialFont) End If Next
Another way is, during design, is to implement a formula to bold the word you want based on what's coming from the DB (if it is). You'll need to post more specifics of what you are attempting to do... LH
Thanx for the help, I did Dim crReport As New CrystalReport1() Dim crReportObject as ReportObject Dim crTextObject as TextObject Dim ArialFont as New Font("Arial", 30, FontStyle.Bold) For Each crReportObject in Report.Section2.ReportObjects If crReportObject.Kind
= ReportObjectKind.TextObject Then crTextObject = CType(crReportObject, TextObject) crTextObject.ApplyFont(ArialFont) End If Next but the code above puts the entire textbox in bold and i just want to put one word of the textbox in bold... God Speed
That font property applies to the entire control object. You will have to find an alternate solution. I'm assuming you'll know the word to bold? Why not do it through a formula or even fix that on your SQL/SP call? If there's a certain word you need to bold,
write a formula field to search for that word to bold. Use the formula field on your report and not the db field. LH
Dude just for the records I wanna say thank you for your advise. I solve the problem with this bloc of code: ' This formula must use Crystal's Basic syntax. 'puts the first word of the field in bold dim InputField as string ' Change the InputField to be the
string or ' field that you want to format. InputField = {REQUISICION.DescripcionClausula} dim Increment as number dim TempString as string dim TempStringTwo as string Increment = 1 if instr(InputField, " ") > 0 then TempString = InputField(1 to instr(InputField,
" ")) else TempString = InputField if instr(InputField, " ") > 0 then TempStringTwo= InputField(length(TempString) + 1 to length(InputField)) else TempStringTwo = "" formula = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}"
+ "\viewkind4\uc1\pard\b\f0\fs20 " + TempString + "\b0 " + TempStringTwo what I did was that I created a formula and format the paragraph to rtf. It works just fine.
scoutforever
Member
15 Points
3 Posts
Modify pdf files during crystal export process
Aug 08, 2003 09:44 PM|LINK
psinyc
Participant
1475 Points
293 Posts
Re: Modify pdf files during crystal export process
Aug 09, 2003 02:28 PM|LINK
Peter Iuvara, MCP
LordHits
Member
520 Points
104 Posts
Re: Modify pdf files during crystal export process
Aug 09, 2003 04:17 PM|LINK
scoutforever
Member
15 Points
3 Posts
Re: Modify pdf files during crystal export process
Aug 11, 2003 04:41 PM|LINK
LordHits
Member
520 Points
104 Posts
Re: Modify pdf files during crystal export process
Aug 11, 2003 05:45 PM|LINK
scoutforever
Member
15 Points
3 Posts
Re: Modify pdf files during crystal export process
Aug 12, 2003 02:33 PM|LINK