【问题标题】:Dynamically setting font-size using parameter in crystal report使用水晶报表中的参数动态设置字体大小
【发布时间】:2014-11-03 09:33:17
【问题描述】:

如何为水晶报表中的所有字段动态设置字体大小,以便使用一个参数用户可以更改整个报表的字体大小?

【问题讨论】:

    标签: crystal-reports


    【解决方案1】:

    您可以对所有字段/文本执行此操作。见下文:

    aa = Report.Sections.Item("D").ReportObjects.Count
    For i = 1 To aa
        Set crxFieldObject = Report.Sections.Item("D").ReportObjects.Item(i)
        bb = crxFieldObject.Name
        If Mid(bb, 1, 5) = "Field" Then
            cc = Val(Mid(bb, 6))
            For j = 1 To NumberOfFields 'your value
                If cc = xxxxx Then 'if your condition 
                    crxFieldObject.suppress = False
                    crxFieldObject.Left = Leftxxxx 'your value
                    crxFieldObject.Top = Topxxxx 'your value
                    crxFieldObject.Font.Size = Fontsizexxxx 'your value
                    TenPointHeight = 221 'you can change this, too
                    If crxFieldObject.Font.Size = 10 Then
                        crxFieldObject.Height = TenPointHeight
                    Else
                        crxFieldObject.Height = TenPointHeight * crxFieldObject.Font.Size / 10
                    End If
                End If
            Next j
        End If
    Next i
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多