Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsGenerate report from a formGenerate report from a form
Previous
 
Next
New Post
3/9/2012 12:19 PM
 
I would think this is a common request, but I couldn't find it after browsing and searching.  I know how to generate a report and add URL parameters.  I would like to be able to have a form where the user can enter in a date range and then submit it and generate the report from the options.  Should be simple, right?
 
New Post
9/9/2017 5:10 PM
 
I have done this many, many times. Here are a few ways to approach this task.

Option 1: Using a form to filter the report data.

You can do this by putting a form on your page that presents your date range options. On submit, configure the form to reload the page with the user's chosen dates in the URL as URL Querystring Parameters. 

For example, the form would create a url like this: http://MySite.com/MyRportPage.aspx/FromDate/1-1-2017/ToDate/12-31-2017

(you may need to format the date a bit differently than my example, I'm not sure about that format with the dashes)

Then in the report settings you enter corresponding parameters in the section called, "Allowed URL Parameters."  In this example, you would add FromDate,ToDate in that section. Include the comma in between but be sure there are no spaces.

Lastly, you need to include your parameters in your query design  in the report settings. There is a small adjustment that you need to know. When you type the name of your querystring parameters, put the following text in front of each one: "@url_"  So, in our current example, our query might be similar to:

SELECT Orders.* FROM Orders WHERE Orders.OrderDate>=@url_FromDate AND Orders.OrderDate<=@url_ToDate

That's it. This should work. Users are happy.

Option 2: Filter with simple links

If your report filters are simple and rather fixed, you can skip the whole form, and simply create links in an html module on the same page that include the querystring parameters in the link itself. For example, Consider two links, one for year 2017 and one for year 2018. The links could be coded like:

[a href="http://MySite.com/MyRportPage.aspx/FromDate/1-1-2017/ToDate/12-31-2017" target="_self"]Year 2017[/a]
[a href="http://MySite.com/MyRportPage.aspx/FromDate/1-1-2018/ToDate/12-31-2018" target="_self"]Year 2018[/a]

You would then set up the report settings the same way as described above. But now you do not need to create a form.

As for the forms. You can use just about any form generator module, such as Live Forms, Dynamic Forms, Helferlein, Action Form, XMod Pro etc. There are many more.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsGenerate report from a formGenerate report from a form


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out