Wrong Date Format (locale) in SQL Server Reporting Services Report - ssrs-2008

I am unable to solve an issue with a report on SSRS.
The scenario is : a link in a Silverlight application loads a new web page containing a Microsoft.Reporting.WebForms.ReportViewer control. The parameters for the control are passed in the QueryString to the new page.
If the date is passed as 01/08/2011, when the report is loaded, the date control on the report viewer has the value 08/01/2011 (i.e. it has been converted to American format and my locale is United Kingdom, en-GB).
This only happens in the deployed solution, it works correctly in Visual Studio on my local PC. My IE settings are correct.
I made the following checks on the deployed IIS Server (IIS 6.0):-
The security account for the relevant Application Pool = Network Service.
In the Registry the SID for this user is S-1-5-20 so I checked the registry settings under HKEY_USERS > S-1-5-20 > Control Panel > International . These were all correctly set for United Kingdom. Although theoretically they should not have an effect I also checked the same settings for Local System (S-1-5-18) and NT-Authority (S-1-5-19) which were identical.
I next checked the Culture and UI Culture on the web site. These were as follows: -
Right-click website - Properties > ASP.NET.
Click the 'Edit Global Configuration' button to check the server config settings.
Select the Application tab and view the values for Culture and UI Culture.
Both values are set as en-GB. So OK.
Did the same in the 'Edit Configuration' button which is for viewing/editing the specific application's config file.The websites' config file values will supercede the server config file values. These are also OK.
Next I checked the SSRS Server.
Service runs under 'Local System' account.
Registry settings for this account are correct HKEY_USERS > S-1-5-18 > Control Panel > International.
S-1-5-19 and S-1-5-20 also correct
ReportServer.aspx page directive includes Culture="en-GB"
(e.g. <%# Page Language="C#" AutoEventWireup="true" Inherits="Microsoft.ReportingServices.WebServer.ReportViewerPage" Culture="en-GB"%>)
In code the parameter values are set using Microsoft.Reporting.WebForms.ReportViewer.SetParameters(ms.ReportParameter []) and ms.ReportParameter(name, value, visible) and the parameters are definitely the correct value when they are received at this point by the web app (when I step through in code).
I don't know where to turn next. The one difference I have but I can't imagine it is the problem is that the querystring is URLEncoded on the deployed version but not in the design on my local PC i.e
[server version]
...%26END_DATE%3d31%2f07%2f2012+00%3a00%3a00%26START_DATE%3d01%2f08%2f2011+00%3a00%3a00
[local version]
...&END_DATE=31/07/2012+00:00:00&START_DATE=01/08/2011+00:00:00
I would be extremely GRATEFUL for any suggestions that anyone has.

If you pass in the date in dd-mmm-yyyy format then it is unabiguous, eg 18-Jan-2011.

Related

How to automatically load a report on home page after logged in Jasper Server Community

In Jasper Server Community Edition, I want to load a report automatically without clicking on any report when I logging. I tried to add below code to home.jsp page as jasperSoft documentation says.but it is not working.
Please help me with this.
Code that I added to home.jsp :-
<%
<authz:authorize ifAllGranted="ROLE_REPORT_HOME">
<c:redirect
url="http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2Freports&reportUnit=%2Freports%2FSample_Dash_Report&standAlone=true"/>
</authz:authorize>
%>
Please make sure to follow all the steps in the tutorial, as you probably missed to add user role to the user you want. Also, make sure to have sample data as you're referencing report from sample data.
Setting a report as the home page:
The following example shows how to set a report as the home page based on a role. This example uses the 01. Geographic Results by Segment Report.
First, set up the role and create a sample user:
a. Create the role you want to use, for example, ROLE_REPORT_HOME.
b. Create a user HomeUser and add ROLE_REPORT_HOME to HomeUser.
Open the file \WEB-INF\jsp\modules\home\home.jsp in an editor and add the following lines:
<authz:authorize ifAllGranted="ROLE_REPORT_HOME">
<c:redirecturl="http://localhost:8080/jasperserver-pro-601/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Fpublic%2FSamples%2FReports&reportUnit=%2Fpublic%2FSamples%2FReports%2F01._Geographic_Results_by_Segment_Report"/>
</authz:authorize>
To find the URI for the report you want to use, open the report in the repository and copy the URI.
Save the modified file and restart the application server to see changes.
Log into JasperReports Server as HomeUser. The library page is displayed.
Go to Jasper server installation directory and search for jasperserver-servlet.xml (C:\Jaspersoft\jasperreports-server-cp-6.4.2\apache-tomcat\webapps\jasperserver\WEB-INF\jasperserver-servlet.xml)
Under bean id = "homePageByRole" we have to make changes. For that, search homePageByRole word inside the jasperserver-servlet.xml file.
Under tag ,we can give a report link we need according to the user roles. But make sure you should add amp; as after each & mark. Otherwise it will give an error!
Example:-
Original report link from the address bar in browser when report opened using jasper server is;
http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Landscape&standAlone=true
But the link we should put under is;
ROLE_USER|redirect:/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Landscape&standAlone=true
check how we add as amp; after every & mark. Also we can set user role. In my case I set user role as ROLE_USER.
Whole code snippet is;
<bean id="homePageByRole" class="java.util.ArrayList">
<constructor-arg index="0" type="java.util.Collection">
<list>
<value>ROLE_ADMINISTRATOR|redirect:/flow.html?_flowId=searchFlow</value>
<value>ROLE_USER|redirect:/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Landscape&standAlone=true</value>
</list>
</constructor-arg>
</bean>

How to get name of report used by different user in jasperserver

I am using jasper server enterprise version 7.0. Multiple users login to the server I can get the user name by using parameter - LoggedInUsername. But how can i get which report is used by the Logged in user. Is there any method to do so or is there any workaround for this?
Inside a report template (JRXML), you can get its own name calling $P{JASPER_REPORT}.getName():
And this is what you see when it's published to the server (6.4.2 in my case):
As you can see from the screenshot, the report file name and report name do not necessarily have to match.
For further details, see: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRParameter.html#JASPER_REPORT

How to change multiple Urls at once in Postman?

I have 10+ requests in my Postman collection.
Each time when testing on my local server and testing server I have to change urls from 'localhost:8000' to 'test.mysite' manually.
Is there any solution to change all of them at once ?
You can do this using the 'manage environments' feature - This can be accessed using the icon under the Send/Save button.
Add a new environment file and set the key to 'url' and the value to 'localhost:8000' - make sure you give the file a name before saving. Go back to your request and select the new file in the drop down menu - This will currently say 'No Environment'. Once you’ve selected your file, replace the url string with {{url}}/your-route and hit send. This should now send the local request.
Repeat again but this time add the test server value to the 'url' key. Once that’s in place, all you need to do is switch between the 2 environment files when making requests.
More information about this can be found here https://github.com/DannyDainton/All-Things-Postman/blob/master/Examples/02_createEnvironmentFile.md

AX 2012 Labels in SSRS Unbound Parameter

I have a SSRS report in AX 2012 with a parameter, where Values is set to "Unbound Values" (Non-queried). In the popup for adding values, I have added a couple of lines with a value and a label like the following:
Value: MainAccountId,
Label: =Labels!#SYS135766
But when I preview (or run the report from AX after deploying), the text "Labels!#SYS135766" is shown as label in the dropdown on the dialog (instead of "Main account").
I have also tried with "Labels!#SYS135766" and "#SYS135766", but with no luck.
Does anyone know how to get the label ID translated to a text using unbound parameter values?
I know this is an old question, but still posting the possible answer hoping that it can help.
Cite from a post by Namukoa Isaac:
Reasons for the problem:
You have moved your AX service account from AX domain account from AX domain admin group
You have changed your SSRS service account password.
Solutions:
From the Start menu, point to All Programs, click the SQL Server folder, click theConfiguration Tools folder, and then click Reporting Services Configuration Manager.
In Reporting Services Configuration Manager click Connect and then click Service Account.
Set the password and then click Apply. The account and password should be the same as the Microsoft Dynamics AX proxy account.
System will ask you to backup your encrytion key, and then will some settings on the backhand.
Now Click the ServerName/MSSQLSERVER on the left top of the reporting server and then click Stop. Then click Start to restart the server. Always check with the SQL administrator and make sure no other users are connected to the server before you restart the server.

Requesting Report with URL Parameters

My issue is exactly the same as Mr. John Ortega's described here.
However, both of the proposed solutions have not worked for me.
If I replace "Report.aspx" with "ReportViewer.aspx" in the Report Manager URL (ex: "http://servername/Reports/Pages/Report.aspx?ItemPath=%2fFolder+1+Name%2fFolder+2+Name%2fReport+Name"), I'm given a 404.
If I use the Web Service URL structure instead (ex: "http://servername/Reports?/Folder 1 Name/Folder 2 Name/Report Name"), I just get redirected back to the home page of my report server (which is "http://servername/Reports/Pages/Folder.aspx").
So I'm not really given an opportunity to pass report parameters via URL parameters, because the report itself won't come up.
If your requirement to jump to any other report in the same report server and directory, you can use “go to report” option instead of using “go to URL”.