Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Friday, March 30, 2012

jump to URL and ReportParameters

Hi all...
Is there a way to set the format of a date parameter to day/month/year ?
I´m using jump to URL to navigate to another report by setting up the action
property of textbox to:
= Globals!ReportServerUrl & "?/Folder/ReportOne&InitialDate=" &
Parameters!InitialDate.Value
PS.: the language property of textbox is Portuguese (brazil)
... but in URL of "ReportOne" the date is converted to another format
(month/day/year)...
Could anyone help me?
thanks a lotPlease check the Readme file of Reporting Services 2000 SP1 or SP2:
http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_new_url_access_parameters
You need to specify the ParameterLanguage URL parameter.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ricardo" <ricardo@.fundep.br> wrote in message
news:eQ23gAWuFHA.252@.TK2MSFTNGP09.phx.gbl...
> Hi all...
> Is there a way to set the format of a date parameter to day/month/year ?
> I´m using jump to URL to navigate to another report by setting up the
> action property of textbox to:
> = Globals!ReportServerUrl & "?/Folder/ReportOne&InitialDate=" &
> Parameters!InitialDate.Value
> PS.: the language property of textbox is Portuguese (brazil)
> ... but in URL of "ReportOne" the date is converted to another format
> (month/day/year)...
> Could anyone help me?
> thanks a lot
>sql

Jump to URL - Javascript

We are displaying reports in a PDF format through an aspx page.
I have put and URL link in an report as follows to open a new
window(cotaining another report)
="javascript:void(window.open('http://localhost/ReportViewer/ReportFrame.aspx?rptPath=REPORTPATH&args="
& REPORTARGS &
"','GraphDetail','left=50,top=50,width=800,height=580,menubar=no,resizable=yes,scrollbars=Yes,status=yes,toolbar=0'))"
When the report is displayed for the first time...the URL link works fine. I
get an security msg from adobe reader saying document is trying to open this
link ..asks to block or allow...when i click Allow ..the new window
opens(with the report). But when i close this new window and reclick the
link...it does not work.
I have been stuck in this for 4 days now...i am not getting what is the
issue...
The aspx page has frames...but i do not see any issue with that either...i
am tried with a simple aspx page...same issue...i have tried allowing
pop-ups ...etc
I think this is issue with adobe reader ..because if i display the report
in HTML format...the link works fine...opens every time i click it!!!!.
Has anyone has had any similar issues!!!!...
Can anyone help me ...all i want to do is...open a link in new window from
an deployed PDF report ...link is an aspx page with a new detail report.
Thanks.Hi,
my jump to link is similar and working.
my link is like this..
="javascript:" &
IIF(Fields!Acked.Value = 1,"void(0)",
"var sRS='" & Globals!ReportServerUrl &
"';void(window.open(sRS.substring(0,sRS.indexOf('/ReportServer')) +
'/rtreporting/acknowledge.aspx?FilterID=" & Fields!FILTERID.Value &
"&prmServer=" & Fields!SERVER.Value & "&prmStartDate=" &
Format(Parameters!prmDateFrom.Value,"yyyy-MM-dd HH:mm:ss") & "&prmEndDate=" &
Format(Parameters!prmDateTo.Value,"yyyy-MM-dd HH:mm:ss") & "','_blank'))")
can you use Globals!ReportServerUrl instead of localhost.
also try using _blank parameter and make it default size..
"Sunny" wrote:
> We are displaying reports in a PDF format through an aspx page.
> I have put and URL link in an report as follows to open a new
> window(cotaining another report)
> ="javascript:void(window.open('http://localhost/ReportViewer/ReportFrame.aspx?rptPath=REPORTPATH&args="
> & REPORTARGS &
> "','GraphDetail','left=50,top=50,width=800,height=580,menubar=no,resizable=yes,scrollbars=Yes,status=yes,toolbar=0'))"
>
> When the report is displayed for the first time...the URL link works fine. I
> get an security msg from adobe reader saying document is trying to open this
> link ..asks to block or allow...when i click Allow ..the new window
> opens(with the report). But when i close this new window and reclick the
> link...it does not work.
> I have been stuck in this for 4 days now...i am not getting what is the
> issue...
> The aspx page has frames...but i do not see any issue with that either...i
> am tried with a simple aspx page...same issue...i have tried allowing
> pop-ups ...etc
> I think this is issue with adobe reader ..because if i display the report
> in HTML format...the link works fine...opens every time i click it!!!!.
> Has anyone has had any similar issues!!!!...
> Can anyone help me ...all i want to do is...open a link in new window from
> an deployed PDF report ...link is an aspx page with a new detail report.
> Thanks.

