Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Changing field width and font style dynamicly
Changing field width and font style dynamicly [message #2512] Thu, 29 April 2010 01:55 Go to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

Is there a way for changing the field width or style dynamicly for PDF file generation??
Re: Changing field width and font style dynamicly [message #2513 is a reply to message #2512] Thu, 29 April 2010 05:12 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
All styles which you want to use in a subsystem should be defined in the PDF Style File. Each report has its own Structure File which defines the specifics for that report, such as what goes where, and which style to use for which element. You therefore define the style that you want to use for each report element in the Report Structure File.

It is possible to change the style of individual fields at runtime by putting code into the _cm_formatData() method. To change the style of a field you should use code such as the following:
    $css_array['field'] = 'style_name';

It is not possible to change the width of a field, only its style.

I hope this helps.


Re: Changing field width and font style dynamicly [message #2514 is a reply to message #2512] Thu, 29 April 2010 10:37 Go to previous messageGo to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

Thanks for your answer.
This means that I can't change the font for a field at runtime within a PDF report? I need to create a letter at runtime, but some fields (most of them are variable length) of that letter have to be with bold style; any suggestion.
Thanks for advance.
Re: Changing field width and font style dynamicly [message #2515 is a reply to message #2514] Thu, 29 April 2010 10:51 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
When you specify a different style in this manner the style may have all the possible attributes, such as font, fillcolour, textcolour and drawcolour. It is also possible for the new style to only specify those attributes which you want to alter from the current style, such as textcolour for example.

Re: Changing field width and font style dynamicly [message #2516 is a reply to message #2515] Thu, 29 April 2010 11:55 Go to previous messageGo to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

ok, but is there a way to change those styles, or better yet, change the structure at runtime for PDF files?
Re: Changing field width and font style dynamicly [message #2517 is a reply to message #2516] Thu, 29 April 2010 12:17 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
What did I write in my first answer?

1) All styles must be defined in the PDF Structure File.
2) Each report has its own Report Structure File which defines the elements of that report and the style to be used for each element.
3) It is possible to change the style of individual fields at runtime by putting code into the _cm_formatData method.
4) It is NOT possible to change the structure of a report at runtime (which includes the size of individual fields).
5) It is possible to modify report labels at runtime as shown in FAQ121.


Re: Changing field width and font style dynamicly [message #2535 is a reply to message #2517] Thu, 13 May 2010 11:59 Go to previous messageGo to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

Is there a way to use the TCPDF method writeHTMLcell instead of Cell? this way, you can construct dynamicly the code creating html code
Re: Changing field width and font style dynamicly [message #2536 is a reply to message #2535] Thu, 13 May 2010 12:15 Go to previous message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
No. I developed my interface with the PDF library before the HTML-like features became available, and I don't have the time (or the inclination) to rewite all my code.

You could always bypass the Radicore interface and call the PDF library methods directly, and then you could do whatever the library allows.


Previous Topic: Action bar
Next Topic: Blank screen after file upload transaction
Goto Forum:
  


Current Time: Fri Nov 15 18:43:22 EST 2024

Total time taken to generate the page: 0.01102 seconds