on 03-04-2015 6:25 PM
Running PB 12.1 Classic.
Whatever I do; font size does not want to change in a Richtext presentation style external datawindow size of column = string 20000000 bytes
Why = long story - converting unix reports to PB for Archiving.
I do this after the only column is populated. You can actually see all text
dw_1.SelectTextall() Actualy selects ALL text in dw
I have tried to setColumn(1) returns -1
src = dw_1.Modify("a.Font.Height='-8'") a = column name Line 1 Column 15: incorrect syntax.
li_rtn = dw_1.SetRichTextSize(8) li_rtn = -1
I could use 2 datawindows with different Font sizes but I would like to know how can I accomplish this with code.
Anything else works
src = "DataWindow.Print.Orientation='1'
src = dw_1.Modify("DataWindow.Print.PrinterName='Xerox Phaser 5500DX PS Tray 3'")
src = dw_1.Modify( "datawindow.print.preview=yes" )
ls_default_printname = dw_1.Object.DataWindow.Print.PrinterName
li_PageCount = long ( dw_1.describe ("evaluate('pagecount()'," + string ( dw_prt.rowcount() ) + ")"))
src = dw_1.Modify( "datawindow.print.preview=no" )
ls_page_range =dw_1.describe ( "DataWindow.Print.Page.Range" )
li_noCopies = integer( dw_1.describe ("DataWindow.Print.Copies"))
src = "DataWindow.Print.Copies='" +String(astr_spool.copies)+"'"
src = dw_1.Modify( src )
src = "DataWindow.Print.duplex='" + String(astr_spool.duplex)+"'"
src = dw_1.Modify( src )
src = "DataWindow.Print.paper.Source='2'"
src = dw_1.Modify( src )
dw_1.Object.DataWindow.Print.PrinterName= 'Sybase Datawindow PS'
Hi Luis,
The only thing I can think is maybe try removing the single quotes around -8. The error message indicates there is a problem with the 15th character, which is the position of the first '
Also, PB help indicates that Font.height is an integer, not a string, so shouldn't need the quotes ('An integer specifying the height of the text in the unit measure for the DataWindow').
Having said that, it works OK for me with and without quotes in PB 10.2.
Good luck,
Nathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Luis,
Is this rich text data? With RichTextToolbarActivationEdit! set as the Rich Text Toolbar Activation Mode, does the default rich text toolbar come up and let you change the font size when you're editing it?
If you look at the usage for the SetRichTextSize method it says this method is to be used on a customized font toolbar button. I've actually never created one myself and haven't been able to find an example but it does not look like that's where your code is.
FYI, remember the rich text control in PB 10.2 is a different control than in PB 12.1, so code that worked in PB 10.2 does not always work in later versions.
Pat
Luis,
Not according to the examples in PB help under the Controls in a DataWindow and their properties section. While there are no specific examples for Font.Height, there are for other properties expecting numeric values
ie (copied from PB help) -
dw_1.Modify("emp_name.X=10")
dw_1.Modify("empname.Height=50")
dw_1.Modify("emp_stat.Protect=1")
dw_1.Modify("DataWindow.Print.Margin.Top=500")
etc
None of the examples I've seen use quotes around the property value where the value is expected to be numeric.
Although, like I said, I've seen Modifys using numeric arguments work both with and without quotes.
The setColumn(1) returning -1 is a concern. Seems to indicate there's something fishy going on ... wonder what happens if you try SetColumn with the column name. What event/function is this code executing from?
Nathan
Hi Pat,
Yes it is rich text. basically, this is a batch process, the user never sees this datawindow. In summary, unix sends all these report flat files to a dir. I have a small powerbuilder program that wakes every 5 minutes and check for files in the dir. the app opens file reads into a blob/string, then dw presentation style richtext has 1 column. the blob/string is loaded into the column. Here is where I need to change the size of the font.
If the rep is landscape, the one column font size needs to be 8 otherwise portrait is 9.
Right now I am using 2 datawindows with Verdana which is better than Courier New, one with font 8 and one with font 9. But knowing the user, eventually they will want different variations.
Thank you
Luis
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.