mibuso.com

Microsoft Business Solutions online community
It is currently Sun May 19, 2013 9:06 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Dynamically change fields properties in report
PostPosted: Wed Jan 18, 2006 5:30 pm 
Offline

Joined: Fri Apr 01, 2005 3:40 pm
Posts: 74
Location: Switzerland
Country: Switzerland (ch)
Hello

Can anybody tell me if it is possible to change dynamically the FontBold (for exemple) property of a control in a report ?
I would like to print several lines in a section and each ligne may be printed with bold, italic... or not

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 6:11 pm 
Offline

Joined: Fri Jan 28, 2005 2:08 pm
Posts: 20
Location: Volketswil
Country: Switzerland (ch)
No, not possible.

You can find some suggestions here: http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=15399

_________________
Daniel Zimmermann


Top
 Profile  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 10:16 am 
Offline

Joined: Wed Jul 22, 2009 10:09 am
Posts: 1
Location: Alblasserdam
Country: Netherlands (nl)
Hello,

I have the same question now 3.5 years later. Is it still not posseble?

One of my sources is a boolean. If the boolean is true the data in the textbox must be bold. Unfortunatly the suggestion link is not working any more :(

_________________
Vincent Mouwen
Apps manager of Pondres Direct mail B.V.


Top
 Profile E-mail WWW  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 10:46 am 
Offline

Joined: Sat Sep 25, 2004 2:04 am
Posts: 354
Location: Netherlands
Country: Netherlands (nl)
vmouwen wrote:
Hello,

I have the same question now 3.5 years later. Is it still not posseble?

One of my sources is a boolean. If the boolean is true the data in the textbox must be bold. Unfortunatly the suggestion link is not working any more :(

No, it's still not possible. You'll have to make 2 sections, one normal one bold, and hide/show them according to your boolean value.


Top
 Profile  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 10:52 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Aug 14, 2001 7:01 am
Posts: 5315
Location: Prague
Country: Czech Republic (cz)
In RTC you can do this on SQL reporting.

_________________
David Singleton
Dynamics NAV Freelancer
Dynamics Book
Go-Live International


Top
 Profile E-mail WWW  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 11:23 am 
Offline

Joined: Mon Mar 08, 2004 2:42 pm
Posts: 3255
Location: Hannover
Country: Germany (de)
only possible wit "Reporting Service" (SQL report) or with separate Sections.

_________________
Do you make it right, it works too!


Top
 Profile  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 12:18 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Aug 14, 2001 7:01 am
Posts: 5315
Location: Prague
Country: Czech Republic (cz)
garak wrote:
only possible wit "Reporting Service" (SQL report) or with separate Sections.


That's not true [-X , and in fact creating new sections is a lot of work especially to maintain.

For sure there are other option, for example you can have Bold and non bold controls in the same section and just print the one you want. This is especially important if say you have three different fields that might be bold or normal depending on conditions. In your scenario with sections, you would need to maintain EIGHT sections just to handle three fields.

_________________
David Singleton
Dynamics NAV Freelancer
Dynamics Book
Go-Live International


Top
 Profile E-mail WWW  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 1:24 pm 
Offline

Joined: Mon Mar 08, 2004 2:42 pm
Posts: 3255
Location: Hannover
Country: Germany (de)
Whats the problem, for his case with one Bool Field, to create two section?


XYZ, Body (1) - OnPreSection()
CurrReport.showoutput(BoolField)

XYZ, Body (2) - OnPreSection()
CurrReport.showoutput(not BoolField)

?

I agree, if you have a lot of bool fields that's looks like a "De Morgan" table, it's a hard work to do.

_________________
Do you make it right, it works too!


Top
 Profile  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 3:31 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Aug 14, 2001 7:01 am
Posts: 5315
Location: Prague
Country: Czech Republic (cz)
You said that those are the ONLY options, I am jsut saying that there are more.

_________________
David Singleton
Dynamics NAV Freelancer
Dynamics Book
Go-Live International


Top
 Profile E-mail WWW  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Wed Jul 22, 2009 3:38 pm 
Offline

Joined: Mon Mar 08, 2004 2:42 pm
Posts: 3255
Location: Hannover
Country: Germany (de)
David Singleton wrote:
You said that those are the ONLY options, I am jsut saying that there are more.


ok, then you're right

_________________
Do you make it right, it works too!


Top
 Profile  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Mon Aug 17, 2009 7:11 pm 
Offline

Joined: Mon Aug 17, 2009 6:07 pm
Posts: 18
David Singleton wrote:
For sure there are other option, for example you can have Bold and non bold controls in the same section and just print the one you want.


Hi David,

Would you willing to explain how to do this in Dynamics NAV 5.0, please? I would like to avoid separate sections if at all possible.

I sincerely appreciate your time.

Regards,
Darrin


Top
 Profile E-mail  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Mon Aug 17, 2009 8:01 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Aug 14, 2001 7:01 am
Posts: 5315
Location: Prague
Country: Czech Republic (cz)
darrinkatz wrote:
David Singleton wrote:
For sure there are other option, for example you can have Bold and non bold controls in the same section and just print the one you want.


Hi David,

Would you willing to explain how to do this in Dynamics NAV 5.0, please? I would like to avoid separate sections if at all possible.

I sincerely appreciate your time.

Regards,
Darrin


I uploaded a sample report in the Download section, but I guess it takes a while to be visible.
For now here is the code.... The FOB is probably easier though.

Code: Select all
OBJECT Report 50099 Bold Fields on report
{
  OBJECT-PROPERTIES
  {
    Date=08/17/09;
    Time=[ 7:49:02 PM];
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
  }
  DATAITEMS
  {
    { PROPERTIES
      {
        DataItemTable=Table27;
        OnAfterGetRecord=BEGIN
                           CALCFIELDS(Inventory,"Qty. on Purch. Order");

                           IF Inventory < 100 THEN BEGIN
                             QtyOnHand := '';
                             QtyOnHandBold := FORMAT(Inventory);
                           END ELSE BEGIN
                             QtyOnHand := FORMAT(Inventory);
                             QtyOnHandBold := '';
                           END;
                           IF "Qty. on Purch. Order" < 100 THEN BEGIN
                             QtyOnPO := '';
                             QtyOnPOBold := FORMAT("Qty. on Purch. Order");
                           END ELSE BEGIN
                             QtyOnPO := FORMAT("Qty. on Purch. Order");
                             QtyOnPOBold := '';
                           END;
                           IF  "Costing Method" = "Costing Method"::FIFO THEN BEGIN
                             Costing := '';
                             CostingBold := FORMAT("Costing Method");
                           END ELSE BEGIN
                             Costing := FORMAT("Costing Method");
                             CostingBold := '';
                           END;
                         END;

        ReqFilterFields=No.;
        GroupTotalFields=No.;
      }
      SECTIONS
      {
        { PROPERTIES
          {
            SectionType=Header;
            PrintOnEveryPage=Yes;
            SectionWidth=18150;
            SectionHeight=1692;
          }
          CONTROLS
          {
            { 1000000001;Label  ;0    ;0    ;7500 ;423  ;FontSize=8;
                                                         FontBold=Yes;
                                                         CaptionML=ENU=Item }
            { 1000000002;TextBox;15000;0    ;3150 ;423  ;HorzAlign=Right;
                                                         SourceExpr=FORMAT(TODAY,0,4) }
            { 1000000003;TextBox;0    ;423  ;7500 ;423  ;SourceExpr=COMPANYNAME }
            { 1000000004;TextBox;17700;423  ;450  ;423  ;CaptionML=ENU=Page;
                                                         SourceExpr=CurrReport.PAGENO }
            { 1000000005;Label  ;16950;423  ;750  ;423  ;ParentControl=1000000004 }
            { 1000000006;TextBox;15900;846  ;2250 ;423  ;HorzAlign=Right;
                                                         SourceExpr=USERID }
          }
           }
        { PROPERTIES
          {
            SectionType=Header;
            PrintOnEveryPage=Yes;
            SectionWidth=18150;
            SectionHeight=1269;
          }
          CONTROLS
          {
            { 1000000009;Label  ;0    ;0    ;1500 ;846  ;ParentControl=1000000008;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000012;Label  ;1650 ;0    ;4500 ;846  ;ParentControl=1000000011;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000015;Label  ;6300 ;0    ;2250 ;846  ;ParentControl=1000000014;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000018;Label  ;8700 ;0    ;1800 ;846  ;ParentControl=1000000017;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000021;Label  ;10650;0    ;1800 ;846  ;ParentControl=1000000020;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
          }
           }
        { PROPERTIES
          {
            SectionType=Body;
            SectionWidth=18150;
            SectionHeight=423;
          }
          CONTROLS
          {
            { 1000000008;TextBox;0    ;0    ;1500 ;423  ;HorzAlign=Left;
                                                         SourceExpr="No." }
            { 1000000011;TextBox;1650 ;0    ;4500 ;423  ;HorzAlign=Left;
                                                         SourceExpr=Description }
            { 1000000014;TextBox;6300 ;0    ;2250 ;423  ;HorzAlign=Left;
                                                         FontSize=8;
                                                         SourceExpr=Costing }
            { 1000000017;TextBox;8700 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=8;
                                                         SourceExpr=QtyOnHand }
            { 1000000020;TextBox;10650;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=8;
                                                         SourceExpr=QtyOnPO }
            { 1000000000;TextBox;10650;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=9;
                                                         FontBold=Yes;
                                                         FontUnderline=Yes;
                                                         SourceExpr=QtyOnPOBold }
            { 1000000007;TextBox;8700 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=8;
                                                         FontBold=Yes;
                                                         FontUnderline=Yes;
                                                         SourceExpr=QtyOnHandBold }
            { 1000000010;TextBox;6300 ;0    ;2250 ;423  ;HorzAlign=Left;
                                                         FontSize=8;
                                                         FontBold=Yes;
                                                         FontUnderline=Yes;
                                                         SourceExpr=CostingBold }
          }
           }
      }
       }
  }
  REQUESTFORM
  {
    PROPERTIES
    {
      Width=9020;
      Height=3410;
    }
    CONTROLS
    {
    }
  }
  CODE
  {
    VAR
      QtyOnHand@1000000000 : Text[30];
      QtyOnHandBold@1000000003 : Text[30];
      QtyOnPO@1000000001 : Text[30];
      QtyOnPOBold@1000000002 : Text[30];
      Costing@1000000004 : Text[30];
      CostingBold@1000000005 : Text[30];

    BEGIN
    END.
  }
}


_________________
David Singleton
Dynamics NAV Freelancer
Dynamics Book
Go-Live International


Top
 Profile E-mail WWW  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Mon Aug 17, 2009 8:35 pm 
Offline

Joined: Mon Aug 17, 2009 6:07 pm
Posts: 18
David Singleton wrote:
darrinkatz wrote:
David Singleton wrote:
For sure there are other option, for example you can have Bold and non bold controls in the same section and just print the one you want.


Hi David,

Would you willing to explain how to do this in Dynamics NAV 5.0, please? I would like to avoid separate sections if at all possible.

I sincerely appreciate your time.

Regards,
Darrin


I uploaded a sample report in the Download section, but I guess it takes a while to be visible.
For now here is the code.... The FOB is probably easier though.

Code: Select all
OBJECT Report 50099 Bold Fields on report
{
  OBJECT-PROPERTIES
  {
    Date=08/17/09;
    Time=[ 7:49:02 PM];
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
  }
  DATAITEMS
  {
    { PROPERTIES
      {
        DataItemTable=Table27;
        OnAfterGetRecord=BEGIN
                           CALCFIELDS(Inventory,"Qty. on Purch. Order");

                           IF Inventory < 100 THEN BEGIN
                             QtyOnHand := '';
                             QtyOnHandBold := FORMAT(Inventory);
                           END ELSE BEGIN
                             QtyOnHand := FORMAT(Inventory);
                             QtyOnHandBold := '';
                           END;
                           IF "Qty. on Purch. Order" < 100 THEN BEGIN
                             QtyOnPO := '';
                             QtyOnPOBold := FORMAT("Qty. on Purch. Order");
                           END ELSE BEGIN
                             QtyOnPO := FORMAT("Qty. on Purch. Order");
                             QtyOnPOBold := '';
                           END;
                           IF  "Costing Method" = "Costing Method"::FIFO THEN BEGIN
                             Costing := '';
                             CostingBold := FORMAT("Costing Method");
                           END ELSE BEGIN
                             Costing := FORMAT("Costing Method");
                             CostingBold := '';
                           END;
                         END;

        ReqFilterFields=No.;
        GroupTotalFields=No.;
      }
      SECTIONS
      {
        { PROPERTIES
          {
            SectionType=Header;
            PrintOnEveryPage=Yes;
            SectionWidth=18150;
            SectionHeight=1692;
          }
          CONTROLS
          {
            { 1000000001;Label  ;0    ;0    ;7500 ;423  ;FontSize=8;
                                                         FontBold=Yes;
                                                         CaptionML=ENU=Item }
            { 1000000002;TextBox;15000;0    ;3150 ;423  ;HorzAlign=Right;
                                                         SourceExpr=FORMAT(TODAY,0,4) }
            { 1000000003;TextBox;0    ;423  ;7500 ;423  ;SourceExpr=COMPANYNAME }
            { 1000000004;TextBox;17700;423  ;450  ;423  ;CaptionML=ENU=Page;
                                                         SourceExpr=CurrReport.PAGENO }
            { 1000000005;Label  ;16950;423  ;750  ;423  ;ParentControl=1000000004 }
            { 1000000006;TextBox;15900;846  ;2250 ;423  ;HorzAlign=Right;
                                                         SourceExpr=USERID }
          }
           }
        { PROPERTIES
          {
            SectionType=Header;
            PrintOnEveryPage=Yes;
            SectionWidth=18150;
            SectionHeight=1269;
          }
          CONTROLS
          {
            { 1000000009;Label  ;0    ;0    ;1500 ;846  ;ParentControl=1000000008;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000012;Label  ;1650 ;0    ;4500 ;846  ;ParentControl=1000000011;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000015;Label  ;6300 ;0    ;2250 ;846  ;ParentControl=1000000014;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000018;Label  ;8700 ;0    ;1800 ;846  ;ParentControl=1000000017;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
            { 1000000021;Label  ;10650;0    ;1800 ;846  ;ParentControl=1000000020;
                                                         VertAlign=Bottom;
                                                         FontBold=Yes;
                                                         MultiLine=Yes }
          }
           }
        { PROPERTIES
          {
            SectionType=Body;
            SectionWidth=18150;
            SectionHeight=423;
          }
          CONTROLS
          {
            { 1000000008;TextBox;0    ;0    ;1500 ;423  ;HorzAlign=Left;
                                                         SourceExpr="No." }
            { 1000000011;TextBox;1650 ;0    ;4500 ;423  ;HorzAlign=Left;
                                                         SourceExpr=Description }
            { 1000000014;TextBox;6300 ;0    ;2250 ;423  ;HorzAlign=Left;
                                                         FontSize=8;
                                                         SourceExpr=Costing }
            { 1000000017;TextBox;8700 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=8;
                                                         SourceExpr=QtyOnHand }
            { 1000000020;TextBox;10650;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=8;
                                                         SourceExpr=QtyOnPO }
            { 1000000000;TextBox;10650;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=9;
                                                         FontBold=Yes;
                                                         FontUnderline=Yes;
                                                         SourceExpr=QtyOnPOBold }
            { 1000000007;TextBox;8700 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                         FontSize=8;
                                                         FontBold=Yes;
                                                         FontUnderline=Yes;
                                                         SourceExpr=QtyOnHandBold }
            { 1000000010;TextBox;6300 ;0    ;2250 ;423  ;HorzAlign=Left;
                                                         FontSize=8;
                                                         FontBold=Yes;
                                                         FontUnderline=Yes;
                                                         SourceExpr=CostingBold }
          }
           }
      }
       }
  }
  REQUESTFORM
  {
    PROPERTIES
    {
      Width=9020;
      Height=3410;
    }
    CONTROLS
    {
    }
  }
  CODE
  {
    VAR
      QtyOnHand@1000000000 : Text[30];
      QtyOnHandBold@1000000003 : Text[30];
      QtyOnPO@1000000001 : Text[30];
      QtyOnPOBold@1000000002 : Text[30];
      Costing@1000000004 : Text[30];
      CostingBold@1000000005 : Text[30];

    BEGIN
    END.
  }
}



Hi David,

Thanks for this. I see what you mean now.

Regards,
Darrin


Top
 Profile E-mail  
 
 Post subject: Re: Dynamically change fields properties in report
PostPosted: Fri Aug 28, 2009 6:05 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Aug 14, 2001 7:01 am
Posts: 5315
Location: Prague
Country: Czech Republic (cz)
I see its in the download section now.

Print dynamically selected columns in bold on report

_________________
David Singleton
Dynamics NAV Freelancer
Dynamics Book
Go-Live International


Top
 Profile E-mail WWW  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: