Hi, I've got this ssrs 2005 report that works great passing a few
security related parameters from asp.net codebehind. However, there
are two date related parameters that won't be coming from my web form,
but rather from the report form itself. When I test the report's date
parameters from visual studio it work fine, but when I attempt the
same report from a reportviewer no matter what input I place on the
report's date fields or even if I select the date picker, the report
simply resets to default and reloads. And actually the date picker
from the reportviewer does not not even pop up.
Here's my aspx code:
<%@. Page Language="VB" AutoEventWireup="false"
Inherits="_ReportViewer" MasterPageFile="~/Main/MasterPage.master"
CodeFile="~/Reports/CashSales.aspx.vb" Title="Cash Sales" %>
<%@. Register Assembly="Microsoft.ReportViewer.WebForms,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content1"
runat="Server">
<rsweb:ReportViewer BackColor="Transparent" ZoomMode="PageWidth"
Width="100%" ProcessingMode="Remote" ID="ReportViewer1"
runat="server">
<ServerReport ReportPath="/Retailer/CashSales"
ReportServerUrl="http://myserver/reportserver" />
</rsweb:ReportViewer>
</asp:Content>
the code behind:
Imports system.web.security.membership
Imports system.web.security.Roles
Imports Microsoft.Reporting.Webforms
Note: I'm only passing the parameters that are not coming from the
reportviewer form.
Partial Class _ReportViewer
Inherits System.Web.UI.Page
Private Users As New Retailer.Core()
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
Dim Roles() As String = GetRolesForUser(Page.User.Identity.Name.ToString)
Dim cred As New Retailer.ReportServerCredentials("myuser",
"mypassword", "mydomain")
ReportViewer1.ServerReport.ReportServerCredentials = cred
Dim param As New ReportParameter("r_user",
Page.User.Identity.Name.ToString)
Dim param2 As New ReportParameter("r_role", Roles(0))
Dim p() As ReportParameter = {param, param2}
ReportViewer1.ServerReport.SetParameters(p)
ReportViewer1.ServerReport.Refresh()
End Sub
End Class
on my reportviewer form, at the top I have parameters for startdate
and end date, they are not set to internal or hidden.
thanks for any help or information.update on this. I see I am getting a javascript error, but it then
loading the report. How can I troubleshoot this? I've got disable i.e
script debugging turned off on i.e 7.0, but where would i place this
javascript to trap the error.
debugger; // execution will break here
to see the errors in VS.NET.
my report viewer in on a contentpage.
I see others have had a similar problem.
thanks for any help or information!|||More on this..
I noticed I get a javascript error when click on the calendar select:
Line: 606
Object Required
When I attempt to debug I get a Just-In-time failed : Unspecified
error. Check the documentation index for 'Just-in-time debugging,
errors' for more information.
and if I enter anything in the date fields, it disregards them and
loads with the defaults.
Could it be that I'm not sending security information when these built
in javascript functions are called?
thanks again.
Showing posts with label passing. Show all posts
Showing posts with label passing. Show all posts
Thursday, March 29, 2012
Date range parameters don't work in reportviewer?
Date question, Can I get Q1, of 2006 begin and end dates?
I would like to get the first and last day of a quarter by passing in todays
date.
I can get the quarter were in with
select (DATEPART(Quarter,GetDate()))
Now I want to get the day the quarter started (Min day of the quarter) and
the Last day of the quarter (Max day of the quarter) i.e. 4/1/06 and 6/30/06
.
Tall MikeUse a calendar table.
http://www.aspfaq.com/2519
"TallMike" <TallMike@.discussions.microsoft.com> wrote in message
news:62668B64-9559-46FA-98CB-03E781C4B55F@.microsoft.com...
>I would like to get the first and last day of a quarter by passing in
>todays
> date.
> I can get the quarter were in with
> select (DATEPART(Quarter,GetDate()))
> Now I want to get the day the quarter started (Min day of the quarter)
> and
> the Last day of the quarter (Max day of the quarter) i.e. 4/1/06 and
> 6/30/06.
>
> --
> Tall Mike|||Either of these sring expressions can easilty be converted to a
datetime. I figured that they would be more easily understood without
wrapping them in that.
select convert(char(4),datepart(year,getdate())
) +
CASE DATEPART(Quarter,GetDate())
WHEN 1 THEN '0101'
WHEN 2 THEN '0401'
WHEN 3 THEN '0701'
WHEN 4 THEN '1001'
END as QuarterStartString,
convert(char(4),datepart(year,getdate())
) +
CASE DATEPART(Quarter,GetDate())
WHEN 1 THEN '0331'
WHEN 2 THEN '0630'
WHEN 3 THEN '0930'
WHEN 4 THEN '1231'
END as QuarterEndString
Roy Harvey
Beacon Falls, CT
On Wed, 3 May 2006 13:36:02 -0700, TallMike
<TallMike@.discussions.microsoft.com> wrote:
>I would like to get the first and last day of a quarter by passing in today
s
>date.
>I can get the quarter were in with
>select (DATEPART(Quarter,GetDate()))
>Now I want to get the day the quarter started (Min day of the quarter) and
>the Last day of the quarter (Max day of the quarter) i.e. 4/1/06 and 6/30/06.[/colo
r]|||Check this out, it works
select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0) as 'Last Q ended'
select DATEADD(qq, DATEDIFF(qq,0,getdate())-1, 0) as 'Last Q started'
Tall Mike
"Roy Harvey" wrote:
> Either of these sring expressions can easilty be converted to a
> datetime. I figured that they would be more easily understood without
> wrapping them in that.
> select convert(char(4),datepart(year,getdate())
) +
> CASE DATEPART(Quarter,GetDate())
> WHEN 1 THEN '0101'
> WHEN 2 THEN '0401'
> WHEN 3 THEN '0701'
> WHEN 4 THEN '1001'
> END as QuarterStartString,
> convert(char(4),datepart(year,getdate())
) +
> CASE DATEPART(Quarter,GetDate())
> WHEN 1 THEN '0331'
> WHEN 2 THEN '0630'
> WHEN 3 THEN '0930'
> WHEN 4 THEN '1231'
> END as QuarterEndString
> Roy Harvey
> Beacon Falls, CT
> On Wed, 3 May 2006 13:36:02 -0700, TallMike
> <TallMike@.discussions.microsoft.com> wrote:
>
>|||On Wed, 3 May 2006 15:25:02 -0700, TallMike
<TallMike@.discussions.microsoft.com> wrote:
>Check this out, it works
>select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0) as 'Last Q ended'
>select DATEADD(qq, DATEDIFF(qq,0,getdate())-1, 0) as 'Last Q started'
Very nice! It came pretty close, but the Last Q ended was April 1,
not March 31.
But it didn't need much work.
select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)-1 as 'Last Q ended'
select DATEADD(qq, DATEDIFF(qq,0,getdate())-1, 0) as 'Last Q started'
Roy Harvey
Beacon Falls, CT
date.
I can get the quarter were in with
select (DATEPART(Quarter,GetDate()))
Now I want to get the day the quarter started (Min day of the quarter) and
the Last day of the quarter (Max day of the quarter) i.e. 4/1/06 and 6/30/06
.
Tall MikeUse a calendar table.
http://www.aspfaq.com/2519
"TallMike" <TallMike@.discussions.microsoft.com> wrote in message
news:62668B64-9559-46FA-98CB-03E781C4B55F@.microsoft.com...
>I would like to get the first and last day of a quarter by passing in
>todays
> date.
> I can get the quarter were in with
> select (DATEPART(Quarter,GetDate()))
> Now I want to get the day the quarter started (Min day of the quarter)
> and
> the Last day of the quarter (Max day of the quarter) i.e. 4/1/06 and
> 6/30/06.
>
> --
> Tall Mike|||Either of these sring expressions can easilty be converted to a
datetime. I figured that they would be more easily understood without
wrapping them in that.
select convert(char(4),datepart(year,getdate())
) +
CASE DATEPART(Quarter,GetDate())
WHEN 1 THEN '0101'
WHEN 2 THEN '0401'
WHEN 3 THEN '0701'
WHEN 4 THEN '1001'
END as QuarterStartString,
convert(char(4),datepart(year,getdate())
) +
CASE DATEPART(Quarter,GetDate())
WHEN 1 THEN '0331'
WHEN 2 THEN '0630'
WHEN 3 THEN '0930'
WHEN 4 THEN '1231'
END as QuarterEndString
Roy Harvey
Beacon Falls, CT
On Wed, 3 May 2006 13:36:02 -0700, TallMike
<TallMike@.discussions.microsoft.com> wrote:
>I would like to get the first and last day of a quarter by passing in today
s
>date.
>I can get the quarter were in with
>select (DATEPART(Quarter,GetDate()))
>Now I want to get the day the quarter started (Min day of the quarter) and
>the Last day of the quarter (Max day of the quarter) i.e. 4/1/06 and 6/30/06.[/colo
r]|||Check this out, it works
select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0) as 'Last Q ended'
select DATEADD(qq, DATEDIFF(qq,0,getdate())-1, 0) as 'Last Q started'
Tall Mike
"Roy Harvey" wrote:
> Either of these sring expressions can easilty be converted to a
> datetime. I figured that they would be more easily understood without
> wrapping them in that.
> select convert(char(4),datepart(year,getdate())
) +
> CASE DATEPART(Quarter,GetDate())
> WHEN 1 THEN '0101'
> WHEN 2 THEN '0401'
> WHEN 3 THEN '0701'
> WHEN 4 THEN '1001'
> END as QuarterStartString,
> convert(char(4),datepart(year,getdate())
) +
> CASE DATEPART(Quarter,GetDate())
> WHEN 1 THEN '0331'
> WHEN 2 THEN '0630'
> WHEN 3 THEN '0930'
> WHEN 4 THEN '1231'
> END as QuarterEndString
> Roy Harvey
> Beacon Falls, CT
> On Wed, 3 May 2006 13:36:02 -0700, TallMike
> <TallMike@.discussions.microsoft.com> wrote:
>
>|||On Wed, 3 May 2006 15:25:02 -0700, TallMike
<TallMike@.discussions.microsoft.com> wrote:
>Check this out, it works
>select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0) as 'Last Q ended'
>select DATEADD(qq, DATEDIFF(qq,0,getdate())-1, 0) as 'Last Q started'
Very nice! It came pretty close, but the Last Q ended was April 1,
not March 31.
But it didn't need much work.
select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)-1 as 'Last Q ended'
select DATEADD(qq, DATEDIFF(qq,0,getdate())-1, 0) as 'Last Q started'
Roy Harvey
Beacon Falls, CT
Thursday, March 8, 2012
Date format passing parameter to WebService
Hi Lads,
I'm having this wee problem with the date format of a parameter - I'm
building a list of the needed parameters on a web page (determined from the
report) via the API, I have set the report to English(Ireland), I assumed
this would take care of the date format (dd/MM/yyyy) rightly or wrongly I'm
not too sure - reigonal settings on my PC are the same. The problem that I
have is that when I pass back the date 30/09/2005 it comes back with an error
- any suggestions? they would be most appreciated.You can use strings instead DateTime, and you will avoid any TimeZone
convertion and reginal settings.
Jerry
http://www.rdlcomponents.com
"Rowan Massey" wrote:
> Hi Lads,
> I'm having this wee problem with the date format of a parameter - I'm
> building a list of the needed parameters on a web page (determined from the
> report) via the API, I have set the report to English(Ireland), I assumed
> this would take care of the date format (dd/MM/yyyy) rightly or wrongly I'm
> not too sure - reigonal settings on my PC are the same. The problem that I
> have is that when I pass back the date 30/09/2005 it comes back with an error
> - any suggestions? they would be most appreciated.|||Hi Jerry,
Unfortunately I can't use strings! I actually build up parameters on the web
page depending on their type in the report itself! i.e. for datetime
parameters, I create a text box an image control next to it to popup a date
selection screen, for a string I create a textbox only etc. I'm trying to
make it as generic as possible so I only have to do this once!
"Jerry" wrote:
> You can use strings instead DateTime, and you will avoid any TimeZone
> convertion and reginal settings.
> Jerry
> http://www.rdlcomponents.com
> "Rowan Massey" wrote:
> > Hi Lads,
> >
> > I'm having this wee problem with the date format of a parameter - I'm
> > building a list of the needed parameters on a web page (determined from the
> > report) via the API, I have set the report to English(Ireland), I assumed
> > this would take care of the date format (dd/MM/yyyy) rightly or wrongly I'm
> > not too sure - reigonal settings on my PC are the same. The problem that I
> > have is that when I pass back the date 30/09/2005 it comes back with an error
> > - any suggestions? they would be most appreciated.
I'm having this wee problem with the date format of a parameter - I'm
building a list of the needed parameters on a web page (determined from the
report) via the API, I have set the report to English(Ireland), I assumed
this would take care of the date format (dd/MM/yyyy) rightly or wrongly I'm
not too sure - reigonal settings on my PC are the same. The problem that I
have is that when I pass back the date 30/09/2005 it comes back with an error
- any suggestions? they would be most appreciated.You can use strings instead DateTime, and you will avoid any TimeZone
convertion and reginal settings.
Jerry
http://www.rdlcomponents.com
"Rowan Massey" wrote:
> Hi Lads,
> I'm having this wee problem with the date format of a parameter - I'm
> building a list of the needed parameters on a web page (determined from the
> report) via the API, I have set the report to English(Ireland), I assumed
> this would take care of the date format (dd/MM/yyyy) rightly or wrongly I'm
> not too sure - reigonal settings on my PC are the same. The problem that I
> have is that when I pass back the date 30/09/2005 it comes back with an error
> - any suggestions? they would be most appreciated.|||Hi Jerry,
Unfortunately I can't use strings! I actually build up parameters on the web
page depending on their type in the report itself! i.e. for datetime
parameters, I create a text box an image control next to it to popup a date
selection screen, for a string I create a textbox only etc. I'm trying to
make it as generic as possible so I only have to do this once!
"Jerry" wrote:
> You can use strings instead DateTime, and you will avoid any TimeZone
> convertion and reginal settings.
> Jerry
> http://www.rdlcomponents.com
> "Rowan Massey" wrote:
> > Hi Lads,
> >
> > I'm having this wee problem with the date format of a parameter - I'm
> > building a list of the needed parameters on a web page (determined from the
> > report) via the API, I have set the report to English(Ireland), I assumed
> > this would take care of the date format (dd/MM/yyyy) rightly or wrongly I'm
> > not too sure - reigonal settings on my PC are the same. The problem that I
> > have is that when I pass back the date 30/09/2005 it comes back with an error
> > - any suggestions? they would be most appreciated.
Sunday, February 19, 2012
date conversion
i do have date problem in sql server, i m using DD/MM/YYYY date format, & passing it to insert & update stat...& compairing it with data in table, which is not working properly, how to convert dd/mm/yyyy to mm/dd/yyyy or yyyy-mm-dd
hoping for solution soon, thanx
murli .....
Use the yyyy-mm-dd format to interact with sql server, you will be safe.I think you are using a textbox to get the date from the user.
Try
Dim strDate() as String = txtDate.Text.Split("/"c)
if user inputs 06/08/2005
strDate(0) will contain 06
strDate(1) will contain 08
strDate(2) will contain 2005
You can now go on from here.
|||
thanx for ur reply ...
but its not working,
Dim strdate()AsString = hidDate.Value.Split("/"c)
it is not splitting date .. showing whole date at strdate(0). ...
Murli ....
|||
hidate is html hidden control having property runat=server assign to it ...
i have created function for that to change format using indexof & substring property ...
thanx 4 ur help ...
murli ...
Dim strdate()AsString = hidDate.Value.ToString.Split("/"c)
|||I had replied before... but I think there might be an error in submission.
Try
Dim strdate()AsString = hidDate.Value.ToString.Split("/"c)
|||Try using the convert function is SQL. Do a search on SQL Convert() and you should be able to do it without splitting the date.
Subscribe to:
Posts (Atom)