Print C1Flexreport without dataset

Posted by: saidnait-online-de on 27 September 2017, 9:11 pm EST

    • Post Options:
    • Link

    Posted 27 September 2017, 9:11 pm EST

    Hi all,

    I need to ask if there is a sample for printing a C1flexreport without a dataset(no table, no database). This means each populated field in the FlexReport will get his value from the Visualbasic application in .Net to be printed.

    Best regards

    Said

  • Posted 27 September 2017, 9:11 pm EST

    Hi Said,

    Of course, you can print a report which fetches the values from the .Net application without being bound to any data source.

    [vb]

    'Setting up the printer settings

    Dim options As C1PrintOptions = New C1PrintOptions()

    options.PrinterSettings = New PrinterSettings()

    options.PageSettings = New System.Drawing.Printing.PageSettings()

    options.PrinterSettings.PrinterName = “Printer Name”

    C1FlexReport1.Print(options)

    [/vb]

    Thanks,

    Pragati

  • Posted 27 September 2017, 9:11 pm EST

    Hi Pragati,

    Thank you for the quick reply. But how to send the value to each field that schould be printed in the Report. It is better if there is a sample how to do.

    I will explain a Little bit:

    1. I need to print one FlexReport. It is one page and all the values i read them from a Flexgrid and i must send them to the Report to be printed. The question is how to do?

    2. Sometimes i need to send a fix value that should be printed in a header/footer section.

    Best regards

    Said

  • Posted 27 September 2017, 9:11 pm EST

    Hi Said,

    Please refer the attached application implementing what you are looking for.

    Let me know if you still need any help.

    Thanks,

    Pragati

    2017/03/prj_FlexReport_ValuesFromCode.zip

  • Posted 27 September 2017, 9:11 pm EST

    Thanks for this, I have been struggling with a similar question and this just solved it. One question though, why do we have to use DirectCast to assign a text value to from a text field in our object?

    Regards

    Darrell

  • Posted 27 September 2017, 9:11 pm EST

    Hi Pragati,

    Perfect.

    Thanks

    Said

  • Posted 27 September 2017, 9:11 pm EST

    Hi Darrell,

    Since the fields placed in the report definition are actually added in the report’s Fields collection, they are needed to be directcasted to TextField object which represents a field containing a uniformly formatted databound or static text.

    Please refer the following documentation links for more information on this:

    http://helpcentral.componentone.com/nethelp/FlexReport/C1.Win.FlexReport.4~C1.Win.FlexReport.FieldBase.html

    http://helpcentral.componentone.com/nethelp/FlexReport/TextField.html

    ~Pragati

  • Posted 10 July 2018, 9:57 pm EST

    Hi Pragati;

    How can I get an Image to print. I have to this on the fly depending on what user selects from their hard drive. Used to work fine with C1Reports. I have text printing fine but cant get a small image to print. I do have a field defined on my Report. All I have to do is load image onto the image field

    Need help

    Sunil

Need extra support?

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

Learn More

Forum Channels