Can I get the custom paper 'KIND' from C1FlexReport?

Posted by: yasuike-na on 27 May 2019, 10:19 pm EST

    • Post Options:
    • Link

    Posted 27 May 2019, 10:19 pm EST

    Hi,

    I’m wondering if i can get the custom paper ‘KIND’ from C1FlexReport.

    System driver has it as a combination of System.Drawing.Printing.PaperSize.Kind and System.Drawing.Printing.PaperSize.RawKind,

    and i found maybe the C1FlexReport.Layout.PaperSize is same to System.Drawing.Printing.PaperSize.Kind.

    Does C1FlexReport has System.Drawing.Printing.PaperSize.RawKind?

    Thanks in advance.

    Best Regard.

  • Posted 28 May 2019, 3:19 am EST

    Hi,

    check C1FlexReport.DefaultPrintOptions.PageSettings.PaperSize => there are properties “Kind” and “RawKind”.

    Hope this helps

    Wolfgang

  • Posted 28 May 2019, 4:41 am EST

    Hello,

    Yes, you can fetch the Kind and RawKind properties of PaperSize in a report using options.PageSettings.PaperSize property, where options is a C1PrintOptions instance.

    Please refer the attached application showing the same. Here, we set the PaperSize to A5 first and then observe the values of Kind and RawKind properties.

    Thanks,

    Esha

    prj_FlexReport_PaperSize.zip

  • Posted 28 May 2019, 4:53 am EST

    Thank you for reply but I couldn’t find he .DefaultPrintOptions in my C1FlexReport.

    My environment is below.

    C1FlexReportDesigner.4 Application(64 bit mode)

    C1FlexReportDesigner.4 version 4.0.20172.271

    C1.C1Pdf.4 version 4.0.20172.271

    C1.Win.4 version 4.0.20172.271

    C1.Win.BarCode.4 version 4.0.20172.271

  • Posted 28 May 2019, 8:36 pm EST

    Thank you esha,

    but i wanna know which paper is selected by the C1FlexViewer’s user.

    I’d like to add below.

    1. open a C1FlexViewer.
    2. click and open the page setting window on the ribbon of it.
    3. select unpopular paper like 11x17inchs.
    4. wanna know which paper is selected.
  • Posted 29 May 2019, 3:51 am EST

    Hi,

    “DefaultPrintOptions” was maybe added in 4.0.20173.291 - the readme mentions this addition for C1.Win.C1Document, but as C1FlexReport subclasses C1DocumentSource, I assume it was introduced as part of this change.

    But I don’t know whether this property helps to resolve your “RawKind” issue…

    Best regards

    Wolfgang

  • Posted 29 May 2019, 4:02 am EST

    Thank you Wolfgang,

    4.0.20173.291 …version issue again…

    I cannot update because of the contract with customer.

    but Thank you again Wolfgang.

  • Posted 29 May 2019, 8:01 am EST

    Hello,

    You cannot control what happens through the Page Setup dialog. Allow me to explain.

    The ribbon buttons cannot be completely accessed as per their functioning and hence, the changes made to the Page Setup dialog values cannot be grasped explicitly. This does not allow to fetch the specified paper size and hence, the corresponding paper details.

    Thanks.

  • Posted 4 June 2019, 3:58 am EST

    Hi Esha,

    Can I try 4.0.20173.291 and buy it if its DefaultPrintOptions feature works?

    (I know the free 30days trial service of the latest version, but I want minimum change.)

  • Posted 4 June 2019, 5:25 am EST

    Ive found that I can try each version via ComponentOneControlPanel20191.1.24.exe.

    Thank you.

  • Posted 4 June 2019, 8:48 pm EST

    Hi,

    Ive installed 4.0.20181.296 because I couldnt find 4.0.20173.291 in the choices of ComponentOneControlPanel20191.1.24.exe.

    and then convert my VB.NET project using the bundled tool,

    but compilation failed saying ‘Your license expired in 12.2017. To use this version, please renew your license and rebuild the application.’

    Can’t I use it 30days for free?

  • Posted 5 June 2019, 12:30 am EST

    Sorry for many reply, but compilation is now OK after uninstalled the preinstalled ComponentOne4.0.20172.271.

  • Posted 5 June 2019, 5:24 am EST

    Sorry again, but

    at last,

    Ive found the C1FlexReport.DefaultPrintOptions.PageSettings.PaperSize.RawKind property with ver20181.1.296.

    and we tested it.

    but,

    even if we select a paper type by the ribbon menu of C1FlexViewerDialog,

    the value of C1FlexReport.DefaultPrintOptions.PageSettings.PaperSize.Kind and RawKind are not changed…

    This action is not linked to DefaultPrintOptions…?

  • Posted 7 June 2019, 4:28 am EST

    Hello,

    The “Page Setup” button on the ribbon behaves the same in all cases and as I mentioned earlier, does not allow to fetch the specified paper size and hence, the corresponding paper details.

    Instead, you can create a custom RibbonButton, create a PageSetupDialog instance and use it to perform the required operation of fetching the paper Kind and RawKind. This is done as follows:

    
    Private Sub btnPageSetup_Click(sender As Object, e As EventArgs)
          Dim pageSetupDialog As New PageSetupDialog()
          pageSetupDialog.PageSettings = New PageSettings()
          pageSetupDialog.PrinterSettings = New PrinterSettings()
    
          Dim result As DialogResult = pageSetupDialog.ShowDialog()
          If result = DialogResult.OK Then
              C1FlexReport1.Layout.PaperSize = pageSetupDialog.PageSettings.PaperSize.Kind
              C1FlexReport1.Render()
              Console.WriteLine("PaperKind: " & pageSetupDialog.PageSettings.PaperSize.Kind)
              Console.WriteLine("RawKind: " & pageSetupDialog.PageSettings.PaperSize.RawKind)
          End If
      End Sub
    
    

    A sample showing the same is attached for your reference.

    Thanks,

    Esha

    prj_FlexReport_PageSetup.zip

  • Posted 11 June 2019, 12:17 am EST

    Hi, Esha.

    Thank you what good idea! I didn’t aware of it.

    I’m gonna try it.

    Naoki.

Need extra support?

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

Learn More

Forum Channels