Monday, March 26, 2012

Julian Dates

I want to derive a date from a string field where the string will have the date embeded in the following format YYJJJ, for example 02364 = Dec 30 2002. Is there a way to do this using Transact-Sql via Sql Server?-- If it where in a procedure
DECLARE @.strDate varchar(5)
DECLARE @.dtDate smalldatetime

SET @.strDate = '02364'

SET @.dtDate = DATEADD(dd, CAST(RIGHT(@.strDate, 3) AS integer) - 1, CONVERT(smalldatetime,'01/01/' + LEFT(@.strDate, 2), 3))

SELECT @.dtDate

-- Using within a query
CREATE TABLE #tmp_mydates (mydate varchar(5))

INSERT INTO #tmp_mydates VALUES ('02364')
INSERT INTO #tmp_mydates VALUES ('02264')
INSERT INTO #tmp_mydates VALUES ('02164')
INSERT INTO #tmp_mydates VALUES ('02004')
INSERT INTO #tmp_mydates VALUES ('02002')

SELECT mydate, DATEADD(dd, CAST(RIGHT(mydate, 3) AS integer) - 1, CONVERT(smalldatetime,'01/01/' + LEFT(mydate, 2), 3)) AS myconverteddate FROM #tmp_mydates|||I want to derive a date from a string field where the string will have the date embeded in the following format YYJJJ, for example 02364 = Dec 30 2002. Is there a way to do this using Transact-Sql via Sql Server?

Q1 [Is there a way to do this using Transact-Sql via Sql Server?]
A1 You may consider creating your own derived "JulianDate" user datatype; and also creating your own user functions or stored procedures to properly interpet, convert to and from, and generally handle them as you might require. (I've found the strategy helpful in handling similar customized Julian date formats for special applications) For example:
dbo.fn_MyJulianDate_Add,
dbo.fn_MyJulianDate_Diff,
dbo.fn_ConvertStandardDate_To_MyJulianDate, dbo.fn_ConvertMyJulianDate_To_StandardDate,
etc.

Julian Datehelp :(

I have a julian date(04159) and I need to convert this to any normal date format yyyymmdd or mmddyy or basically anything that I can work with! I am just about fed up with trying to convert this. It would be simple enough if there want leap years. Does anyone have a function or something out there that can convert this for me? Code that I found on the web turned out to be bogus. Your help will be greatly appreciated. If you have something in VB that would work also. SQLServer preferably.

ThanksIt may be off by a day or so, but it's a start:

select dateadd(day, cast(reverse(cast(reverse('04159') as char(3))) as int), '01/01/' + cast('04159' as char(2)))|||Yeah...Thats sorta where I left off in my efforts. Thanks for your input. I will eventually get it...Hopefully someone in here will see this and have something.|||This is ancient old code, from when SQL 2000 was still in beta, but I think it works. Give this a try:CREATE FUNCTION dbo.f_jDate(@.piJdate INT) RETURNS DATETIME AS
BEGIN
RETURN DateAdd(day, (@.piJdate % 1000) - 1, Convert(DATETIME
, CASE WHEN @.piJdate < 50000 THEN '20' ELSE '19' END
+ Replace(Str(@.piJdate / 1000, 2), ' ', '0') + '-01-01'))
END-PatP|||Thanks Pat....That worked perfectly! Your my hero for the day!

Julian Date

A table that I am querying from has the date field in julian date format "04194". I am only wanting to pull the information from this table that is => than todays date. Maybe some of you have done this before and can give a little help in finding the best way to do this?You could take today's date and subtract it from the first day of the year (DATEDIFF ( datepart , startdate , enddate ) ) to give you an int value for the day of the year (actually day of year -1 since 20040101 - 20040101 = 0). Then convert to a 3 character value and concatinate the two digit year to the front and ... tadaaa ... the julian date.|||? I am not following you?|||You can get the Julian date using:SELECT 1000 * (DatePart(yy, GetDate()) % 100) + DatePart(dy, GetDate())If you need it in character format, you can use:SELECT Replace(Str(
1000 * (DatePart(yy, GetDate()) % 100) + DatePart(dy, GetDate()), 5), ' ', '0')After you've got that, the rest should just be a simple compare.

-PatP|||Or you could go the other way so you can utilize all of SQL Server's functions

DECLARE @.julian char(5), @.gregorian datetime
SELECT @.julian = '04194'
SELECT @.gregorian = DATEADD(dd,CONVERT(int,SUBSTRING(@.julian,3,3)),CON VERT(datetime,'20'+SUBSTRING(@.julian,1,2)+'/01/01'))
SELECT DATEDIFF(dd,GetDate(),@.gregorian)|||Perfect!...Thanks for your help. I was going about it the wrong way. I was trying to convert the julian date and then compare.|||Thanks also Brett That was a road I was eventually going to have to cross.|||udf's...Makes a perfect house warming gift

CREATE FUNCTION udf_JulianToGregorian(@.julian char(5))
RETURNS datetime
AS
BEGIN
DECLARE @.gregorian datetime
SELECT @.gregorian =
DATEADD(dd,CONVERT(int,SUBSTRING(@.julian,3,3))
,CONVERT(datetime
,CASE WHEN SUBSTRING(@.julian,1,2) BETWEEN '00' AND '50'
THEN '20'
ELSE '19'
END
+SUBSTRING(@.julian,1,2)+'/01/01'))
RETURN @.gregorian
END
GO

DECLARE @.julian char(5)
SELECT @.julian = '04194'
SELECT dbo.udf_JulianToGregorian(@.julian)
GO

JPG image does not render in Report Manager

A JPG image does not render in Report Manager but does when I export the report to PDF format. Also it renders fine in VS.NET Preview mode.
I have tried deleting the image and redeploying it to the Report Server but with no success! I don't know what else to do.
Can anyone help me with this one please?There have been several threads on this newsgroup about problems with images
not showing up in HTML rendering.
Most likely the machine name of the report server contains a character like
"_", which causes problems with finding the image streams by IE. This is not
an issue in Reporting Services, but in Internet Explorer - related to
security patch MS01-055. Details are available at:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q316112
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"PeteJ" <PeteJ@.discussions.microsoft.com> wrote in message
news:588EF768-BD27-46E3-9FA1-4ECDF62CC444@.microsoft.com...
> A JPG image does not render in Report Manager but does when I export the
report to PDF format. Also it renders fine in VS.NET Preview mode.
> I have tried deleting the image and redeploying it to the Report Server
but with no success! I don't know what else to do.
> Can anyone help me with this one please?sql

Friday, February 24, 2012

Join question

I was curious as to which format everyone is using for sql joins between tables. At my last couple jobs we used "*=", but wondering how many people are using the "inner join" format. Is one more accepted that the other or is it more personal preference? Personally i find that the *= way is easier to understand but that is most likely due to my past exposure to it.

I also find the =* format much easier to use. Microsoft are trying to force a change to the ANSI format but making the =* format to be specifically enabled with SQL2005.

Monday, February 20, 2012

Join problem

hi

I have got two tables and each table has about 8000000 rows..

the format of the tables is as follows....

Table 1

Comnpany_name Id Year Volume_jan Volume_feb....... Volume_dec

ABC 1 2000 12 34 44

ABC 2 2000 222 50 44

.........................................................................................................................

Table 2

Comnpany_name Id Year Volume_jan Volume_feb....... Volume_dec

VVV 1 2001 125 12 44

VVV 2 2001 22 500 441

.........................................................................................................................

Now i need to make a report out of these tables which should be of the following format

Comnpany_name Id Year Volume_jan Volume_feb....... Volume_dec

ABC 1 2000 12 34 44

ABC 2 2000 222 50 44

.VVV 1 2001 125 12 44

VVV 2 2001 22 500 441

........................................................................................................................

how shall i do this because when i try to run the report in business intelligance , it takes forever to process and doesnt even produce any result

I dont have any indexes on my table as i dont have any primary key..

Pls help me nad suggest as to how should i manage such huge tables?

Select * From Table1

UNION

Select * From Table2

This assumes that the fields in both tables are in the same order and type compatible.

|||

so u mean to say that if i do this query the data from table 2 will appear to be appended to table1?

because i dont want the repeated column names

for ex company name should appeat only once

|||

Yes, data from table two will be appended. The names for the columns will be taken from the select statement for table 1. The names of the columns from table 2 are ignored, the only requirement is for the column types to be compatible. The first column specified in the select statement for the second table will be matched to the first columns in the select statement for table1.