Products

Solutions

Resources

Partners

Community

About

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 ForumsReportsReportsReports Module Query IssuesReports Module Query Issues
Previous
 
Next
New Post
11/1/2015 6:33 PM
 

The reports module is throwing exceptions for undeclared parameters that get parsed as DNN recognized values.  that is, we have parameters such as @PortalId and @UserId, which are parsed by DNN when the module query runs.

If these are added as allowed URL parameters in the module an error is thrown.  However, DNN recognizes these and gets the correct Portal Id, the logged in User ID, etc. as part of the process.

Here is one such query.  The module runs and does what it is supposed to.  If the variables are declared, this error is thrown:

There was an error executing the data source: There is an error in your SQL at line 2: The variable name '@PortalId' has already been declared. Variable names must be unique within a query batch or stored procedure. The variable name '@UserId' has already been declared. Variable names must be unique within a query batch or stored procedure. 

But if they aren't declared Log4net and the Event Log pile up exceptions that the variables are not declared.  As mentioned, using them as allowed URL parameters doesn't work. (I didn't think it would but had to try something).  This error happens if PortalId, UserId are entered as allowed URL parameters:

There was an error executing the data source: There is an error in your SQL at line 1: Incorrect syntax near 'nvarchar'. 

There isn't a lot of documentation on the module.  How are these exceptions to be avoided?  They can't be declared or put in as allowed parameters or the module shows an error, the Event Log / Log 4 Net loads up on errors if DNN is allowed to parse and use them.

SELECT 

'Your Total Donations: $' + CONVERT(VARCHAR(10), SUM(CONVERT(DECIMAL(8,2), (CONVERT(MONEY, CP.Free3))))) AS ' '

FROM dbo.CAT_OrderDetails COD

JOIN dbo.CAT_Orders CO

ON CO.OrderId = COD.OrderId

JOIN dbo.CAT_Products CP

ON CP.ProductId = COD.ProductID

JOIN dbo.UserPortals UP

ON UP.UserId = CO.CustomerId

AND PortalId = @PortalId

AND UP.userId = @UserId

 

GROUP BY UP.USERID


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsReports Module Query IssuesReports Module Query Issues


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