Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Reed 1 post 82 karma points
    Jul 07, 2017 @ 11:20
    Mark Reed
    1

    Custom Umbraco Forms Export to file

    I have been trying to follow the documentation for adding a custom export type at: https://our.umbraco.org/documentation/Add-ons/UmbracoForms/Developer/Extending/Adding-a-Exporttype using the advanced example but I am getting an error relating to the following line:

        var submissions = FormRecordSearcher.QueryDataBase(filter);
    

    The error is as follows: 'FormRecordSearcher' does not contain a definition for 'QueryDataBase'

    I was initially using Umbraco forms 4.1.4 on Umbraco 7.2.8 but upgraded to 4.4.2 as I noticed the documentation states that it applies to 4.4.1 and higher but upgrading has made no difference.

    Can anyone let me know what I may be doing wrong (or if the documentation is incorrect what I should replace the line in question with)?

  • Tobias Klika 101 posts 570 karma points c-trib
    Jul 13, 2017 @ 08:49
    Tobias Klika
    0

    Hi! I am currrently experiencing the same issue. What I've done know is searching in the codebase (via JustDecompile) how they have implemented it with their own Excel File export type.

    Well, they are using QueryDataBase, but have changed FormRecordSearcher to be internal. Awesomeee ...

    Here is the screen for the code: enter image description here

    Well, internal stays internal. So we either have to find a new way or re-implement the missing method. I will try both methods and get back to you once I am done.

  • Tobias Klika 101 posts 570 karma points c-trib
    Jul 13, 2017 @ 09:28
    Tobias Klika
    101

    Got it. I've extracted the FormRecordSearcher class from the Forms project and replicated it.

    Was pretty straightforward, as I only had to revert a few things from the IL code.

    Please see this gist for the class: Gist for fixed FormRecordSearcher

    Just drop the class into your project and call the public method with FormRecordSearcherPublic.QueryDataBase(...).

    :-)

    PS. I do not know if there's a new or better way to get the results from DB. But as this project (Umbraco.Forms) is not open source and the documentation is outdated, I guess it was at least the fastest way - without reading through the whole IL code.

Please Sign in or register to post replies

Write your reply to:

Draft