Results 1 to 2 of 2

Thread: DataReport .Font.Size big problem - URGENT

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    Romania
    Posts
    3

    Question DataReport .Font.Size big problem - URGENT

    Hy,

    Can anyone tell me what it is wrong whit the code below ?

    I am having some labels that i want to set font size to a specific value.
    Code:
            DataReport1.Sections("section4").Controls("destinatar1").Font.Size = 8
    worck's fine

    Code:
            DataReport1.Sections("section4").Controls("destinatar2").Font.Size = 8
    * NOT WORKING * - it takes the font size of
    Code:
             DataReport1.Sections("section1").Controls("Label5").Font.Size
    WHY ????
    PLS HELP

    Here it' a pease of my code:

    Code:
            DataReport1.Sections("section4").Controls("destinatar1").Caption = Adodc1.Recordset("nume") & " " & Adodc1.Recordset("prenume")
            DataReport1.Sections("section4").Controls("destinatar1").Font.Italic = False
            DataReport1.Sections("section4").Controls("destinatar1").Font.Bold = False
            DataReport1.Sections("section4").Controls("destinatar1").Font.Size = 8
            
            DataReport1.Sections("section4").Controls("destinatar2").Caption = Adodc1.Recordset("Strada") & " " & Adodc1.Recordset("Nr") & " " & Adodc1.Recordset("blsiap")
            DataReport1.Sections("section4").Controls("destinatar2").Font.Italic = False
            DataReport1.Sections("section4").Controls("destinatar2").Font.Bold = False
            DataReport1.Sections("section4").Controls("destinatar2").Font.Size = 8
            
    
    Dim ItalicFont, BoldFont As String
    Dim MarimeFont, AliniamentFont, CuloareFont As String
    
    Open "C:\program\header.dat" For Input As #1 Len = 32767
        If Not EOF(1) Then  ' Verific daca fisierul nu este gol
            Line Input #1, ItalicFont
            Line Input #1, BoldFont
            Line Input #1, MarimeFont
            Line Input #1, AliniamentFont
            Line Input #1, CuloareFont
        End If
    Close 1
                
            DataReport1.Sections("section1").Controls("LabelHeader").Caption = frmMain.RichTextBox2.Text
            DataReport1.Sections("section1").Controls("LabelHeader").Font.Italic = ItalicFont
            DataReport1.Sections("section1").Controls("LabelHeader").Font.Bold = BoldFont
            DataReport1.Sections("section1").Controls("LabelHeader").Font.Size = MarimeFont
           
            DataReport1.Sections("section1").Controls("LabelHeader").ForeColor = CuloareFont
            DataReport1.Sections("section1").Controls("LabelHeader").Alignment = AliniamentFont
    
    
    
    Open "C:\pif_garantie\Date\header.dat" For Input As #1 Len = 32767
        If Not EOF(1) Then  
            Line Input #1, ItalicFont5
            Line Input #1, BoldFont5
            Line Input #1, MarimeFont5
            Line Input #1, AliniamentFont5
            Line Input #1, CuloareFont5
        End If
    Close 1
                
            DataReport1.Sections("section1").Controls("Label5").Caption = frmMain.RichTextBox2.Text
            DataReport1.Sections("section1").Controls("Label5").Font.Italic = ItalicFont5
            DataReport1.Sections("section1").Controls("Label5").Font.Bold = BoldFont5
            DataReport1.Sections("section1").Controls("Label5").Font.Size = MarimeFont5
            DataReport1.Sections("section1").Controls("Label5").ForeColor = CuloareFont5
            DataReport1.Sections("section1").Controls("Label5").Alignment = AliniamentFont5
             
            
    Open "C:\pif_garantie\Date\continut.dat" For Input As #1 Len = 32767
        If Not EOF(1) Then 
            Line Input #1, italicfont1
            Line Input #1, boldfont1
            Line Input #1, marimefont1
            Line Input #1, AliniamentFont1
            Line Input #1, culoarefont1
        End If
    Close 1
                
            DataReport1.Sections("section1").Controls("Label1").Caption = frmMain.RichTextBox1.Text
            DataReport1.Sections("section1").Controls("Label1").Font.Italic = italicfont1
            DataReport1.Sections("section1").Controls("Label1").Font.Bold = boldfont1
            DataReport1.Sections("section1").Controls("Label1").Font.Size = marimefont1
            DataReport1.Sections("section1").Controls("Label1").ForeColor = culoarefont1
            DataReport1.Sections("section1").Controls("Label1").Alignment = AliniamentFont1
            
                
            DataReport1.Show vbModal

  2. #2
    Member putts's Avatar
    Join Date
    Dec 2002
    Location
    Frankenmuth, MI
    Posts
    34
    Haven't done this before, but I'd try to verify that what you're trying to set the font.size to is for sure a number.

    E.G. In ASP or VB you'd do a cint(marimefont).

    I know Crystal is very picky on assigning values that are type mismatches.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width