none
when i export a report to an excel file , the column header name using query title not report title ??

    Question

  • hi all

    when i export a report to an excel file , the column header name using query title not report title ??

    how to use same column header as in the report ?

    Regards

    Sunday, November 18, 2012 1:30 PM

Answers

  • Hi Syamand,

    Please go to the Design view of the rptFilter report. \

    I guess that the "Query Title" here is the Field displaying in the Detail part, and the "Report title" is the label appearing in the Page Header.  

    If this is the case, I am afraid that there is no way to directly "change" the header here in the excel expect via Excel PIA. 

    However, if you want to export a query to an excel file with custom field names, you can try to use DoCmd.TransferText method with the specification, and then open the file in excel, save the file as an excel file.

    Have a nice day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, November 20, 2012 9:40 AM

All replies

  • Hi Syamand,

    Welcome to the Access forum.

    How do you export the report? Via code or standard UI?

    I tested it on my computer with Access 2010 through ribbon button, and it shows the column header the same as the report. 

    Also, you mentioned a report exportation? Is there a query the same name as the report's name?

    Have a nice day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, November 19, 2012 5:35 AM
  • thank you for your reply 

    what i have , a form to filter data and show the data on a report , and on this report i have a button its code like below :

    On Error GoTo ErrorHandler
    DoCmd.OutputTo acOutputReport, "rptFilter", acFormatXLS, , False, "", , acExportQualityPrint
    Cleanup:
      Exit Sub
      
    ErrorHandler:
      Select Case Err.Number
        Case 2501
        Case Else
          MsgBox Err.Number & ": " & Err.Description
      End Select
      Resume Cleanup

    Monday, November 19, 2012 5:38 AM
  • Hi Syamand,

    Please go to the Design view of the rptFilter report. \

    I guess that the "Query Title" here is the Field displaying in the Detail part, and the "Report title" is the label appearing in the Page Header.  

    If this is the case, I am afraid that there is no way to directly "change" the header here in the excel expect via Excel PIA. 

    However, if you want to export a query to an excel file with custom field names, you can try to use DoCmd.TransferText method with the specification, and then open the file in excel, save the file as an excel file.

    Have a nice day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, November 20, 2012 9:40 AM