C1TrueDBGrid PrintInfo Questions

Posted by: s.wortmann on 11 April 2022, 8:26 am EST

    • Post Options:
    • Link

    Posted 11 April 2022, 8:26 am EST - Updated 3 October 2022, 10:32 pm EST

    Hi,

    I’m using C1.Win.C1trueDBGrid (4.5.20221.548) and Visualstudio 2015 with VB.

    I’m trying to create a PrintInfo.Preview

    In Picture: C1TrueDBGrid.PrintInfo_Picture01.PNG youo can see how I “open” by code the PrintInfo.PrintPreview.

    In Picture C1TrueDBGrid.PrintInfo_Picture02.PNG you can see the result.

    Is it possible to remove the Open-Button by code?

    In Picture C1TrueDBGrid.PrintInfo_Picture03.PNG you can see a dialog, this dialog apperars If I click on Save-As. Is it possible to remove that dialog by code?

    Hopefully it’s not explained too complicated.

    Best regards and thanks a lot in advance

    Stephan





  • Posted 12 April 2022, 4:40 am EST

    Hi Stephan,

    To customize the Print preview form, you can easily create a custom preview form by inheriting the PrintForm class. Then, you can assign your Custom preview form to the C1TrueDBGrid.PrintInfo.PreviewFormClassName property. To hide the “Open File” button from your preview form, you can set its Visible property to false. To disable the Export options dialog box, you can set the ShowOptions property of that ExporterOption to false. Kindly refer to the attached sample showing the same.

    Best Regards,

    Kartik

    PrintPreviewCustomize_TDBG.zip

  • Posted 12 April 2022, 5:10 am EST - Updated 3 October 2022, 10:32 pm EST

    Dear Kartik,

    Thanks for your fast reply.

    Unfortunately, the sample in VB gives me an error as you can see in the attached file.

    The message:

    Couldn’t process file Form1.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file. Remove the mark of the web if you want to process these files.

    Maybe I do something wrong.

    Many Thanks

    Stephan

  • Posted 12 April 2022, 5:19 am EST

    Hi Stephan,

    Kindly refer to the link below which states the cause for this issue. Please try to un-block the Form1.resx file by following the steps mentioned in the link.

    https://stackoverflow.com/questions/51348919/couldnt-process-file-resx-due-to-its-being-in-the-internet-or-restricted-zone-o

    Kind Regards,

    Kartik

  • Posted 12 April 2022, 5:31 am EST

    Hi Kartik,

    it works fine now.

    I should have researched too, please excuse my ignorance.

    Best regards

    Stephan

  • Posted 12 April 2022, 7:57 am EST

    Hi Kartik,

    two more questions:

    Is it possible to set the DefaultProvider e.g. to C1.C1Preview.Export.XlsxExportProvider ?

    I tried:

    c1PrintPreviewControl.PreviewPane.ExportOptions.DefaultProvider = C1.C1Preview.Export.XlsxExportProvider, but this is not possible

    Is it possible to set some options of the hidden ShowOptions Dialog by code?

    Best regards

    Stephan

  • Posted 13 April 2022, 5:07 am EST

    Hi Stephan,

    1. You can use the C1PrintPreviewControl.ExportOptions.DefaultProvider property to set a DefaultProvider for the Export.

    2. If you want to set the options on the Export options dialog form without showing the form, you can easily create your own ExportProvider by inheriting the required ExportProvider and registering it in the available ExportProviders. Then, you can override its NewExporter method to create and customize the Exporter that contains all the properties available on the options dialog form.

    Kindly refer to the attached sample showing the same.

    Best Regards,

    Kartik

    PrintPreviewCustomize_TDBG_CustomProvider.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels