Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Friday, March 30, 2012

Jump to URL popup

I am trying to create a popup window from a report.
Looked thru some previous posts and generated this string in the "Jump to
url:"
="javascript:void(window.open('http://www.yahoo.com',
'popup','location=no,toolbar=no,left=100,top=100,height=600,width=800'))"
But when I try to preview the report I get,
Processing errors:
The url javascript:void(window.open('http://www.yahoo.com',
'popup','location=no,toolbar=no,left=100,top=100,height=600,width=800')) has
an invalid schema.
URLs in reports may only use http://, https://, ftp://, mailto: or news:
I tried with and without "http://" in the string.
TIA,
Surekha.You need to install SP1.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Surekha" <Surekha@.discussions.microsoft.com> wrote in message
news:770516DE-1A42-4FA4-9832-AA107EA59A12@.microsoft.com...
> I am trying to create a popup window from a report.
> Looked thru some previous posts and generated this string in the "Jump to
> url:"
> ="javascript:void(window.open('http://www.yahoo.com',
> 'popup','location=no,toolbar=no,left=100,top=100,height=600,width=800'))"
> But when I try to preview the report I get,
> Processing errors:
> The url javascript:void(window.open('http://www.yahoo.com',
> 'popup','location=no,toolbar=no,left=100,top=100,height=600,width=800'))
has
> an invalid schema.
> URLs in reports may only use http://, https://, ftp://, mailto: or news:
> I tried with and without "http://" in the string.
> TIA,
> Surekha.sql

Jump To URL Bug

I have two different URLs I use for Jump To URL navigation in my
reports.
This one adds a String report parameter on the end and works fine:
=Globals!ReportServerUrl + Globals!ReportFolder +
"?/Detail/Campaign+List&rs:Command=Render&rs:format=HTML4.0&rc:Toolbar=false&rc:Zoom=Whole+Page&rc:Parameters=false&CampaignCode="
+ Fields!CampaignCode.Value
This one adds an Integer report parameter on the end and does not
work:
=Globals!ReportServerUrl + Globals!ReportFolder +
"?/Detail/Order+Detail&rs:Command=Render&rs:format=HTML4.0&rc:Toolbar=false&rc:Zoom=Whole+Page&rc:Parameters=false&OrderID="
+ Fields!OrderID.Value
The two URLs are exactly the same except for the report names and
report parameters passed on the end. For some reason the second URL
that passes an Integer report parameter does not create a Hyperlink at
all, you can't click on it. If you remove the #"&OrderID=" +
Fields!OrderID.Value# (#'s used for reference only) part the field
will become a Hyperlink, but of course the report won't run because it
needs the report parameter passed. I also tried sticking it in the
middle of the URL and still
no dice.
The only conclusion I can come to is that there is a bug passing an
Integer parameter in the Jump To URL. Can someone run a quick test
that replicates this problem and confirm or deny this as being a bug?
Any and all help is appreciated.
FrankFrank,
Use an & instead of the + to concatenate the URL strings. I saw the bug
happen when there is a + sign. When I used the &, it works fine.
"Stoma_Kalos" <fzuma@.yahoo.com> wrote in message
news:e876e3c8.0411231419.5a269fa8@.posting.google.com...
> I have two different URLs I use for Jump To URL navigation in my
> reports.
> This one adds a String report parameter on the end and works fine:
> =Globals!ReportServerUrl + Globals!ReportFolder +
>
"?/Detail/Campaign+List&rs:Command=Render&rs:format=HTML4.0&rc:Toolbar=false
&rc:Zoom=Whole+Page&rc:Parameters=false&CampaignCode="
> + Fields!CampaignCode.Value
> This one adds an Integer report parameter on the end and does not
> work:
> =Globals!ReportServerUrl + Globals!ReportFolder +
>
"?/Detail/Order+Detail&rs:Command=Render&rs:format=HTML4.0&rc:Toolbar=false&
rc:Zoom=Whole+Page&rc:Parameters=false&OrderID="
> + Fields!OrderID.Value
> The two URLs are exactly the same except for the report names and
> report parameters passed on the end. For some reason the second URL
> that passes an Integer report parameter does not create a Hyperlink at
> all, you can't click on it. If you remove the #"&OrderID=" +
> Fields!OrderID.Value# (#'s used for reference only) part the field
> will become a Hyperlink, but of course the report won't run because it
> needs the report parameter passed. I also tried sticking it in the
> middle of the URL and still
> no dice.
> The only conclusion I can come to is that there is a bug passing an
> Integer parameter in the Jump To URL. Can someone run a quick test
> that replicates this problem and confirm or deny this as being a bug?
> Any and all help is appreciated.
> Frank|||What is happening is when you use a + it does a concatenate if they are
strings. If it sees a number it trys to add it (this is a vb thing). Always
use & when concatenating strings.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Stoma_Kalos" <fzuma@.yahoo.com> wrote in message
news:e876e3c8.0411231419.5a269fa8@.posting.google.com...
> I have two different URLs I use for Jump To URL navigation in my
> reports.
> This one adds a String report parameter on the end and works fine:
> =Globals!ReportServerUrl + Globals!ReportFolder +
>
"?/Detail/Campaign+List&rs:Command=Render&rs:format=HTML4.0&rc:Toolbar=false
&rc:Zoom=Whole+Page&rc:Parameters=false&CampaignCode="
> + Fields!CampaignCode.Value
> This one adds an Integer report parameter on the end and does not
> work:
> =Globals!ReportServerUrl + Globals!ReportFolder +
>
"?/Detail/Order+Detail&rs:Command=Render&rs:format=HTML4.0&rc:Toolbar=false&
rc:Zoom=Whole+Page&rc:Parameters=false&OrderID="
> + Fields!OrderID.Value
> The two URLs are exactly the same except for the report names and
> report parameters passed on the end. For some reason the second URL
> that passes an Integer report parameter does not create a Hyperlink at
> all, you can't click on it. If you remove the #"&OrderID=" +
> Fields!OrderID.Value# (#'s used for reference only) part the field
> will become a Hyperlink, but of course the report won't run because it
> needs the report parameter passed. I also tried sticking it in the
> middle of the URL and still
> no dice.
> The only conclusion I can come to is that there is a bug passing an
> Integer parameter in the Jump To URL. Can someone run a quick test
> that replicates this problem and confirm or deny this as being a bug?
> Any and all help is appreciated.
> Frank|||I appreciate both of ya'lls help...I've spent way too much time on
that problem. Thanks!!!
Frank
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message news:<#V2B7Gb0EHA.3336@.TK2MSFTNGP11.phx.gbl>...
> What is happening is when you use a + it does a concatenate if they are
> strings. If it sees a number it trys to add it (this is a vb thing). Always
> use & when concatenating strings.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services|||Just a FYI: the difference between + and & is that a concatenation using &
will implicitly call the .ToString() method on the object before
concatenation.
Concatenating real strings will also work with + instead of &
e.g. ="Hello " + "World"
For other datatypes, you could also use CStr() to convert them to strings:
e.g. =CStr(20)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stoma_Kalos" <fzuma@.yahoo.com> wrote in message
news:e876e3c8.0411291255.3b9241e8@.posting.google.com...
> I appreciate both of ya'lls help...I've spent way too much time on
> that problem. Thanks!!!
> Frank
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:<#V2B7Gb0EHA.3336@.TK2MSFTNGP11.phx.gbl>...
> > What is happening is when you use a + it does a concatenate if they are
> > strings. If it sees a number it trys to add it (this is a vb thing).
Always
> > use & when concatenating strings.
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services

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.

