Home Devices

Excel file with variable column width

edited September 2016 in Devices

Hi

Using RB 17.02 but I don't think this is a version issue.

We have been trying to define a report so that when exporting it to
Excel via XLSReport the columns would be of specific widths, ie. widths
that are compatible with the type and amount of data in the specific
column.
But no matter how we try to disable autowidth etc. we keep on getting
an Excel file with all columns of the same default width.
Could you please direct us to (or attach) a sample report which when
exported using XLSReport will have columns of different widths.

Best regards,
Kjell

Comments

  • edited September 2016
    Hi Kjell,

    The XlsxData and XlsData devices export the data in a simple column format.
    For details check out RBuilder Help topics for TppXlsxDataDevice or
    TppXlsDataDevice

    The XlsxReport and XlsReport devices export reports honoring the element
    page position. The cells are merged to accommodate variable widths and a
    fixed narrow column width is used because most reports have complex
    formatting. For the report layout, set the Lable/DBText AutoSize to False
    and size the width of the element to the desired size. For more details
    check out RBuilder Help topics for TppXlsxReportDevice or TppXlsReportDevice




    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2016
    Nard Moseley (Digital Metaphors) wrote:


    Hi Nard and thank you for your reply.

    I am not sure I follow you however in the second paragraph.
    Say eg. that I have this sample report layout. (AutoSize set to False
    for the labels)

    Col1 Column2WithVeryLongText Column3Midsize

    Now ideally I would like that the Excel sheet resulting from this would
    have three columns with different widhts. But regardless of what we do
    we get three columns with the same narrow width in the resulting Excel
    file. That is I don't really see the effect of this in your reply:
    "AutoSize to False and size the width of the element to the desired
    size"


    Is there a working sample for this somewhere?

    Best regards,
    Kjell
  • edited September 2016
    HI Kjell,

    Create a simple report like that.

    Export to XlsData/XlsxData, the Excel spreadsheet will have 3 variable width
    columns

    Export to XlsReport/XlsxReport, the Excel spreadsheet will have fixed narrow
    width columns. Each of the 3 element widths will be
    honored by merging adjacent cells.

    I only mentioned setting Label/DBText AutoSize to False because that
    provides better results for both of the above outputs.




    Best regards,

    ---
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.