Report Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Codebug
    New Member
    • Feb 2008
    • 25

    Report Question

    is it possible to create a report formatting the detail of related data as follows

    Header data

    Detail-------------------------

    Item 1
    item 2
    Item 3

    Header data

    Detail-------------------------

    Item 1
    item 2
    Item 3


    This is how Id like it formated.


    Header data

    Detail--------------------------------

    Item1, Item2, Item 2


    Header data

    Detail--------------------------------

    Item1, Item2, Item 2
  • Scott Price
    Recognized Expert Top Contributor
    • Jul 2007
    • 1384

    #2
    Well, it's certainly possible but not necessarily easy. I know I've seen similar postings here on the site before on how to do just what you want. Try a couple of searches and see if you can find something.

    The only reason I can think of for doing such a thing (which generally degrades readability of the report IMHO) is to save paper. Is this your purpose?

    Regards,
    Scott

    Comment

    • Codebug
      New Member
      • Feb 2008
      • 25

      #3
      No, its the format thats required, not to save paper

      Comment

      • Scott Price
        Recognized Expert Top Contributor
        • Jul 2007
        • 1384

        #4
        A little known solution that gives you great flexibility is to make your controls invisible, and then use the .Print method to write your string directly to the report.

        This requires a little forethought and some fairly intensive programming, but allows you to do some pretty neat things with your reports.

        As an example, I'll paste in some code I have running behind a report.


        [CODE=vb]
        Dim Column8 As String
        Dim Col8PosX As Integer
        Dim Col8PosY As Integer

        Me.FontName = "Arial"
        Me.FontSize = 7
        Column8 = Nz(Me.Field56, "") ' 2nd phone
        Col8PosX = 0
        Col8PosY = 200

        If Column8 <> "" Then
        Me.CurrentX = Col8PosX
        Me.CurrentY = Col8PosY
        Me.Print Column8
        ElseIf Column8 = "" Or IsNull(Column8) Then
        Col8PosX = 0
        Col8PosY = 0
        End If[/CODE]

        This code is fairly self-explanatory. It requires that you initialize a variable to hold the string you wish to print, variables to hold the X and Y positions, and the FontName and FontSize you wish to use. The Me.Print takes a valid string or string variable and prints it at the X and Y position you pass into the CurrentX and CurrentY parameters. You will find that it's fairly easy to work with after playing around with it a little.

        Regards,
        Scott

        Comment

        • Codebug
          New Member
          • Feb 2008
          • 25

          #5
          Thanks, think it has put me on the right lines.

          Comment

          • Scott Price
            Recognized Expert Top Contributor
            • Jul 2007
            • 1384

            #6
            Great! If you need more help, give a holler :-)

            Regards,
            Scott

            Comment

            Working...