in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Custom ExportProvider

Last post 09-30-2008 8:02 PM by bryanzs. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-11-2008 3:09 PM

    Custom ExportProvider

    Can I add a new (Custom) ExportProvider to the ExportOptions in C1.Win.C1PrintPreview control?

    I actually want to change the XlsExportProvider to a CsvExportProvider.
    I want the SaveDialog to have (Microsoft Excel (*.csv) in it rather than Microsoft Excel (*.xls).
    And I want to do the actual export manually.

    I have found the ExportProvider class and the IExportProvider interface and I created a CsvExportProvider but I cannot assign it or add it to the list of ExportProviders.
    Is there a way to do this?

    I'm using the v1.0.20062.327 of C1PrintPreview (.NET 1.1)

    Thanks

    Willy

  • 02-27-2008 10:25 AM In reply to

    Re: Custom ExportProvider

    No, unfortunately I don't think there's a way for you to add your export provider to the list used by the built-in file save dialog.

    The good news is that you can replace the standard file save logic with your own, and there you can of course add your own export provider to the list. The standard providers are available via the static C1.C1PrintDocument.Export.ExportProviders.AvailableProviders. The standard file save in preview calls the AvailableProviders.GetExportProvidersForObject(document) method to get the list of providers that can export the specified document (there are some restrictions - namely, not all providers support .NET PrintDocument). Then the FileSave method in the preview builds the list of formats for the SaveFileDialog based on that list, and calls the Export method on the selected exporter - you could do the same. Let me know if that's not clear enough or you need more info.

    Cheers,
    Dima.
  • 09-30-2008 8:02 PM In reply to

    Re: Custom ExportProvider

    Dima (or anyone else who may have tried this) -

    If I override the default "File Save" dialog, and implement my own, is there any way to still have the various Export providers 'options dialog' appear?  It seems that calling the c1printdocument.export saves the data, but doesn't show the standard dialog first.

    Thanks,
    Bryan

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.