Thursday, March 8, 2012
Database Access from Assembly
The report runs fine from my local machine, but when I deploy to the report server, I get nothing back.
Is this a permission issue on the DLL, and if so, how do I get around it?
Thanks!
Dave
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.Did you read this article and apply proper settings in the .config files of
report server?
http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/dngrfCodeAccessSecurityInSQLServer2000ReportingServices.asp
You will also need to assert security permissions inside the custom
assembly. Every call that requires certain permissions (e.g. opening a
database connection) will fail on the server unless the required security
permissions for that call (documented in MSDN) have been asserted.
Example for opening a connection to a SQL Server:
...
SqlClientPermission permission = new
SqlClientPermission(PermissionState.Unrestricted);
try
{
permission.Assert(); // Assert security permission!
SqlConnection con = new SqlConnection("...");
con.Open();
...
}
You might also want to check out these links:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_rdl_0so6.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconAssert.asp
http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_prog_rdl_8wyq.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:%23C2jfaQXEHA.4000@.TK2MSFTNGP09.phx.gbl...
> I have an assembly that I call to supply parameters to a report. Within
the assembly, I make a connection to SQL server to supply the parameter.
> The report runs fine from my local machine, but when I deploy to the
report server, I get nothing back.
> Is this a permission issue on the DLL, and if so, how do I get around it?
> Thanks!
> Dave
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.
Friday, February 24, 2012
Data validation for datetime parameter in SSRS
Hi,
I wanted to know more about validation of SSRS parameters. I have a simple report which has a parameter called startdate of DateTime datatype. The datetime parameter in SSRS takes manual input as well. So, the user can enter any junk value. I want to ensure that the input parameter is in correct format and I want to display an error msg when the format is incorrect. My report has the following VB code for validation:
Public Function Validate( ByVal startdate As String) As Boolean
If IsDate(startdate) = True Then
Return True
Else
Return False
End If
End Function
And my report has a textbox which has the expression property set to;
=Code.Validate(Parameters!startdate.Value)
the textbox on the report has to display if the entered date is valid or not.
But, when i enter an erroneous date, SSRS doesn't render the report and throws a generic error. This happens even before the code written for validating the parameter executes.
Also couldn't find a way to disable the manual input for the datetime parameter. Even that would solve the problem.
Another alternative was to make the startdate parameter as string, but i want the calendar control button to be provided for the user.
The function below checks for the Start and End date ranges .
Function:
Function CheckDateParameters(StartDate as Date, EndDate as Date) as Integer
Dim msg as String
msg = ""
If (StartDate > EndDate) Then
msg="Start Date should not be later than End Date"
End If
If msg <> "" Then
MsgBox(msg, 16, "Report Validation")
Err.Raise(6,Report) 'Raise an overflow
End If
End Function
Steps:
1.) Go the Report Parameters and add a parameter with the datatype is string.
2.) Check the Hidden checkbox and Allow blank value ckeckbox.
3.) From Default Values choose Non-Queried radio button and then press the FX button and paste this code.
=CODE.CheckDateParameters(<parameterStartdate>.Value,<parameterEnddate>.Value)
Then press OK.
Hope this helps......|||In the sample that you provided, if we enter an improper date as 02/31/2003 [mm/dd/yyyy], then the report execution fails and an error is thrown right away "error occured during the processing of report parameter". I was talking of handling such errors.
I feel that reporting services, initially validates the entered value matches the datatype of the parameter and then proceeds with execution of any VB code and finally renders the report.
When I said validation, I wanted a functionality similar to the client side validation in an asp page, where improper date formats like 12/31/235668 etc can be taken care of.
Friday, February 17, 2012
Data Type - DateTime
displayed when attempting to run the report. The first two datetime
parameters causes no challenges until the third datetime parameter is added.
An error occurred during local report processing.
An error has occurred during report processing.
Cannot read next data row for the data set IPC_VISION_BCL.
Conversion failed when converting datetime from character string.Hi,
do the parameters are configured as datetime on the VS'
How do u get your dataset by SP'
usually i configure the date parameters as string and in the sp convert them
to the wright format...
"Terry" wrote:
> After adding four datetime related parameters, the following error is
> displayed when attempting to run the report. The first two datetime
> parameters causes no challenges until the third datetime parameter is added.
> An error occurred during local report processing.
> An error has occurred during report processing.
> Cannot read next data row for the data set IPC_VISION_BCL.
> Conversion failed when converting datetime from character string.
>
>