Error Message In Set Datefirst 7 And Report Parameter
Nov 27, 2007
Hi,
I am setting my Dataset in SSRS to define the First Day of the week to Sunday.
So In the Dataset I put this scripting :
==================================
SET DATEFIRST 7;
SELECT city, country, datepart(wk,transactdate) as WeekNo from CatalogTable
==================================
The select statement above working very fine in the report.
But then, when I put in the Parameter which I have set in Report Parameter for a field called Service then I will get the problem.
For example the scripting below : ==================================
SET DATEFIRST 7;
SELECT city, country, datepart(wk,transactdate) as WeekNo from CatalogTable
where Service IN (@PService)
==================================
I have defined @PService in Report Parameter, and in the Parameter Tab in Dataset inside SSRS.
But it kept prompting me with the eror message :
Error Source : .Net SqlClient Data Provider
Error Message : Must declare the scalar variable "@PService".
When I remove the first line SET DATEFIRST 7; then my query working fine.
It seems SSRS cannot accept SET statement, whenever we insert the parameter in there.
Is there any workaround on this ?
In Sql Server 2008 R2, I am creating a procedure with multiple transactions in it. Try..Catch Block is used for each transaction. I use output parameter to catch the error code and message since it will be caught by the main program. But When there is errors the output parameter are not correct set to the error message and code?
create procedure xxx (@P_Return_Status VARCHAR(1) OUTPUT, @P_Error_Code INT OUTPUT,) AS BEGIN BEGIN TRY BEGIN TRANSACTION TR1 ..... COMMIT TRANSACTIOn TR1 END TRY
<b> Description: </b>An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. <br><br>
<b> Parser Error Message: </b>An error occurred loading a configuration file: Failed to start monitoring changes to 'c:inetpubwwwrootweb.config' because access is denied.<br><br>
<b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
</font>
</body> </html> <!-- [HttpException]: Failed to start monitoring changes to 'c:inetpubwwwrootweb.config' because access is denied. at System.Web.DirectoryMonitor.AddFileMonitor(String file) at System.Web.DirectoryMonitor.StartMonitoringFile(String file, FileChangeEventHandler callback, String alias) at System.Web.FileChangesMonitor.StartMonitoringFile(String alias, FileChangeEventHandler callback) at System.Web.Configuration.WebConfigurationHost.StartMonitoringStreamForChanges(String streamName, StreamChangeCallback callback) at System.Configuration.BaseConfigurationRecord.MonitorStream(String configKey, String configSource, String streamname) at System.Configuration.BaseConfigurationRecord.InitConfigFromFile() [ConfigurationErrorsException]: An error occurred loading a configuration file: Failed to start monitoring changes to 'c:inetpubwwwrootweb.config' because access is denied. (c:inetpubwwwrootweb.config) at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName) at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index) at System.Web.Configuration.RuntimeConfig.get_HealthMonitoring() at System.Web.Configuration.HealthMonitoringSectionHelper..ctor() at System.Web.Management.HealthMonitoringManager..ctor() at System.Web.Management.HealthMonitoringManager.Manager() at System.Web.Management.WebBaseEvent.RaiseRuntimeError(Exception e, Object source) at System.Web.HttpResponse.ReportRuntimeError(Exception e, Boolean canThrow, Boolean localExecute) at System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext context, Exception e) --> --. (Microsoft.ReportingServices.Designer)
I am extracting RS reports through a WebService: report = execService.Render("EXCEL", null, out extension, out mimeType, out encoding, out warnings, out streamIds);
Some works fine but some are generating the following SoapException:
Error during processing of €˜ReportParameterTime€™ report parameter. ---> Error during processing of €˜ReportParameterTime€™ report parameter. ---> Error during processing of €˜ReportParameterTime€™ report parameter. I set required parameters to their default values. In this specific report I have two required parameters: 1: ReportParameterTime, String 2: ReportParameter1, String
I set them to their default values (ReportParameterTime to "[Czas].[Kalendarzowy].[Rok].&[2007]" - means Time Calendar Year 2007) but I am getting the exception above. I set parameters using this code:
Where parameterValues is a List<ReportExecution2005.ParameterValue>.
When I am using Microsoft.Reporting.WinForms.ReportViewer the report is generated without any problems. I can see one parameter to choose: "Kalendarzowy" (means adj. Calendar) and can select years, the default value is "2007".
What am I doing wrong and how can I fix this error ? Does anybody know ?
Process information: Process ID: 1108 Process name: w3wp.exe Account name: NT AUTHORITYNETWORK SERVICE
Exception information: Exception type: ReportServerException Exception message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Request information: Request URL: http://hodb04/ReportServer/Reserved.ReportViewerWebControl.axd?ExecutionID=eidr1n55m03smr55uasdkba4&ControlID=ff4568201e0948da9615d136c680ec50&Culture=127&UICulture=9&ReportStack=1&OpType=SessionKeepAlive&TimerMethod=KeepAliveMethodReportViewerControlTouchSession0&CacheSeed=Fri Oct 19 12:55:37 2007 Request path: /ReportServer/Reserved.ReportViewerWebControl.axd User host address: 172.16.10.12 User: THRIFTYFOODSsruescher Is authenticated: True Authentication Type: Negotiate Thread account name: NT AUTHORITYNETWORK SERVICE
Thread information: Thread ID: 10 Thread account name: NT AUTHORITYNETWORK SERVICE Is impersonating: False Stack trace:
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
When try to run report, I receive this message:€œLogon failed.
For more information about this error navigate to the report server on the local server machine, or enable remote errors We just have Reporting Services server (2005) up and running, my roles are browser, Content Manager, My Reports, Publisher, Report Builder. I was able to deployed the report and set up data source. Connect using credentials supplied by suer running the report, and use as Windows credentails when connecting to the data source checked. Did a search on but can't find any messages that related to this problem. Please advise.
I have created a Report Model and published it on our QA environment Report Server(Where I dont have admin access). When I try to launch the Report Builder tool and create a sample report and Run the report it gives me this error. "The permissions granted to user 'Domainname/user group' are insufficient for performing this operation. (rsAccessDenied)" I checked with the Admins on this server the usergroup has a "Browser" Role. I had read on some online fourm that if user group has browser role it should work. But I cant get it work any help is appreciated.
I have published the same Report Model in Deveploment environment report server(where I have admin access) and when I do the same thing I am able to run the reports.
Some one please help me its causing delay in our testing.
Semantic query execution failed. Too many table names in the query. The maximum allowable is 256. Incorrect syntax near the keyword 'AS'. Incorrect syntax near the keyword 'AS'. Incorrect syntax near the keyword 'AS'. Incorrect syntax near the keyword 'AS'. Incorrect syntax near the keyword 'AS'. Incorrect syntax near the keyword 'AS'. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.
I have a crystal report that calls a stored procedure from SQL Server 2000. The only parameter I have is @A the SP is: -------------- CREATE PROCEDURE Final @A INT AS Declare @SQL VARCHAR(2000) SET @SQL = 'SELECT * FROM Schools where Areano = @A' EXEC(@SQL) GO
-------------
From the standard report creation wizard, i choose the data (SP). and select the SP, then i got window to enter a parameter values for @A, and i check ( Set to Null value), then press OK, the following error occured
I have a old report that was pointing to a different database, and i changed the connection string for that report and changed the field names (As per my new stored Procedure). In some places I keep getting this run time error, i have tried looking for all the hidden references to this field and i cannot find any parameter that the old database had. The error messages that i get are as follows:
[rsFieldReference] The Hidden expression for the table €˜tblContactInfo€™ refers to the field €˜PL_Admin_ShowInKit€™. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.
[rsFieldReference] The Hidden expression for the table €˜tblContactInfo€™ refers to the field €˜PL_FA_ShowInKit€™. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.
[rsFieldReference] The Hidden expression for the table €˜tblWithdrawals€™ refers to the field €˜PW_Comment€™. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.
Can Someone please help me out as to how should i get rid of these error messages, they are kinda driving me nuts.
I have been working on parameterised reports for quite a while and have a problem with a report that I cannot fathom despite days spent fiddling. I am hoping someone will be able to spot a silly mistake...
Basically, I am developing my report in VS2005 and it works perfectly. When I publish it to the reporting server I get an error: The 'pSite' parameter is missing a value.
I cannot understand why the report should fail when published.
Before anyone says it, yes I have deleted the published report and re-deployed so there should be no chance of any 'old' deployments messing things up!
Any obvious suggestions before I start posting code?!
I've got a report model I am trying to move from a development server to a production server. I published it to my development RS, exported the SMDL file, then uploaded it to the production server. At that point, I tried assigning the data source to the model and got the error:
We have a problem with DATEFIRST. Different users connecting to SQL 2005 and querying the value for DATEFIRST (SELECT @@DATEFIRST). Some users get 7 (Sun), others get 1 (Mon). What is giving rise to the different values ? (All users seem to have the same language settings in SQL and their regional settings are the same). This is impacting stored procs calling DATEPART that are run from within VB6 Apps using ADO.
I am passing the partameters to MS Report Viewer control to view the report. It is working fine with normal parameters like 'abc', 'Jon' etc. But fails with parameters having special characters like 'abc+', 'Version 1.1 Part 1', 'R1.8 RC' throws error " The parameter is missing a value"
My week starts on Monday rather than on Sunday which is default(US, English) in SQL Server and would like to change the same so I would get proper weeknumber and dayindex using DATEPART.
I am looking at different ways of setting DATEFIRST(SET DATEFIRST 1) in SQL Server 2005.
I could set in a stored procedure, but this isn't a feasible way for me because I am using .nettiers to generate by business objects and stored procedures. I need to alter the sp's everytime I newly generate the code and sp's.
I couldn't set it in a function which I was hoping initially. I understand this datefirst is stored in one of the sys table in MASTER DB and I couldn't find a straight forward way to change this.
Can anyone suggest me a way to set the DATEFIRST either at a database level or at a server level(probably by changing the sys table in MASTER DB).
So I need to select and average a whole bunch of data by week. Currently, I group by:GROUP BY TO_CHAR(m.ENDTIME, 'IW') and select using SELECT ... TO_CHAR(m.ENDTIME, 'IW') Week to summarize by week. Since the first day of the year was a monday, it sets the weeks as monday-monday. 2008 will start the week on Tuesday. I need to set the weeks to be Thursday 7pm to Thursday 7pm. How can this be achieved? I'm not sure if datefirst is the answer. Can it accept decimals? Is there another way to do this? I'm placing this query into a SqlDataSource selectcommand. Unfortunately I do not have the option of building a stored procedure. Thanks.
Hello, since a couple of days I'm fighting with RS 2005 and the Stored Procedure.
I have to display the result of a parameterized query and I created a SP that based in the parameter does something:
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE PROCEDURE [schema].[spCreateReportTest] @Name nvarchar(20)= ''
AS BEGIN
declare @slqSelectQuery nvarchar(MAX);
SET NOCOUNT ON set @slqSelectQuery = N'SELECT field1,field2,field3 from table' if (@Name <> '') begin set @slqSelectQuery = @slqSelectQuery + ' where field2=''' + @Name + '''' end EXEC sp_executesql @slqSelectQuery end
Inside my business Intelligence Project I created: -the shared data source with the connection String - a data set : CommandType = Stored Procedure Query String = schema.spCreateReportTest When I run the Query by mean of the "!" icon, the parameter is Prompted and based on the value I provide the proper result set is displayed.
Now I move to "Layout" and my undertanding is that I have to create a report Paramater which values is passed to the SP's parameter... So inside"Layout" tab, I added the parameter: Name allow blank value is checked and is non-queried
the problem is that when I move to Preview -> I set the value into the parameter field automatically created but when I click on "View Report" nothing has been generated!!
I had thought that this was possible but I can't seem to figure out the syntax. Essentially I have a report where one of the parameters is populated by a stored procedure.
Right now this is easily accomplished by using "exec <storedprocname>" as the query string for the report parameter. However I am not clear if it is possible to now incorporate User!UserID as parameter to the stored procedure. Is it? Thanks
I have a report parameter called para1 which is a drop-down list and what I want to do is display another report parameter based on the para1 selection.
So for example, para1 contains a, b, c choices. if a user selects b, I would like para2 to display but if the user selects a or c, I don't want the para2 to display.
I'll go to a dataset, open up the query designer, add a new parameter, then refresh the fields, but the parameter won't be added as a report parameter. If I go to the dataset properties under the list of parameters, the value in the dropdown will be blank. However, sometimes this will automatically add.Â
Is this a bug in Visual Studio? How do I get around this?Â
I have a procedure (a) where i call another procedure (b) passing @message as a parameter to procedure B.
Ex: Create procedure a as Begin declare @prevyear exec b @message = 'avvasdva' + cast(@prevyear as varchar) End
When i execute above procedure, i get error at + sign i.e. @message parameter. how can i concatenate string with another parameter when passing parameters
I have created a menu report listing available reports and am setting the Jump to settings of each text box in the list to take the user to the relevent report. But I am having a problem setting up drill down to reports with multivalued parameters.
What I want to happen when the user drills down is for the report to open up with no parameter values selected. This works for single value parameters where I have set Null as the default value. But I have not been able to figure out how to do this with MVPs. Does anybody know if this is possible?
As a workaround I have been using Jump to URL (rather than Jump to report), which has no problem opening the report without having to pass any values for the MPV. But I do not like using this as I use different DEV/UAT and PROD environments so would have to amend the URL for each environment.
Seems like this should be possible... Any idea?
Cheers, Mike
PS: I should add I can Jump to reports with MVP without specifying a parameter in development studio but not when the report is published.
I have an File System Task that copies a file from one directory ot another. When I hard code the target directory (c:dirfile.txt) it works fine. When I change it to a virtual directory (\serverdirfile.txt) I get a security error:
[File System Task] Error: An error occurred with the following error message: "Access to the path '\gracehbtest oS2TMM_Live_Title_000002.xml' is denied.".
I'm using MS Report Designer 2005 and have created a report that uses a cube, with a dimension set up to convert null values to unknown (nullProcessing = UnknownMember).
When I create a parameter using the checkbox in the graphical design mode's filter pane, Report Designer automatically sets the constrained flag, eg:
When running the report and selecting the 'Unkown' value from the parameter list, the error 'the restrictions imposed by the CONSTRAINED flag in the STRTOSET function were violated' occurrs.
How can I prevent the constrained flag from being used, or am I doing something wrong with converting null values to 'Unknown'?
I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:
[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".
The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:
<?xml version="1.0" encoding="UTF-8"?> <ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>
There is only 1 ESDU root element and only 1 package element.
Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:
OK so now I'm setting up a trigger to email info to different people based on values INSERTed into one of my tables. I'm using an IF statement to determine who I'm giong to send the mail to, but I don't really understand how to include the data (parameters) in my message. Thanks for any help. Here's what I have so far.
Code Block ALTER TRIGGER [smallin].[trig_test] ON [smallin].[DATALIST] AFTER INSERT AS declare @rc int, @post bit, @pre bit SELECT @post = [POST], @pre = [PRE] FROM inserted IF @post = 1 exec @rc = master.dbo.xp_smtp_sendmail @FROM = N'ln.li@mydomain.com', @FROM_NAME = N'Alert Mailer', @TO = N's.mallin@mydomain.com', @replyto = N'ln.li@mydomain.com', @CC = N'', @BCC = N'', @priority = N'NORMAL', @subject = N'This is post data', @message = N'Goodbye MAPI and Outlook', @messagefile = N'', @type = N'text/plain', @attachment = N'', @attachments = N'', @codepage = 0, @server = N'exchange.mydomain.com'
OK, I'm pretty sure that the answer to my questions is "no", but the boss is pushing, and I thought I'd double check.
I want the selection of one report parameter to decide what shows up for another report parameter. Specifically in my case it has to do with dates. I have narrowed the results down to monthly dates, meaning that the starting dates always start with mm/1/yyyy and the ending dates are always mm/31/yyyy (for a 31 day month).
The boss wants the ending dates to always be >= the month of the starting dates. So, if the user choose 1/1/2007 for starting, the minimum ending date would be 1/31/2007, etc.. Since the parameters are loaded at report initiation, and SSRS isn't really event driven, I didn't think this was possible. I just wanted to make sure before I tell the boss that it's not. Please advise.