JSP connection string to SQL 2000

Hi,
What will be the connection string in the JSP to SQL
Server 2000?
Thanks.
JasonIf you are using MS JDBC Driver try the following:
jdbc:microsoft:sqlserver:// hostname:1433;DATABASENAME=YourDBName;Se
lectMetho
d=cursor
The SelectMethod=cursor parameter is important to allow multiple
statements per connection.
If you are using the ODBC/JDBC bridge try:
jdbc:odbc:YourOdbcDsnName
Regards,
Chris
JasonHuang8888 wrote:

> Hi,
> What will be the connection string in the JSP to SQL
> Server 2000?
> Thanks.
> Jasonsql

Wednesday, March 21, 2012

Joining tables based on string key - bad idea?

The data already in the tables allows me to obtain what I need by drawing a relationship based on two columns that have nvarchar values but I have noticed that generally tables are related through integer keys. I want to know whether there are downsides to doing this, specifically if the join condition could 'wrongly' fail due to the string nature of the join criteria and thus cause missing rows in my resulting table.

Its typically not that great of an idea because it is going to take SQL SErver longer to join on these fields because they are larger than integer fields. The larger the field value, the longer it takes to compare (and in this case, join).
Tim|||

As Tim indicated, string values for JOINs is generally not a good idea. It has to do with how many bytes of data that has to be stored and read from the indexes. The shorter the values, the quicker index searching becomes.

However, if the string values are 'short' ( < 10 characters ), and the columns are indexed, it will most likely perform fine for you. The variables include the total number of rows in the table, amount of table activity, etc. I would NOT allow these string keys to be easily (if ever) changed.

|||

If you use character columns...

it's also a good idea to put adequate constraints on the columns or define foreign references to help ensure the quality of the data, so you don't end up with broken relationships