Changing column width programatically in crystal report

Posted on 2007-10-19
Last Modified: 2012-08-14
I'm using 05 and i have a simple click command to create a crystal report and then print it.  Here's my code:

  Private Sub btnSearchPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearchPrint.Click

        crystalReport11.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape
        crystalReport11.PrintToPrinter(1, True, 0, 1)
 End Sub

Now it prints just fine, but the columns have a predetermined width, which cuts off some of the text.  I want to know if I can tell it which columns will be what width?      
Question by:DustinHinkel
    LVL 100

    Accepted Solution

    You can but then you would have to move the columns that are to the right.

    Is this an existing report?
    YOu can set the field to grow.  they will grow vertically.

    LVL 27

    Assisted Solution

    If you want to set the width of a field programmatically, you can do it using the ReportObjects, and
    the name of the field, for example:

            Dim cr As New CrystalReport1()
            cr.ReportDefinition.ReportObjects("Column11").Width = 5000


    Author Comment

    thanks guys.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now